diff --git a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/AppServiceDomainResource.cs b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/AppServiceDomainResource.cs index b266a7948be6..d69f4640b97f 100644 --- a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/AppServiceDomainResource.cs +++ b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/AppServiceDomainResource.cs @@ -402,5 +402,65 @@ public virtual Response Renew(CancellationToken cancellationToken = default) throw; } } + + /// + /// Transfer out domain to another registrar + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DomainRegistration/domains/{domainName}/transferOut + /// + /// + /// Operation Id + /// Domains_TransferOut + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> TransferOutAsync(CancellationToken cancellationToken = default) + { + using var scope = _appServiceDomainDomainsClientDiagnostics.CreateScope("AppServiceDomainResource.TransferOut"); + scope.Start(); + try + { + var response = await _appServiceDomainDomainsRestClient.TransferOutAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + return Response.FromValue(new AppServiceDomainResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Transfer out domain to another registrar + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DomainRegistration/domains/{domainName}/transferOut + /// + /// + /// Operation Id + /// Domains_TransferOut + /// + /// + /// + /// The cancellation token to use. + public virtual Response TransferOut(CancellationToken cancellationToken = default) + { + using var scope = _appServiceDomainDomainsClientDiagnostics.CreateScope("AppServiceDomainResource.TransferOut"); + scope.Start(); + try + { + var response = _appServiceDomainDomainsRestClient.TransferOut(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + return Response.FromValue(new AppServiceDomainResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } } } diff --git a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/AppServiceEnvironmentData.cs b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/AppServiceEnvironmentData.cs index ac21acb2b336..101113a13569 100644 --- a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/AppServiceEnvironmentData.cs +++ b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/AppServiceEnvironmentData.cs @@ -48,12 +48,16 @@ public AppServiceEnvironmentData(AzureLocation location) : base(location) /// (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. + /// User added list of IP Ranges allowed on ASE db. /// Flag that displays whether an ASE has linux workers or not. + /// Upgrade Preference. /// Dedicated Host Count. /// Whether or not this App Service Environment is zone-redundant. + /// Full view of the custom domain suffix configuration for ASEv3. + /// Full view of networking configuration for an ASE. + /// Whether an upgrade is available for this App Service Environment. /// Kind of resource. - internal AppServiceEnvironmentData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, ProvisioningState? provisioningState, HostingEnvironmentStatus? status, AppServiceVirtualNetworkProfile virtualNetwork, LoadBalancingMode? internalLoadBalancingMode, string multiSize, int? multiRoleCount, int? ipSslAddressCount, string dnsSuffix, int? maximumNumberOfMachines, int? frontEndScaleFactor, bool? isSuspended, IList clusterSettings, IList userWhitelistedIPRanges, bool? hasLinuxWorkers, int? dedicatedHostCount, bool? isZoneRedundant, string kind) : base(id, name, resourceType, systemData, tags, location) + internal AppServiceEnvironmentData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, ProvisioningState? provisioningState, HostingEnvironmentStatus? status, AppServiceVirtualNetworkProfile virtualNetwork, LoadBalancingMode? internalLoadBalancingMode, string multiSize, int? multiRoleCount, int? ipSslAddressCount, string dnsSuffix, int? maximumNumberOfMachines, int? frontEndScaleFactor, bool? isSuspended, IList clusterSettings, IList userWhitelistedIPRanges, bool? hasLinuxWorkers, UpgradePreference? upgradePreference, int? dedicatedHostCount, bool? isZoneRedundant, CustomDnsSuffixConfigurationData customDnsSuffixConfiguration, AseV3NetworkingConfigurationData networkingConfiguration, UpgradeAvailability? upgradeAvailability, string kind) : base(id, name, resourceType, systemData, tags, location) { ProvisioningState = provisioningState; Status = status; @@ -69,8 +73,12 @@ internal AppServiceEnvironmentData(ResourceIdentifier id, string name, ResourceT ClusterSettings = clusterSettings; UserWhitelistedIPRanges = userWhitelistedIPRanges; HasLinuxWorkers = hasLinuxWorkers; + UpgradePreference = upgradePreference; DedicatedHostCount = dedicatedHostCount; IsZoneRedundant = isZoneRedundant; + CustomDnsSuffixConfiguration = customDnsSuffixConfiguration; + NetworkingConfiguration = networkingConfiguration; + UpgradeAvailability = upgradeAvailability; Kind = kind; } @@ -101,14 +109,22 @@ internal AppServiceEnvironmentData(ResourceIdentifier id, string name, ResourceT public bool? IsSuspended { 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. + /// User added list of IP Ranges allowed on ASE db. public IList UserWhitelistedIPRanges { get; } /// Flag that displays whether an ASE has linux workers or not. public bool? HasLinuxWorkers { get; } + /// Upgrade Preference. + public UpgradePreference? UpgradePreference { get; set; } /// Dedicated Host Count. public int? DedicatedHostCount { get; set; } /// Whether or not this App Service Environment is zone-redundant. public bool? IsZoneRedundant { get; set; } + /// Full view of the custom domain suffix configuration for ASEv3. + public CustomDnsSuffixConfigurationData CustomDnsSuffixConfiguration { get; set; } + /// Full view of networking configuration for an ASE. + public AseV3NetworkingConfigurationData NetworkingConfiguration { get; set; } + /// Whether an upgrade is available for this App Service Environment. + public UpgradeAvailability? UpgradeAvailability { get; } /// Kind of resource. public string Kind { get; set; } } diff --git a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/AppServiceEnvironmentResource.cs b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/AppServiceEnvironmentResource.cs index 0b76f6c55700..971703520e6f 100644 --- a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/AppServiceEnvironmentResource.cs +++ b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/AppServiceEnvironmentResource.cs @@ -156,6 +156,13 @@ public virtual Response GetHostingEnvironmen return GetHostingEnvironmentDetectors().Get(detectorName, startTime, endTime, timeGrain, cancellationToken); } + /// Gets an object representing a CustomDnsSuffixConfigurationResource along with the instance operations that can be performed on it in the AppServiceEnvironment. + /// Returns a object. + public virtual CustomDnsSuffixConfigurationResource GetCustomDnsSuffixConfiguration() + { + return new CustomDnsSuffixConfigurationResource(Client, Id.AppendChildResource("configurations", "customdnssuffix")); + } + /// Gets an object representing a AseV3NetworkingConfigurationResource along with the instance operations that can be performed on it in the AppServiceEnvironment. /// Returns a object. public virtual AseV3NetworkingConfigurationResource GetAseV3NetworkingConfiguration() @@ -795,6 +802,134 @@ public virtual Pageable GetInboundNetworkDependencie return PageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, InboundEnvironmentEndpoint.DeserializeInboundEnvironmentEndpoint, _appServiceEnvironmentClientDiagnostics, Pipeline, "AppServiceEnvironmentResource.GetInboundNetworkDependenciesEndpoints", "value", "nextLink", cancellationToken); } + /// + /// Send a test notification that an upgrade is available for this App Service Environment. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/testUpgradeAvailableNotification + /// + /// + /// Operation Id + /// AppServiceEnvironments_TestUpgradeAvailableNotification + /// + /// + /// + /// The cancellation token to use. + public virtual async Task TestUpgradeAvailableNotificationAsync(CancellationToken cancellationToken = default) + { + using var scope = _appServiceEnvironmentClientDiagnostics.CreateScope("AppServiceEnvironmentResource.TestUpgradeAvailableNotification"); + scope.Start(); + try + { + var response = await _appServiceEnvironmentRestClient.TestUpgradeAvailableNotificationAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + return response; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Send a test notification that an upgrade is available for this App Service Environment. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/testUpgradeAvailableNotification + /// + /// + /// Operation Id + /// AppServiceEnvironments_TestUpgradeAvailableNotification + /// + /// + /// + /// The cancellation token to use. + public virtual Response TestUpgradeAvailableNotification(CancellationToken cancellationToken = default) + { + using var scope = _appServiceEnvironmentClientDiagnostics.CreateScope("AppServiceEnvironmentResource.TestUpgradeAvailableNotification"); + scope.Start(); + try + { + var response = _appServiceEnvironmentRestClient.TestUpgradeAvailableNotification(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + return response; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Description for Initiate an upgrade of an App Service Environment if one is available. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/upgrade + /// + /// + /// Operation Id + /// AppServiceEnvironments_Upgrade + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The cancellation token to use. + public virtual async Task UpgradeAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default) + { + using var scope = _appServiceEnvironmentClientDiagnostics.CreateScope("AppServiceEnvironmentResource.Upgrade"); + scope.Start(); + try + { + var response = await _appServiceEnvironmentRestClient.UpgradeAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + var operation = new AppServiceArmOperation(_appServiceEnvironmentClientDiagnostics, Pipeline, _appServiceEnvironmentRestClient.CreateUpgradeRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Description for Initiate an upgrade of an App Service Environment if one is available. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/upgrade + /// + /// + /// Operation Id + /// AppServiceEnvironments_Upgrade + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The cancellation token to use. + public virtual ArmOperation Upgrade(WaitUntil waitUntil, CancellationToken cancellationToken = default) + { + using var scope = _appServiceEnvironmentClientDiagnostics.CreateScope("AppServiceEnvironmentResource.Upgrade"); + scope.Start(); + try + { + var response = _appServiceEnvironmentRestClient.Upgrade(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + var operation = new AppServiceArmOperation(_appServiceEnvironmentClientDiagnostics, Pipeline, _appServiceEnvironmentRestClient.CreateUpgradeRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletionResponse(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + /// /// Description for List all currently running operations on the App Service Environment. /// diff --git a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/AppServicePlanData.cs b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/AppServicePlanData.cs index c4e3c2d39558..57477eac865b 100644 --- a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/AppServicePlanData.cs +++ b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/AppServicePlanData.cs @@ -40,6 +40,7 @@ public AppServicePlanData(AzureLocation location) : base(location) /// 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. + /// The number of instances that are 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. @@ -64,7 +65,7 @@ public AppServicePlanData(AzureLocation location) : base(location) /// If <code>false</code>, this App Service Plan will not perform availability zone balancing. /// /// Kind of resource. - internal AppServicePlanData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, AppServiceSkuDescription sku, ExtendedLocation extendedLocation, string workerTierName, AppServicePlanStatus? status, string subscription, HostingEnvironmentProfile hostingEnvironmentProfile, int? maximumNumberOfWorkers, string geoRegion, bool? isPerSiteScaling, bool? isElasticScaleEnabled, int? maximumElasticWorkerCount, int? numberOfSites, bool? isSpot, DateTimeOffset? spotExpireOn, DateTimeOffset? freeOfferExpireOn, string resourceGroup, bool? isReserved, bool? isXenon, bool? isHyperV, int? targetWorkerCount, int? targetWorkerSizeId, ProvisioningState? provisioningState, KubeEnvironmentProfile kubeEnvironmentProfile, bool? isZoneRedundant, string kind) : base(id, name, resourceType, systemData, tags, location) + internal AppServicePlanData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, AppServiceSkuDescription sku, ExtendedLocation extendedLocation, string workerTierName, AppServicePlanStatus? status, string subscription, HostingEnvironmentProfile hostingEnvironmentProfile, int? maximumNumberOfWorkers, int? numberOfWorkers, string geoRegion, bool? isPerSiteScaling, bool? isElasticScaleEnabled, int? maximumElasticWorkerCount, int? numberOfSites, bool? isSpot, DateTimeOffset? spotExpireOn, DateTimeOffset? freeOfferExpireOn, string resourceGroup, bool? isReserved, bool? isXenon, bool? isHyperV, int? targetWorkerCount, int? targetWorkerSizeId, ProvisioningState? provisioningState, KubeEnvironmentProfile kubeEnvironmentProfile, bool? isZoneRedundant, string kind) : base(id, name, resourceType, systemData, tags, location) { Sku = sku; ExtendedLocation = extendedLocation; @@ -73,6 +74,7 @@ internal AppServicePlanData(ResourceIdentifier id, string name, ResourceType res Subscription = subscription; HostingEnvironmentProfile = hostingEnvironmentProfile; MaximumNumberOfWorkers = maximumNumberOfWorkers; + NumberOfWorkers = numberOfWorkers; GeoRegion = geoRegion; IsPerSiteScaling = isPerSiteScaling; IsElasticScaleEnabled = isElasticScaleEnabled; @@ -107,6 +109,8 @@ internal AppServicePlanData(ResourceIdentifier id, string name, ResourceType res public HostingEnvironmentProfile HostingEnvironmentProfile { get; set; } /// Maximum number of instances that can be assigned to this App Service plan. public int? MaximumNumberOfWorkers { get; } + /// The number of instances that are assigned to this App Service plan. + public int? NumberOfWorkers { get; } /// Geographical location for the App Service plan. public string GeoRegion { get; } /// diff --git a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/AseV3NetworkingConfigurationData.cs b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/AseV3NetworkingConfigurationData.cs index 1cc6b0bd9bf4..0b8314f7af83 100644 --- a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/AseV3NetworkingConfigurationData.cs +++ b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/AseV3NetworkingConfigurationData.cs @@ -37,14 +37,20 @@ public AseV3NetworkingConfigurationData() /// /// /// Property to enable and disable new private endpoint connection creation on ASE. + /// Property to enable and disable FTP on ASEV3. + /// Property to enable and disable Remote Debug on ASEV3. + /// Customer provided Inbound IP Address. Only able to be set on Ase create. /// Kind of resource. - internal AseV3NetworkingConfigurationData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IReadOnlyList windowsOutboundIPAddresses, IReadOnlyList linuxOutboundIPAddresses, IReadOnlyList externalInboundIPAddresses, IReadOnlyList internalInboundIPAddresses, bool? allowNewPrivateEndpointConnections, string kind) : base(id, name, resourceType, systemData) + internal AseV3NetworkingConfigurationData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IReadOnlyList windowsOutboundIPAddresses, IReadOnlyList linuxOutboundIPAddresses, IReadOnlyList externalInboundIPAddresses, IReadOnlyList internalInboundIPAddresses, bool? allowNewPrivateEndpointConnections, bool? ftpEnabled, bool? remoteDebugEnabled, string inboundIPAddressOverride, string kind) : base(id, name, resourceType, systemData) { WindowsOutboundIPAddresses = windowsOutboundIPAddresses; LinuxOutboundIPAddresses = linuxOutboundIPAddresses; ExternalInboundIPAddresses = externalInboundIPAddresses; InternalInboundIPAddresses = internalInboundIPAddresses; AllowNewPrivateEndpointConnections = allowNewPrivateEndpointConnections; + FtpEnabled = ftpEnabled; + RemoteDebugEnabled = remoteDebugEnabled; + InboundIPAddressOverride = inboundIPAddressOverride; Kind = kind; } @@ -58,6 +64,12 @@ internal AseV3NetworkingConfigurationData(ResourceIdentifier id, string name, Re public IReadOnlyList InternalInboundIPAddresses { get; } /// Property to enable and disable new private endpoint connection creation on ASE. public bool? AllowNewPrivateEndpointConnections { get; set; } + /// Property to enable and disable FTP on ASEV3. + public bool? FtpEnabled { get; set; } + /// Property to enable and disable Remote Debug on ASEV3. + public bool? RemoteDebugEnabled { get; set; } + /// Customer provided Inbound IP Address. Only able to be set on Ase create. + public string InboundIPAddressOverride { get; set; } /// Kind of resource. public string Kind { get; set; } } diff --git a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/AuthsettingsV2SiteConfigResource.cs b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/AuthsettingsV2SiteConfigResource.cs new file mode 100644 index 000000000000..1bf2b367d1b3 --- /dev/null +++ b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/AuthsettingsV2SiteConfigResource.cs @@ -0,0 +1,289 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Azure; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager; + +namespace Azure.ResourceManager.AppService +{ + /// + /// A Class representing an AuthsettingsV2SiteConfig along with the instance operations that can be performed on it. + /// If you have a you can construct an + /// from an instance of using the GetAuthsettingsV2SiteConfigResource method. + /// Otherwise you can get one from its parent resource using the GetAuthsettingsV2SiteConfig method. + /// + public partial class AuthsettingsV2SiteConfigResource : ArmResource + { + /// Generate the resource identifier of a instance. + public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string name) + { + var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/authsettingsV2"; + return new ResourceIdentifier(resourceId); + } + + private readonly ClientDiagnostics _authsettingsV2SiteConfigWebAppsClientDiagnostics; + private readonly WebAppsRestOperations _authsettingsV2SiteConfigWebAppsRestClient; + private readonly SiteAuthSettingsV2Data _data; + + /// Initializes a new instance of the class for mocking. + protected AuthsettingsV2SiteConfigResource() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The resource that is the target of operations. + internal AuthsettingsV2SiteConfigResource(ArmClient client, SiteAuthSettingsV2Data data) : this(client, data.Id) + { + HasData = true; + _data = data; + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The identifier of the resource that is the target of operations. + internal AuthsettingsV2SiteConfigResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _authsettingsV2SiteConfigWebAppsClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.AppService", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string authsettingsV2SiteConfigWebAppsApiVersion); + _authsettingsV2SiteConfigWebAppsRestClient = new WebAppsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, authsettingsV2SiteConfigWebAppsApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + /// Gets the resource type for the operations. + public static readonly ResourceType ResourceType = "Microsoft.Web/sites/config"; + + /// Gets whether or not the current instance has data. + public virtual bool HasData { get; } + + /// Gets the data representing this Feature. + /// Throws if there is no data loaded in the current instance. + public virtual SiteAuthSettingsV2Data Data + { + get + { + if (!HasData) + throw new InvalidOperationException("The current instance does not have data, you must call Get first."); + return _data; + } + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceType), nameof(id)); + } + + /// + /// Description for Gets site's Authentication / Authorization settings for apps via the V2 format + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/authsettingsV2 + /// + /// + /// Operation Id + /// WebApps_GetAuthSettingsV2WithoutSecrets + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + { + using var scope = _authsettingsV2SiteConfigWebAppsClientDiagnostics.CreateScope("AuthsettingsV2SiteConfigResource.Get"); + scope.Start(); + try + { + var response = await _authsettingsV2SiteConfigWebAppsRestClient.GetAuthSettingsV2WithoutSecretsAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new AuthsettingsV2SiteConfigResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Description for Gets site's Authentication / Authorization settings for apps via the V2 format + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/authsettingsV2 + /// + /// + /// Operation Id + /// WebApps_GetAuthSettingsV2WithoutSecrets + /// + /// + /// + /// The cancellation token to use. + public virtual Response Get(CancellationToken cancellationToken = default) + { + using var scope = _authsettingsV2SiteConfigWebAppsClientDiagnostics.CreateScope("AuthsettingsV2SiteConfigResource.Get"); + scope.Start(); + try + { + var response = _authsettingsV2SiteConfigWebAppsRestClient.GetAuthSettingsV2WithoutSecrets(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new AuthsettingsV2SiteConfigResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Description for Updates site's Authentication / Authorization settings for apps via the V2 format + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/authsettingsV2 + /// + /// + /// Operation Id + /// WebApps_UpdateAuthSettingsV2 + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// Auth settings associated with web app. + /// The cancellation token to use. + /// is null. + public virtual async Task> CreateOrUpdateAsync(WaitUntil waitUntil, SiteAuthSettingsV2Data data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _authsettingsV2SiteConfigWebAppsClientDiagnostics.CreateScope("AuthsettingsV2SiteConfigResource.CreateOrUpdate"); + scope.Start(); + try + { + var response = await _authsettingsV2SiteConfigWebAppsRestClient.UpdateAuthSettingsV2Async(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, data, cancellationToken).ConfigureAwait(false); + var operation = new AppServiceArmOperation(Response.FromValue(new AuthsettingsV2SiteConfigResource(Client, response), response.GetRawResponse())); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Description for Updates site's Authentication / Authorization settings for apps via the V2 format + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/authsettingsV2 + /// + /// + /// Operation Id + /// WebApps_UpdateAuthSettingsV2 + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// Auth settings associated with web app. + /// The cancellation token to use. + /// is null. + public virtual ArmOperation CreateOrUpdate(WaitUntil waitUntil, SiteAuthSettingsV2Data data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _authsettingsV2SiteConfigWebAppsClientDiagnostics.CreateScope("AuthsettingsV2SiteConfigResource.CreateOrUpdate"); + scope.Start(); + try + { + var response = _authsettingsV2SiteConfigWebAppsRestClient.UpdateAuthSettingsV2(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, data, cancellationToken); + var operation = new AppServiceArmOperation(Response.FromValue(new AuthsettingsV2SiteConfigResource(Client, response), response.GetRawResponse())); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Description for Gets site's Authentication / Authorization settings for apps via the V2 format + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/authsettingsV2/list + /// + /// + /// Operation Id + /// WebApps_GetAuthSettingsV2 + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> GetAuthSettingsV2Async(CancellationToken cancellationToken = default) + { + using var scope = _authsettingsV2SiteConfigWebAppsClientDiagnostics.CreateScope("AuthsettingsV2SiteConfigResource.GetAuthSettingsV2"); + scope.Start(); + try + { + var response = await _authsettingsV2SiteConfigWebAppsRestClient.GetAuthSettingsV2Async(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, cancellationToken).ConfigureAwait(false); + return Response.FromValue(new AuthsettingsV2SiteConfigResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Description for Gets site's Authentication / Authorization settings for apps via the V2 format + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/authsettingsV2/list + /// + /// + /// Operation Id + /// WebApps_GetAuthSettingsV2 + /// + /// + /// + /// The cancellation token to use. + public virtual Response GetAuthSettingsV2(CancellationToken cancellationToken = default) + { + using var scope = _authsettingsV2SiteConfigWebAppsClientDiagnostics.CreateScope("AuthsettingsV2SiteConfigResource.GetAuthSettingsV2"); + scope.Start(); + try + { + var response = _authsettingsV2SiteConfigWebAppsRestClient.GetAuthSettingsV2(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, cancellationToken); + return Response.FromValue(new AuthsettingsV2SiteConfigResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/AuthsettingsV2SiteSlotConfigResource.cs b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/AuthsettingsV2SiteSlotConfigResource.cs new file mode 100644 index 000000000000..f25e63b07d21 --- /dev/null +++ b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/AuthsettingsV2SiteSlotConfigResource.cs @@ -0,0 +1,289 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Azure; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager; + +namespace Azure.ResourceManager.AppService +{ + /// + /// A Class representing an AuthsettingsV2SiteSlotConfig along with the instance operations that can be performed on it. + /// If you have a you can construct an + /// from an instance of using the GetAuthsettingsV2SiteSlotConfigResource method. + /// Otherwise you can get one from its parent resource using the GetAuthsettingsV2SiteSlotConfig method. + /// + public partial class AuthsettingsV2SiteSlotConfigResource : ArmResource + { + /// Generate the resource identifier of a instance. + public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string name, string slot) + { + var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/authsettingsV2"; + return new ResourceIdentifier(resourceId); + } + + private readonly ClientDiagnostics _authsettingsV2SiteSlotConfigWebAppsClientDiagnostics; + private readonly WebAppsRestOperations _authsettingsV2SiteSlotConfigWebAppsRestClient; + private readonly SiteAuthSettingsV2Data _data; + + /// Initializes a new instance of the class for mocking. + protected AuthsettingsV2SiteSlotConfigResource() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The resource that is the target of operations. + internal AuthsettingsV2SiteSlotConfigResource(ArmClient client, SiteAuthSettingsV2Data data) : this(client, data.Id) + { + HasData = true; + _data = data; + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The identifier of the resource that is the target of operations. + internal AuthsettingsV2SiteSlotConfigResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _authsettingsV2SiteSlotConfigWebAppsClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.AppService", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string authsettingsV2SiteSlotConfigWebAppsApiVersion); + _authsettingsV2SiteSlotConfigWebAppsRestClient = new WebAppsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, authsettingsV2SiteSlotConfigWebAppsApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + /// Gets the resource type for the operations. + public static readonly ResourceType ResourceType = "Microsoft.Web/sites/slots/config"; + + /// Gets whether or not the current instance has data. + public virtual bool HasData { get; } + + /// Gets the data representing this Feature. + /// Throws if there is no data loaded in the current instance. + public virtual SiteAuthSettingsV2Data Data + { + get + { + if (!HasData) + throw new InvalidOperationException("The current instance does not have data, you must call Get first."); + return _data; + } + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceType), nameof(id)); + } + + /// + /// Gets site's Authentication / Authorization settings for apps via the V2 format + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/authsettingsV2 + /// + /// + /// Operation Id + /// WebApps_GetAuthSettingsV2WithoutSecretsSlot + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + { + using var scope = _authsettingsV2SiteSlotConfigWebAppsClientDiagnostics.CreateScope("AuthsettingsV2SiteSlotConfigResource.Get"); + scope.Start(); + try + { + var response = await _authsettingsV2SiteSlotConfigWebAppsRestClient.GetAuthSettingsV2WithoutSecretsSlotAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new AuthsettingsV2SiteSlotConfigResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets site's Authentication / Authorization settings for apps via the V2 format + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/authsettingsV2 + /// + /// + /// Operation Id + /// WebApps_GetAuthSettingsV2WithoutSecretsSlot + /// + /// + /// + /// The cancellation token to use. + public virtual Response Get(CancellationToken cancellationToken = default) + { + using var scope = _authsettingsV2SiteSlotConfigWebAppsClientDiagnostics.CreateScope("AuthsettingsV2SiteSlotConfigResource.Get"); + scope.Start(); + try + { + var response = _authsettingsV2SiteSlotConfigWebAppsRestClient.GetAuthSettingsV2WithoutSecretsSlot(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new AuthsettingsV2SiteSlotConfigResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Description for Updates site's Authentication / Authorization settings for apps via the V2 format + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/authsettingsV2 + /// + /// + /// Operation Id + /// WebApps_UpdateAuthSettingsV2Slot + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// Auth settings associated with web app. + /// The cancellation token to use. + /// is null. + public virtual async Task> CreateOrUpdateAsync(WaitUntil waitUntil, SiteAuthSettingsV2Data data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _authsettingsV2SiteSlotConfigWebAppsClientDiagnostics.CreateScope("AuthsettingsV2SiteSlotConfigResource.CreateOrUpdate"); + scope.Start(); + try + { + var response = await _authsettingsV2SiteSlotConfigWebAppsRestClient.UpdateAuthSettingsV2SlotAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, data, cancellationToken).ConfigureAwait(false); + var operation = new AppServiceArmOperation(Response.FromValue(new AuthsettingsV2SiteSlotConfigResource(Client, response), response.GetRawResponse())); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Description for Updates site's Authentication / Authorization settings for apps via the V2 format + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/authsettingsV2 + /// + /// + /// Operation Id + /// WebApps_UpdateAuthSettingsV2Slot + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// Auth settings associated with web app. + /// The cancellation token to use. + /// is null. + public virtual ArmOperation CreateOrUpdate(WaitUntil waitUntil, SiteAuthSettingsV2Data data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _authsettingsV2SiteSlotConfigWebAppsClientDiagnostics.CreateScope("AuthsettingsV2SiteSlotConfigResource.CreateOrUpdate"); + scope.Start(); + try + { + var response = _authsettingsV2SiteSlotConfigWebAppsRestClient.UpdateAuthSettingsV2Slot(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, data, cancellationToken); + var operation = new AppServiceArmOperation(Response.FromValue(new AuthsettingsV2SiteSlotConfigResource(Client, response), response.GetRawResponse())); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Description for Gets site's Authentication / Authorization settings for apps via the V2 format + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/authsettingsV2/list + /// + /// + /// Operation Id + /// WebApps_GetAuthSettingsV2Slot + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> GetAuthSettingsV2SlotAsync(CancellationToken cancellationToken = default) + { + using var scope = _authsettingsV2SiteSlotConfigWebAppsClientDiagnostics.CreateScope("AuthsettingsV2SiteSlotConfigResource.GetAuthSettingsV2Slot"); + scope.Start(); + try + { + var response = await _authsettingsV2SiteSlotConfigWebAppsRestClient.GetAuthSettingsV2SlotAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, cancellationToken).ConfigureAwait(false); + return Response.FromValue(new AuthsettingsV2SiteSlotConfigResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Description for Gets site's Authentication / Authorization settings for apps via the V2 format + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/authsettingsV2/list + /// + /// + /// Operation Id + /// WebApps_GetAuthSettingsV2Slot + /// + /// + /// + /// The cancellation token to use. + public virtual Response GetAuthSettingsV2Slot(CancellationToken cancellationToken = default) + { + using var scope = _authsettingsV2SiteSlotConfigWebAppsClientDiagnostics.CreateScope("AuthsettingsV2SiteSlotConfigResource.GetAuthSettingsV2Slot"); + scope.Start(); + try + { + var response = _authsettingsV2SiteSlotConfigWebAppsRestClient.GetAuthSettingsV2Slot(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, cancellationToken); + return Response.FromValue(new AuthsettingsV2SiteSlotConfigResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/ContainerAppCollection.cs b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/ContainerAppCollection.cs new file mode 100644 index 000000000000..2b1375c3237e --- /dev/null +++ b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/ContainerAppCollection.cs @@ -0,0 +1,341 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Azure; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager; +using Azure.ResourceManager.Resources; + +namespace Azure.ResourceManager.AppService +{ + /// + /// A class representing a collection of and their operations. + /// Each in the collection will belong to the same instance of . + /// To get a instance call the GetContainerApps method from an instance of . + /// + public partial class ContainerAppCollection : ArmCollection, IEnumerable, IAsyncEnumerable + { + private readonly ClientDiagnostics _containerAppClientDiagnostics; + private readonly ContainerAppsRestOperations _containerAppRestClient; + + /// Initializes a new instance of the class for mocking. + protected ContainerAppCollection() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The identifier of the parent resource that is the target of operations. + internal ContainerAppCollection(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _containerAppClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.AppService", ContainerAppResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ContainerAppResource.ResourceType, out string containerAppApiVersion); + _containerAppRestClient = new ContainerAppsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, containerAppApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != ResourceGroupResource.ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceGroupResource.ResourceType), nameof(id)); + } + + /// + /// Description for Create or update a Container App. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/containerApps/{name} + /// + /// + /// Operation Id + /// ContainerApps_CreateOrUpdate + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// Name of the Container App. + /// The ContainerApp to use. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// or is null. + public virtual async Task> CreateOrUpdateAsync(WaitUntil waitUntil, string name, ContainerAppData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(name, nameof(name)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _containerAppClientDiagnostics.CreateScope("ContainerAppCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = await _containerAppRestClient.CreateOrUpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, name, data, cancellationToken).ConfigureAwait(false); + var operation = new AppServiceArmOperation(new ContainerAppOperationSource(Client), _containerAppClientDiagnostics, Pipeline, _containerAppRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, name, data).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Description for Create or update a Container App. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/containerApps/{name} + /// + /// + /// Operation Id + /// ContainerApps_CreateOrUpdate + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// Name of the Container App. + /// The ContainerApp to use. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// or is null. + public virtual ArmOperation CreateOrUpdate(WaitUntil waitUntil, string name, ContainerAppData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(name, nameof(name)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _containerAppClientDiagnostics.CreateScope("ContainerAppCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = _containerAppRestClient.CreateOrUpdate(Id.SubscriptionId, Id.ResourceGroupName, name, data, cancellationToken); + var operation = new AppServiceArmOperation(new ContainerAppOperationSource(Client), _containerAppClientDiagnostics, Pipeline, _containerAppRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, name, data).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get the properties of a Container App. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/containerApps/{name} + /// + /// + /// Operation Id + /// ContainerApps_Get + /// + /// + /// + /// Name of the Container App. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetAsync(string name, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(name, nameof(name)); + + using var scope = _containerAppClientDiagnostics.CreateScope("ContainerAppCollection.Get"); + scope.Start(); + try + { + var response = await _containerAppRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, name, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new ContainerAppResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get the properties of a Container App. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/containerApps/{name} + /// + /// + /// Operation Id + /// ContainerApps_Get + /// + /// + /// + /// Name of the Container App. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Get(string name, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(name, nameof(name)); + + using var scope = _containerAppClientDiagnostics.CreateScope("ContainerAppCollection.Get"); + scope.Start(); + try + { + var response = _containerAppRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, name, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new ContainerAppResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get the Container Apps in a given resource group. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/containerApps + /// + /// + /// Operation Id + /// ContainerApps_ListByResourceGroup + /// + /// + /// + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetAllAsync(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _containerAppRestClient.CreateListByResourceGroupRequest(Id.SubscriptionId, Id.ResourceGroupName); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _containerAppRestClient.CreateListByResourceGroupNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName); + return PageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new ContainerAppResource(Client, ContainerAppData.DeserializeContainerAppData(e)), _containerAppClientDiagnostics, Pipeline, "ContainerAppCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Get the Container Apps in a given resource group. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/containerApps + /// + /// + /// Operation Id + /// ContainerApps_ListByResourceGroup + /// + /// + /// + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetAll(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _containerAppRestClient.CreateListByResourceGroupRequest(Id.SubscriptionId, Id.ResourceGroupName); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _containerAppRestClient.CreateListByResourceGroupNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName); + return PageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new ContainerAppResource(Client, ContainerAppData.DeserializeContainerAppData(e)), _containerAppClientDiagnostics, Pipeline, "ContainerAppCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/containerApps/{name} + /// + /// + /// Operation Id + /// ContainerApps_Get + /// + /// + /// + /// Name of the Container App. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> ExistsAsync(string name, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(name, nameof(name)); + + using var scope = _containerAppClientDiagnostics.CreateScope("ContainerAppCollection.Exists"); + scope.Start(); + try + { + var response = await _containerAppRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, name, cancellationToken: cancellationToken).ConfigureAwait(false); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/containerApps/{name} + /// + /// + /// Operation Id + /// ContainerApps_Get + /// + /// + /// + /// Name of the Container App. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Exists(string name, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(name, nameof(name)); + + using var scope = _containerAppClientDiagnostics.CreateScope("ContainerAppCollection.Exists"); + scope.Start(); + try + { + var response = _containerAppRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, name, cancellationToken: cancellationToken); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetAll().GetEnumerator(); + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetAll().GetEnumerator(); + } + + IAsyncEnumerator IAsyncEnumerable.GetAsyncEnumerator(CancellationToken cancellationToken) + { + return GetAllAsync(cancellationToken: cancellationToken).GetAsyncEnumerator(cancellationToken); + } + } +} diff --git a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/ContainerAppData.cs b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/ContainerAppData.cs new file mode 100644 index 000000000000..2fd273aef948 --- /dev/null +++ b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/ContainerAppData.cs @@ -0,0 +1,67 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using Azure.Core; +using Azure.ResourceManager.AppService.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.AppService +{ + /// + /// A class representing the ContainerApp data model. + /// Container App. + /// + public partial class ContainerAppData : TrackedResourceData + { + /// Initializes a new instance of ContainerAppData. + /// The location. + public ContainerAppData(AzureLocation location) : base(location) + { + } + + /// Initializes a new instance of ContainerAppData. + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The tags. + /// The location. + /// Provisioning state of the Container App. + /// Resource ID of the Container App's KubeEnvironment. + /// Name of the latest revision of the Container App. + /// Fully Qualified Domain Name of the latest revision of the Container App. + /// Non versioned Container App configuration properties. + /// Container App versioned application definition. + /// Kind of resource. + internal ContainerAppData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, ContainerAppProvisioningState? provisioningState, string kubeEnvironmentId, string latestRevisionName, string latestRevisionFqdn, Configuration configuration, Template template, string kind) : base(id, name, resourceType, systemData, tags, location) + { + ProvisioningState = provisioningState; + KubeEnvironmentId = kubeEnvironmentId; + LatestRevisionName = latestRevisionName; + LatestRevisionFqdn = latestRevisionFqdn; + Configuration = configuration; + Template = template; + Kind = kind; + } + + /// Provisioning state of the Container App. + public ContainerAppProvisioningState? ProvisioningState { get; } + /// Resource ID of the Container App's KubeEnvironment. + public string KubeEnvironmentId { get; set; } + /// Name of the latest revision of the Container App. + public string LatestRevisionName { get; } + /// Fully Qualified Domain Name of the latest revision of the Container App. + public string LatestRevisionFqdn { get; } + /// Non versioned Container App configuration properties. + public Configuration Configuration { get; set; } + /// Container App versioned application definition. + public Template Template { get; set; } + /// Kind of resource. + public string Kind { get; set; } + } +} diff --git a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/ContainerAppResource.cs b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/ContainerAppResource.cs new file mode 100644 index 000000000000..2e529bc37f24 --- /dev/null +++ b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/ContainerAppResource.cs @@ -0,0 +1,640 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Azure; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager; +using Azure.ResourceManager.Resources; + +namespace Azure.ResourceManager.AppService +{ + /// + /// A Class representing a ContainerApp along with the instance operations that can be performed on it. + /// If you have a you can construct a + /// from an instance of using the GetContainerAppResource method. + /// Otherwise you can get one from its parent resource using the GetContainerApp method. + /// + public partial class ContainerAppResource : ArmResource + { + /// Generate the resource identifier of a instance. + public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string name) + { + var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/containerApps/{name}"; + return new ResourceIdentifier(resourceId); + } + + private readonly ClientDiagnostics _containerAppClientDiagnostics; + private readonly ContainerAppsRestOperations _containerAppRestClient; + private readonly ContainerAppData _data; + + /// Initializes a new instance of the class for mocking. + protected ContainerAppResource() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The resource that is the target of operations. + internal ContainerAppResource(ArmClient client, ContainerAppData data) : this(client, data.Id) + { + HasData = true; + _data = data; + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The identifier of the resource that is the target of operations. + internal ContainerAppResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _containerAppClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.AppService", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string containerAppApiVersion); + _containerAppRestClient = new ContainerAppsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, containerAppApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + /// Gets the resource type for the operations. + public static readonly ResourceType ResourceType = "Microsoft.Web/containerApps"; + + /// Gets whether or not the current instance has data. + public virtual bool HasData { get; } + + /// Gets the data representing this Feature. + /// Throws if there is no data loaded in the current instance. + public virtual ContainerAppData Data + { + get + { + if (!HasData) + throw new InvalidOperationException("The current instance does not have data, you must call Get first."); + return _data; + } + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceType), nameof(id)); + } + + /// Gets a collection of RevisionResources in the ContainerApp. + /// An object representing collection of RevisionResources and their operations over a RevisionResource. + public virtual RevisionCollection GetRevisions() + { + return GetCachedClient(Client => new RevisionCollection(Client, Id)); + } + + /// + /// Get a revision of a Container App. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/containerApps/{containerAppName}/revisions/{name} + /// + /// + /// Operation Id + /// ContainerAppsRevisions_GetRevision + /// + /// + /// + /// Name of the Container App Revision. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + [ForwardsClientCalls] + public virtual async Task> GetRevisionAsync(string name, CancellationToken cancellationToken = default) + { + return await GetRevisions().GetAsync(name, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get a revision of a Container App. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/containerApps/{containerAppName}/revisions/{name} + /// + /// + /// Operation Id + /// ContainerAppsRevisions_GetRevision + /// + /// + /// + /// Name of the Container App Revision. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + [ForwardsClientCalls] + public virtual Response GetRevision(string name, CancellationToken cancellationToken = default) + { + return GetRevisions().Get(name, cancellationToken); + } + + /// + /// Get the properties of a Container App. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/containerApps/{name} + /// + /// + /// Operation Id + /// ContainerApps_Get + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + { + using var scope = _containerAppClientDiagnostics.CreateScope("ContainerAppResource.Get"); + scope.Start(); + try + { + var response = await _containerAppRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new ContainerAppResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get the properties of a Container App. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/containerApps/{name} + /// + /// + /// Operation Id + /// ContainerApps_Get + /// + /// + /// + /// The cancellation token to use. + public virtual Response Get(CancellationToken cancellationToken = default) + { + using var scope = _containerAppClientDiagnostics.CreateScope("ContainerAppResource.Get"); + scope.Start(); + try + { + var response = _containerAppRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new ContainerAppResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Description for Delete a Container App. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/containerApps/{name} + /// + /// + /// Operation Id + /// ContainerApps_Delete + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The cancellation token to use. + public virtual async Task DeleteAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default) + { + using var scope = _containerAppClientDiagnostics.CreateScope("ContainerAppResource.Delete"); + scope.Start(); + try + { + var response = await _containerAppRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + var operation = new AppServiceArmOperation(_containerAppClientDiagnostics, Pipeline, _containerAppRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Description for Delete a Container App. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/containerApps/{name} + /// + /// + /// Operation Id + /// ContainerApps_Delete + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The cancellation token to use. + public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancellationToken = default) + { + using var scope = _containerAppClientDiagnostics.CreateScope("ContainerAppResource.Delete"); + scope.Start(); + try + { + var response = _containerAppRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + var operation = new AppServiceArmOperation(_containerAppClientDiagnostics, Pipeline, _containerAppRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletionResponse(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Description for Create or update a Container App. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/containerApps/{name} + /// + /// + /// Operation Id + /// ContainerApps_CreateOrUpdate + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The ContainerApp to use. + /// The cancellation token to use. + /// is null. + public virtual async Task> UpdateAsync(WaitUntil waitUntil, ContainerAppData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _containerAppClientDiagnostics.CreateScope("ContainerAppResource.Update"); + scope.Start(); + try + { + var response = await _containerAppRestClient.CreateOrUpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, data, cancellationToken).ConfigureAwait(false); + var operation = new AppServiceArmOperation(new ContainerAppOperationSource(Client), _containerAppClientDiagnostics, Pipeline, _containerAppRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, data).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Description for Create or update a Container App. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/containerApps/{name} + /// + /// + /// Operation Id + /// ContainerApps_CreateOrUpdate + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The ContainerApp to use. + /// The cancellation token to use. + /// is null. + public virtual ArmOperation Update(WaitUntil waitUntil, ContainerAppData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _containerAppClientDiagnostics.CreateScope("ContainerAppResource.Update"); + scope.Start(); + try + { + var response = _containerAppRestClient.CreateOrUpdate(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, data, cancellationToken); + var operation = new AppServiceArmOperation(new ContainerAppOperationSource(Client), _containerAppClientDiagnostics, Pipeline, _containerAppRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, data).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Add a tag to the current resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/containerApps/{name} + /// + /// + /// Operation Id + /// ContainerApps_Get + /// + /// + /// + /// The key for the tag. + /// The value for the tag. + /// The cancellation token to use. + /// or is null. + public virtual async Task> AddTagAsync(string key, string value, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(key, nameof(key)); + Argument.AssertNotNull(value, nameof(value)); + + using var scope = _containerAppClientDiagnostics.CreateScope("ContainerAppResource.AddTag"); + scope.Start(); + try + { + if (await CanUseTagResourceAsync(cancellationToken: cancellationToken).ConfigureAwait(false)) + { + var originalTags = await GetTagResource().GetAsync(cancellationToken).ConfigureAwait(false); + originalTags.Value.Data.TagValues[key] = value; + await GetTagResource().CreateOrUpdateAsync(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken).ConfigureAwait(false); + var originalResponse = await _containerAppRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + return Response.FromValue(new ContainerAppResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; + current.Tags[key] = value; + var result = await UpdateAsync(WaitUntil.Completed, current, cancellationToken: cancellationToken).ConfigureAwait(false); + return Response.FromValue(result.Value, result.GetRawResponse()); + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Add a tag to the current resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/containerApps/{name} + /// + /// + /// Operation Id + /// ContainerApps_Get + /// + /// + /// + /// The key for the tag. + /// The value for the tag. + /// The cancellation token to use. + /// or is null. + public virtual Response AddTag(string key, string value, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(key, nameof(key)); + Argument.AssertNotNull(value, nameof(value)); + + using var scope = _containerAppClientDiagnostics.CreateScope("ContainerAppResource.AddTag"); + scope.Start(); + try + { + if (CanUseTagResource(cancellationToken: cancellationToken)) + { + var originalTags = GetTagResource().Get(cancellationToken); + originalTags.Value.Data.TagValues[key] = value; + GetTagResource().CreateOrUpdate(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken); + var originalResponse = _containerAppRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + return Response.FromValue(new ContainerAppResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = Get(cancellationToken: cancellationToken).Value.Data; + current.Tags[key] = value; + var result = Update(WaitUntil.Completed, current, cancellationToken: cancellationToken); + return Response.FromValue(result.Value, result.GetRawResponse()); + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Replace the tags on the resource with the given set. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/containerApps/{name} + /// + /// + /// Operation Id + /// ContainerApps_Get + /// + /// + /// + /// The set of tags to use as replacement. + /// The cancellation token to use. + /// is null. + public virtual async Task> SetTagsAsync(IDictionary tags, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(tags, nameof(tags)); + + using var scope = _containerAppClientDiagnostics.CreateScope("ContainerAppResource.SetTags"); + scope.Start(); + try + { + if (await CanUseTagResourceAsync(cancellationToken: cancellationToken).ConfigureAwait(false)) + { + await GetTagResource().DeleteAsync(WaitUntil.Completed, cancellationToken: cancellationToken).ConfigureAwait(false); + var originalTags = await GetTagResource().GetAsync(cancellationToken).ConfigureAwait(false); + originalTags.Value.Data.TagValues.ReplaceWith(tags); + await GetTagResource().CreateOrUpdateAsync(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken).ConfigureAwait(false); + var originalResponse = await _containerAppRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + return Response.FromValue(new ContainerAppResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; + current.Tags.ReplaceWith(tags); + var result = await UpdateAsync(WaitUntil.Completed, current, cancellationToken: cancellationToken).ConfigureAwait(false); + return Response.FromValue(result.Value, result.GetRawResponse()); + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Replace the tags on the resource with the given set. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/containerApps/{name} + /// + /// + /// Operation Id + /// ContainerApps_Get + /// + /// + /// + /// The set of tags to use as replacement. + /// The cancellation token to use. + /// is null. + public virtual Response SetTags(IDictionary tags, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(tags, nameof(tags)); + + using var scope = _containerAppClientDiagnostics.CreateScope("ContainerAppResource.SetTags"); + scope.Start(); + try + { + if (CanUseTagResource(cancellationToken: cancellationToken)) + { + GetTagResource().Delete(WaitUntil.Completed, cancellationToken: cancellationToken); + var originalTags = GetTagResource().Get(cancellationToken); + originalTags.Value.Data.TagValues.ReplaceWith(tags); + GetTagResource().CreateOrUpdate(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken); + var originalResponse = _containerAppRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + return Response.FromValue(new ContainerAppResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = Get(cancellationToken: cancellationToken).Value.Data; + current.Tags.ReplaceWith(tags); + var result = Update(WaitUntil.Completed, current, cancellationToken: cancellationToken); + return Response.FromValue(result.Value, result.GetRawResponse()); + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Removes a tag by key from the resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/containerApps/{name} + /// + /// + /// Operation Id + /// ContainerApps_Get + /// + /// + /// + /// The key for the tag. + /// The cancellation token to use. + /// is null. + public virtual async Task> RemoveTagAsync(string key, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(key, nameof(key)); + + using var scope = _containerAppClientDiagnostics.CreateScope("ContainerAppResource.RemoveTag"); + scope.Start(); + try + { + if (await CanUseTagResourceAsync(cancellationToken: cancellationToken).ConfigureAwait(false)) + { + var originalTags = await GetTagResource().GetAsync(cancellationToken).ConfigureAwait(false); + originalTags.Value.Data.TagValues.Remove(key); + await GetTagResource().CreateOrUpdateAsync(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken).ConfigureAwait(false); + var originalResponse = await _containerAppRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + return Response.FromValue(new ContainerAppResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; + current.Tags.Remove(key); + var result = await UpdateAsync(WaitUntil.Completed, current, cancellationToken: cancellationToken).ConfigureAwait(false); + return Response.FromValue(result.Value, result.GetRawResponse()); + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Removes a tag by key from the resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/containerApps/{name} + /// + /// + /// Operation Id + /// ContainerApps_Get + /// + /// + /// + /// The key for the tag. + /// The cancellation token to use. + /// is null. + public virtual Response RemoveTag(string key, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(key, nameof(key)); + + using var scope = _containerAppClientDiagnostics.CreateScope("ContainerAppResource.RemoveTag"); + scope.Start(); + try + { + if (CanUseTagResource(cancellationToken: cancellationToken)) + { + var originalTags = GetTagResource().Get(cancellationToken); + originalTags.Value.Data.TagValues.Remove(key); + GetTagResource().CreateOrUpdate(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken); + var originalResponse = _containerAppRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + return Response.FromValue(new ContainerAppResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = Get(cancellationToken: cancellationToken).Value.Data; + current.Tags.Remove(key); + var result = Update(WaitUntil.Completed, current, cancellationToken: cancellationToken); + return Response.FromValue(result.Value, result.GetRawResponse()); + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/CsmDeploymentStatusData.cs b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/CsmDeploymentStatusData.cs new file mode 100644 index 000000000000..05331ccc4d64 --- /dev/null +++ b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/CsmDeploymentStatusData.cs @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using Azure.Core; +using Azure.ResourceManager.AppService.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.AppService +{ + /// + /// A class representing the CsmDeploymentStatus data model. + /// Deployment status response payload. + /// + public partial class CsmDeploymentStatusData : ResourceData + { + /// Initializes a new instance of CsmDeploymentStatusData. + public CsmDeploymentStatusData() + { + FailedInstancesLogs = new ChangeTrackingList(); + Errors = new ChangeTrackingList(); + } + + /// Initializes a new instance of CsmDeploymentStatusData. + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// Deployment operation id. + /// Deployment build status. + /// Number of site instances currently being provisioned. + /// Number of site instances provisioned successfully. + /// Number of site instances failed to provision. + /// List of URLs pointing to logs for instances which failed to provision. + /// List of errors. + /// Kind of resource. + internal CsmDeploymentStatusData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, string deploymentId, DeploymentBuildStatus? status, int? numberOfInstancesInProgress, int? numberOfInstancesSuccessful, int? numberOfInstancesFailed, IList failedInstancesLogs, IList errors, string kind) : base(id, name, resourceType, systemData) + { + DeploymentId = deploymentId; + Status = status; + NumberOfInstancesInProgress = numberOfInstancesInProgress; + NumberOfInstancesSuccessful = numberOfInstancesSuccessful; + NumberOfInstancesFailed = numberOfInstancesFailed; + FailedInstancesLogs = failedInstancesLogs; + Errors = errors; + Kind = kind; + } + + /// Deployment operation id. + public string DeploymentId { get; set; } + /// Deployment build status. + public DeploymentBuildStatus? Status { get; set; } + /// Number of site instances currently being provisioned. + public int? NumberOfInstancesInProgress { get; set; } + /// Number of site instances provisioned successfully. + public int? NumberOfInstancesSuccessful { get; set; } + /// Number of site instances failed to provision. + public int? NumberOfInstancesFailed { get; set; } + /// List of URLs pointing to logs for instances which failed to provision. + public IList FailedInstancesLogs { get; } + /// List of errors. + public IList Errors { get; } + /// Kind of resource. + public string Kind { get; set; } + } +} diff --git a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/CustomDnsSuffixConfigurationData.cs b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/CustomDnsSuffixConfigurationData.cs new file mode 100644 index 000000000000..9ca7d5b087fb --- /dev/null +++ b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/CustomDnsSuffixConfigurationData.cs @@ -0,0 +1,60 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using Azure.Core; +using Azure.ResourceManager.AppService.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.AppService +{ + /// + /// A class representing the CustomDnsSuffixConfiguration data model. + /// Full view of the custom domain suffix configuration for ASEv3. + /// + public partial class CustomDnsSuffixConfigurationData : ResourceData + { + /// Initializes a new instance of CustomDnsSuffixConfigurationData. + public CustomDnsSuffixConfigurationData() + { + } + + /// Initializes a new instance of CustomDnsSuffixConfigurationData. + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// + /// + /// The default custom domain suffix to use for all sites deployed on the ASE. + /// The URL referencing the Azure Key Vault certificate secret that should be used as the default SSL/TLS certificate for sites with the custom domain suffix. + /// The user-assigned identity to use for resolving the key vault certificate reference. If not specified, the system-assigned ASE identity will be used if available. + /// Kind of resource. + internal CustomDnsSuffixConfigurationData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, CustomDnsSuffixProvisioningState? provisioningState, string provisioningDetails, string dnsSuffix, Uri certificateUri, string keyVaultReferenceIdentity, string kind) : base(id, name, resourceType, systemData) + { + ProvisioningState = provisioningState; + ProvisioningDetails = provisioningDetails; + DnsSuffix = dnsSuffix; + CertificateUri = certificateUri; + KeyVaultReferenceIdentity = keyVaultReferenceIdentity; + Kind = kind; + } + + /// Gets the provisioning state. + public CustomDnsSuffixProvisioningState? ProvisioningState { get; } + /// Gets the provisioning details. + public string ProvisioningDetails { get; } + /// The default custom domain suffix to use for all sites deployed on the ASE. + public string DnsSuffix { get; set; } + /// The URL referencing the Azure Key Vault certificate secret that should be used as the default SSL/TLS certificate for sites with the custom domain suffix. + public Uri CertificateUri { get; set; } + /// The user-assigned identity to use for resolving the key vault certificate reference. If not specified, the system-assigned ASE identity will be used if available. + public string KeyVaultReferenceIdentity { get; set; } + /// Kind of resource. + public string Kind { get; set; } + } +} diff --git a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/CustomDnsSuffixConfigurationResource.cs b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/CustomDnsSuffixConfigurationResource.cs new file mode 100644 index 000000000000..81fd209e6b03 --- /dev/null +++ b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/CustomDnsSuffixConfigurationResource.cs @@ -0,0 +1,297 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Azure; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager; + +namespace Azure.ResourceManager.AppService +{ + /// + /// A Class representing a CustomDnsSuffixConfiguration along with the instance operations that can be performed on it. + /// If you have a you can construct a + /// from an instance of using the GetCustomDnsSuffixConfigurationResource method. + /// Otherwise you can get one from its parent resource using the GetCustomDnsSuffixConfiguration method. + /// + public partial class CustomDnsSuffixConfigurationResource : ArmResource + { + /// Generate the resource identifier of a instance. + public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string name) + { + var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/configurations/customdnssuffix"; + return new ResourceIdentifier(resourceId); + } + + private readonly ClientDiagnostics _customDnsSuffixConfigurationAppServiceEnvironmentsClientDiagnostics; + private readonly AppServiceEnvironmentsRestOperations _customDnsSuffixConfigurationAppServiceEnvironmentsRestClient; + private readonly CustomDnsSuffixConfigurationData _data; + + /// Initializes a new instance of the class for mocking. + protected CustomDnsSuffixConfigurationResource() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The resource that is the target of operations. + internal CustomDnsSuffixConfigurationResource(ArmClient client, CustomDnsSuffixConfigurationData data) : this(client, data.Id) + { + HasData = true; + _data = data; + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The identifier of the resource that is the target of operations. + internal CustomDnsSuffixConfigurationResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _customDnsSuffixConfigurationAppServiceEnvironmentsClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.AppService", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string customDnsSuffixConfigurationAppServiceEnvironmentsApiVersion); + _customDnsSuffixConfigurationAppServiceEnvironmentsRestClient = new AppServiceEnvironmentsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, customDnsSuffixConfigurationAppServiceEnvironmentsApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + /// Gets the resource type for the operations. + public static readonly ResourceType ResourceType = "Microsoft.Web/hostingEnvironments/configurations"; + + /// Gets whether or not the current instance has data. + public virtual bool HasData { get; } + + /// Gets the data representing this Feature. + /// Throws if there is no data loaded in the current instance. + public virtual CustomDnsSuffixConfigurationData Data + { + get + { + if (!HasData) + throw new InvalidOperationException("The current instance does not have data, you must call Get first."); + return _data; + } + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceType), nameof(id)); + } + + /// + /// Get Custom Dns Suffix configuration of an App Service Environment + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/configurations/customdnssuffix + /// + /// + /// Operation Id + /// AppServiceEnvironments_GetAseCustomDnsSuffixConfiguration + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + { + using var scope = _customDnsSuffixConfigurationAppServiceEnvironmentsClientDiagnostics.CreateScope("CustomDnsSuffixConfigurationResource.Get"); + scope.Start(); + try + { + var response = await _customDnsSuffixConfigurationAppServiceEnvironmentsRestClient.GetAseCustomDnsSuffixConfigurationAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new CustomDnsSuffixConfigurationResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get Custom Dns Suffix configuration of an App Service Environment + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/configurations/customdnssuffix + /// + /// + /// Operation Id + /// AppServiceEnvironments_GetAseCustomDnsSuffixConfiguration + /// + /// + /// + /// The cancellation token to use. + public virtual Response Get(CancellationToken cancellationToken = default) + { + using var scope = _customDnsSuffixConfigurationAppServiceEnvironmentsClientDiagnostics.CreateScope("CustomDnsSuffixConfigurationResource.Get"); + scope.Start(); + try + { + var response = _customDnsSuffixConfigurationAppServiceEnvironmentsRestClient.GetAseCustomDnsSuffixConfiguration(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new CustomDnsSuffixConfigurationResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Delete Custom Dns Suffix configuration of an App Service Environment + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/configurations/customdnssuffix + /// + /// + /// Operation Id + /// AppServiceEnvironments_DeleteAseCustomDnsSuffixConfiguration + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The cancellation token to use. + public virtual async Task> DeleteAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default) + { + using var scope = _customDnsSuffixConfigurationAppServiceEnvironmentsClientDiagnostics.CreateScope("CustomDnsSuffixConfigurationResource.Delete"); + scope.Start(); + try + { + var response = await _customDnsSuffixConfigurationAppServiceEnvironmentsRestClient.DeleteAseCustomDnsSuffixConfigurationAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, cancellationToken).ConfigureAwait(false); + var operation = new AppServiceArmOperation(response); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Delete Custom Dns Suffix configuration of an App Service Environment + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/configurations/customdnssuffix + /// + /// + /// Operation Id + /// AppServiceEnvironments_DeleteAseCustomDnsSuffixConfiguration + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The cancellation token to use. + public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancellationToken = default) + { + using var scope = _customDnsSuffixConfigurationAppServiceEnvironmentsClientDiagnostics.CreateScope("CustomDnsSuffixConfigurationResource.Delete"); + scope.Start(); + try + { + var response = _customDnsSuffixConfigurationAppServiceEnvironmentsRestClient.DeleteAseCustomDnsSuffixConfiguration(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, cancellationToken); + var operation = new AppServiceArmOperation(response); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Update Custom Dns Suffix configuration of an App Service Environment + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/configurations/customdnssuffix + /// + /// + /// Operation Id + /// AppServiceEnvironments_UpdateAseCustomDnsSuffixConfiguration + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The CustomDnsSuffixConfiguration to use. + /// The cancellation token to use. + /// is null. + public virtual async Task> CreateOrUpdateAsync(WaitUntil waitUntil, CustomDnsSuffixConfigurationData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _customDnsSuffixConfigurationAppServiceEnvironmentsClientDiagnostics.CreateScope("CustomDnsSuffixConfigurationResource.CreateOrUpdate"); + scope.Start(); + try + { + var response = await _customDnsSuffixConfigurationAppServiceEnvironmentsRestClient.UpdateAseCustomDnsSuffixConfigurationAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, data, cancellationToken).ConfigureAwait(false); + var operation = new AppServiceArmOperation(Response.FromValue(new CustomDnsSuffixConfigurationResource(Client, response), response.GetRawResponse())); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Update Custom Dns Suffix configuration of an App Service Environment + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/configurations/customdnssuffix + /// + /// + /// Operation Id + /// AppServiceEnvironments_UpdateAseCustomDnsSuffixConfiguration + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The CustomDnsSuffixConfiguration to use. + /// The cancellation token to use. + /// is null. + public virtual ArmOperation CreateOrUpdate(WaitUntil waitUntil, CustomDnsSuffixConfigurationData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _customDnsSuffixConfigurationAppServiceEnvironmentsClientDiagnostics.CreateScope("CustomDnsSuffixConfigurationResource.CreateOrUpdate"); + scope.Start(); + try + { + var response = _customDnsSuffixConfigurationAppServiceEnvironmentsRestClient.UpdateAseCustomDnsSuffixConfiguration(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, data, cancellationToken); + var operation = new AppServiceArmOperation(Response.FromValue(new CustomDnsSuffixConfigurationResource(Client, response), response.GetRawResponse())); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Extensions/AppServiceExtensions.cs b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Extensions/AppServiceExtensions.cs index 883689b5ee41..e15a9349723c 100644 --- a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Extensions/AppServiceExtensions.cs +++ b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Extensions/AppServiceExtensions.cs @@ -969,6 +969,100 @@ public static Pageable GetAppCertificates(this Subscript return GetExtensionClient(subscriptionResource).GetAppCertificates(filter, cancellationToken); } + /// + /// Get the Container Apps in a given subscription. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.Web/containerApps + /// + /// + /// Operation Id + /// ContainerApps_ListBySubscription + /// + /// + /// + /// The instance the method will execute against. + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public static AsyncPageable GetContainerAppsAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) + { + return GetExtensionClient(subscriptionResource).GetContainerAppsAsync(cancellationToken); + } + + /// + /// Get the Container Apps in a given subscription. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.Web/containerApps + /// + /// + /// Operation Id + /// ContainerApps_ListBySubscription + /// + /// + /// + /// The instance the method will execute against. + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public static Pageable GetContainerApps(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) + { + return GetExtensionClient(subscriptionResource).GetContainerApps(cancellationToken); + } + + /// + /// List secrets for a container app + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.Web/containerApps/{name}/listSecrets + /// + /// + /// Operation Id + /// ContainerApps_ListSecrets + /// + /// + /// + /// The instance the method will execute against. + /// Name of the Container App. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + /// An async collection of that may take multiple service requests to iterate over. + public static AsyncPageable GetSecretsContainerAppsAsync(this SubscriptionResource subscriptionResource, string name, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(name, nameof(name)); + + return GetExtensionClient(subscriptionResource).GetSecretsContainerAppsAsync(name, cancellationToken); + } + + /// + /// List secrets for a container app + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.Web/containerApps/{name}/listSecrets + /// + /// + /// Operation Id + /// ContainerApps_ListSecrets + /// + /// + /// + /// The instance the method will execute against. + /// Name of the Container App. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + /// A collection of that may take multiple service requests to iterate over. + public static Pageable GetSecretsContainerApps(this SubscriptionResource subscriptionResource, string name, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(name, nameof(name)); + + return GetExtensionClient(subscriptionResource).GetSecretsContainerApps(name, cancellationToken); + } + /// /// Description for Get all deleted apps for a subscription at location /// @@ -1423,6 +1517,50 @@ public static Response CheckAppServiceNameAvailability return GetExtensionClient(subscriptionResource).CheckAppServiceNameAvailability(content, cancellationToken); } + /// + /// Get custom hostnames under this subscription + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.Web/customhostnameSites + /// + /// + /// Operation Id + /// ListCustomHostNameSites + /// + /// + /// + /// The instance the method will execute against. + /// Specific hostname. + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public static AsyncPageable GetCustomHostNameSitesAsync(this SubscriptionResource subscriptionResource, string hostname = null, CancellationToken cancellationToken = default) + { + return GetExtensionClient(subscriptionResource).GetCustomHostNameSitesAsync(hostname, cancellationToken); + } + + /// + /// Get custom hostnames under this subscription + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.Web/customhostnameSites + /// + /// + /// Operation Id + /// ListCustomHostNameSites + /// + /// + /// + /// The instance the method will execute against. + /// Specific hostname. + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public static Pageable GetCustomHostNameSites(this SubscriptionResource subscriptionResource, string hostname = null, CancellationToken cancellationToken = default) + { + return GetExtensionClient(subscriptionResource).GetCustomHostNameSites(hostname, cancellationToken); + } + /// /// Description for Gets list of available geo regions plus ministamps /// @@ -2066,6 +2204,62 @@ public static Response GetAppCertificate(this ResourceGr return resourceGroupResource.GetAppCertificates().Get(name, cancellationToken); } + /// Gets a collection of ContainerAppResources in the ResourceGroupResource. + /// The instance the method will execute against. + /// An object representing collection of ContainerAppResources and their operations over a ContainerAppResource. + public static ContainerAppCollection GetContainerApps(this ResourceGroupResource resourceGroupResource) + { + return GetExtensionClient(resourceGroupResource).GetContainerApps(); + } + + /// + /// Get the properties of a Container App. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/containerApps/{name} + /// + /// + /// Operation Id + /// ContainerApps_Get + /// + /// + /// + /// The instance the method will execute against. + /// Name of the Container App. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + [ForwardsClientCalls] + public static async Task> GetContainerAppAsync(this ResourceGroupResource resourceGroupResource, string name, CancellationToken cancellationToken = default) + { + return await resourceGroupResource.GetContainerApps().GetAsync(name, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get the properties of a Container App. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/containerApps/{name} + /// + /// + /// Operation Id + /// ContainerApps_Get + /// + /// + /// + /// The instance the method will execute against. + /// Name of the Container App. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + [ForwardsClientCalls] + public static Response GetContainerApp(this ResourceGroupResource resourceGroupResource, string name, CancellationToken cancellationToken = default) + { + return resourceGroupResource.GetContainerApps().Get(name, cancellationToken); + } + /// Gets a collection of KubeEnvironmentResources in the ResourceGroupResource. /// The instance the method will execute against. /// An object representing collection of KubeEnvironmentResources and their operations over a KubeEnvironmentResource. @@ -2472,6 +2666,25 @@ public static AppServiceEnvironmentResource GetAppServiceEnvironmentResource(thi } #endregion + #region CustomDnsSuffixConfigurationResource + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// The instance the method will execute against. + /// The resource ID of the resource to get. + /// Returns a object. + public static CustomDnsSuffixConfigurationResource GetCustomDnsSuffixConfigurationResource(this ArmClient client, ResourceIdentifier id) + { + return client.GetResourceClient(() => + { + CustomDnsSuffixConfigurationResource.ValidateResourceId(id); + return new CustomDnsSuffixConfigurationResource(client, id); + } + ); + } + #endregion + #region AseV3NetworkingConfigurationResource /// /// Gets an object representing an along with the instance operations that can be performed on it but with no data. @@ -2833,6 +3046,44 @@ public static AppCertificateResource GetAppCertificateResource(this ArmClient cl } #endregion + #region ContainerAppResource + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// The instance the method will execute against. + /// The resource ID of the resource to get. + /// Returns a object. + public static ContainerAppResource GetContainerAppResource(this ArmClient client, ResourceIdentifier id) + { + return client.GetResourceClient(() => + { + ContainerAppResource.ValidateResourceId(id); + return new ContainerAppResource(client, id); + } + ); + } + #endregion + + #region RevisionResource + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// The instance the method will execute against. + /// The resource ID of the resource to get. + /// Returns a object. + public static RevisionResource GetRevisionResource(this ArmClient client, ResourceIdentifier id) + { + return client.GetResourceClient(() => + { + RevisionResource.ValidateResourceId(id); + return new RevisionResource(client, id); + } + ); + } + #endregion + #region SiteDiagnosticResource /// /// Gets an object representing a along with the instance operations that can be performed on it but with no data. @@ -3194,6 +3445,44 @@ public static StaticSiteCustomDomainOverviewResource GetStaticSiteCustomDomainOv } #endregion + #region StaticSiteLinkedBackendResource + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// The instance the method will execute against. + /// The resource ID of the resource to get. + /// Returns a object. + public static StaticSiteLinkedBackendResource GetStaticSiteLinkedBackendResource(this ArmClient client, ResourceIdentifier id) + { + return client.GetResourceClient(() => + { + StaticSiteLinkedBackendResource.ValidateResourceId(id); + return new StaticSiteLinkedBackendResource(client, id); + } + ); + } + #endregion + + #region StaticSiteBuildLinkedBackendResource + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// The instance the method will execute against. + /// The resource ID of the resource to get. + /// Returns a object. + public static StaticSiteBuildLinkedBackendResource GetStaticSiteBuildLinkedBackendResource(this ArmClient client, ResourceIdentifier id) + { + return client.GetResourceClient(() => + { + StaticSiteBuildLinkedBackendResource.ValidateResourceId(id); + return new StaticSiteBuildLinkedBackendResource(client, id); + } + ); + } + #endregion + #region WebSiteResource /// /// Gets an object representing a along with the instance operations that can be performed on it but with no data. @@ -3346,6 +3635,44 @@ public static ScmSiteSlotBasicPublishingCredentialsPolicyResource GetScmSiteSlot } #endregion + #region AuthsettingsV2SiteConfigResource + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// The instance the method will execute against. + /// The resource ID of the resource to get. + /// Returns a object. + public static AuthsettingsV2SiteConfigResource GetAuthsettingsV2SiteConfigResource(this ArmClient client, ResourceIdentifier id) + { + return client.GetResourceClient(() => + { + AuthsettingsV2SiteConfigResource.ValidateResourceId(id); + return new AuthsettingsV2SiteConfigResource(client, id); + } + ); + } + #endregion + + #region AuthsettingsV2SiteSlotConfigResource + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// The instance the method will execute against. + /// The resource ID of the resource to get. + /// Returns a object. + public static AuthsettingsV2SiteSlotConfigResource GetAuthsettingsV2SiteSlotConfigResource(this ArmClient client, ResourceIdentifier id) + { + return client.GetResourceClient(() => + { + AuthsettingsV2SiteSlotConfigResource.ValidateResourceId(id); + return new AuthsettingsV2SiteSlotConfigResource(client, id); + } + ); + } + #endregion + #region SiteConfigAppsettingResource /// /// Gets an object representing a along with the instance operations that can be performed on it but with no data. @@ -3593,6 +3920,44 @@ public static WebSiteSlotContinuousWebJobResource GetWebSiteSlotContinuousWebJob } #endregion + #region SiteDeploymentStatuResource + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// The instance the method will execute against. + /// The resource ID of the resource to get. + /// Returns a object. + public static SiteDeploymentStatuResource GetSiteDeploymentStatuResource(this ArmClient client, ResourceIdentifier id) + { + return client.GetResourceClient(() => + { + SiteDeploymentStatuResource.ValidateResourceId(id); + return new SiteDeploymentStatuResource(client, id); + } + ); + } + #endregion + + #region SiteSlotDeploymentStatuResource + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// The instance the method will execute against. + /// The resource ID of the resource to get. + /// Returns a object. + public static SiteSlotDeploymentStatuResource GetSiteSlotDeploymentStatuResource(this ArmClient client, ResourceIdentifier id) + { + return client.GetResourceClient(() => + { + SiteSlotDeploymentStatuResource.ValidateResourceId(id); + return new SiteSlotDeploymentStatuResource(client, id); + } + ); + } + #endregion + #region SiteDeploymentResource /// /// Gets an object representing a along with the instance operations that can be performed on it but with no data. @@ -4428,5 +4793,157 @@ public static WebSiteWebJobResource GetWebSiteWebJobResource(this ArmClient clie ); } #endregion + + #region WorkflowRunResource + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// The instance the method will execute against. + /// The resource ID of the resource to get. + /// Returns a object. + public static WorkflowRunResource GetWorkflowRunResource(this ArmClient client, ResourceIdentifier id) + { + return client.GetResourceClient(() => + { + WorkflowRunResource.ValidateResourceId(id); + return new WorkflowRunResource(client, id); + } + ); + } + #endregion + + #region WorkflowRunActionResource + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// The instance the method will execute against. + /// The resource ID of the resource to get. + /// Returns a object. + public static WorkflowRunActionResource GetWorkflowRunActionResource(this ArmClient client, ResourceIdentifier id) + { + return client.GetResourceClient(() => + { + WorkflowRunActionResource.ValidateResourceId(id); + return new WorkflowRunActionResource(client, id); + } + ); + } + #endregion + + #region SiteHostruntimeWebhookApiWorkflowRunActionRepetitionResource + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// The instance the method will execute against. + /// The resource ID of the resource to get. + /// Returns a object. + public static SiteHostruntimeWebhookApiWorkflowRunActionRepetitionResource GetSiteHostruntimeWebhookApiWorkflowRunActionRepetitionResource(this ArmClient client, ResourceIdentifier id) + { + return client.GetResourceClient(() => + { + SiteHostruntimeWebhookApiWorkflowRunActionRepetitionResource.ValidateResourceId(id); + return new SiteHostruntimeWebhookApiWorkflowRunActionRepetitionResource(client, id); + } + ); + } + #endregion + + #region SiteHostruntimeWebhookApiWorkflowRunActionScopeRepetitionResource + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// The instance the method will execute against. + /// The resource ID of the resource to get. + /// Returns a object. + public static SiteHostruntimeWebhookApiWorkflowRunActionScopeRepetitionResource GetSiteHostruntimeWebhookApiWorkflowRunActionScopeRepetitionResource(this ArmClient client, ResourceIdentifier id) + { + return client.GetResourceClient(() => + { + SiteHostruntimeWebhookApiWorkflowRunActionScopeRepetitionResource.ValidateResourceId(id); + return new SiteHostruntimeWebhookApiWorkflowRunActionScopeRepetitionResource(client, id); + } + ); + } + #endregion + + #region RequestHistoryResource + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// The instance the method will execute against. + /// The resource ID of the resource to get. + /// Returns a object. + public static RequestHistoryResource GetRequestHistoryResource(this ArmClient client, ResourceIdentifier id) + { + return client.GetResourceClient(() => + { + RequestHistoryResource.ValidateResourceId(id); + return new RequestHistoryResource(client, id); + } + ); + } + #endregion + + #region WorkflowTriggerResource + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// The instance the method will execute against. + /// The resource ID of the resource to get. + /// Returns a object. + public static WorkflowTriggerResource GetWorkflowTriggerResource(this ArmClient client, ResourceIdentifier id) + { + return client.GetResourceClient(() => + { + WorkflowTriggerResource.ValidateResourceId(id); + return new WorkflowTriggerResource(client, id); + } + ); + } + #endregion + + #region WorkflowTriggerHistoryResource + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// The instance the method will execute against. + /// The resource ID of the resource to get. + /// Returns a object. + public static WorkflowTriggerHistoryResource GetWorkflowTriggerHistoryResource(this ArmClient client, ResourceIdentifier id) + { + return client.GetResourceClient(() => + { + WorkflowTriggerHistoryResource.ValidateResourceId(id); + return new WorkflowTriggerHistoryResource(client, id); + } + ); + } + #endregion + + #region WorkflowVersionResource + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// The instance the method will execute against. + /// The resource ID of the resource to get. + /// Returns a object. + public static WorkflowVersionResource GetWorkflowVersionResource(this ArmClient client, ResourceIdentifier id) + { + return client.GetResourceClient(() => + { + WorkflowVersionResource.ValidateResourceId(id); + return new WorkflowVersionResource(client, id); + } + ); + } + #endregion } } diff --git a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs index bcc1653c0b87..219597462599 100644 --- a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs +++ b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs @@ -82,6 +82,13 @@ public virtual AppCertificateCollection GetAppCertificates() return GetCachedClient(Client => new AppCertificateCollection(Client, Id)); } + /// Gets a collection of ContainerAppResources in the ResourceGroupResource. + /// An object representing collection of ContainerAppResources and their operations over a ContainerAppResource. + public virtual ContainerAppCollection GetContainerApps() + { + return GetCachedClient(Client => new ContainerAppCollection(Client, Id)); + } + /// Gets a collection of KubeEnvironmentResources in the ResourceGroupResource. /// An object representing collection of KubeEnvironmentResources and their operations over a KubeEnvironmentResource. public virtual KubeEnvironmentCollection GetKubeEnvironments() diff --git a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs index 30cfa8227f3f..8b2349784dc5 100644 --- a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs +++ b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs @@ -33,6 +33,8 @@ internal partial class SubscriptionResourceExtensionClient : ArmResource private AppServicePlansRestOperations _appServicePlanRestClient; private ClientDiagnostics _appCertificateCertificatesClientDiagnostics; private CertificatesRestOperations _appCertificateCertificatesRestClient; + private ClientDiagnostics _containerAppClientDiagnostics; + private ContainerAppsRestOperations _containerAppRestClient; private ClientDiagnostics _deletedSiteDeletedWebAppsClientDiagnostics; private DeletedWebAppsRestOperations _deletedSiteDeletedWebAppsRestClient; private ClientDiagnostics _kubeEnvironmentClientDiagnostics; @@ -78,6 +80,8 @@ internal SubscriptionResourceExtensionClient(ArmClient client, ResourceIdentifie private AppServicePlansRestOperations AppServicePlanRestClient => _appServicePlanRestClient ??= new AppServicePlansRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, GetApiVersionOrNull(AppServicePlanResource.ResourceType)); private ClientDiagnostics AppCertificateCertificatesClientDiagnostics => _appCertificateCertificatesClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.AppService", AppCertificateResource.ResourceType.Namespace, Diagnostics); private CertificatesRestOperations AppCertificateCertificatesRestClient => _appCertificateCertificatesRestClient ??= new CertificatesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, GetApiVersionOrNull(AppCertificateResource.ResourceType)); + private ClientDiagnostics ContainerAppClientDiagnostics => _containerAppClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.AppService", ContainerAppResource.ResourceType.Namespace, Diagnostics); + private ContainerAppsRestOperations ContainerAppRestClient => _containerAppRestClient ??= new ContainerAppsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, GetApiVersionOrNull(ContainerAppResource.ResourceType)); private ClientDiagnostics DeletedSiteDeletedWebAppsClientDiagnostics => _deletedSiteDeletedWebAppsClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.AppService", DeletedSiteResource.ResourceType.Namespace, Diagnostics); private DeletedWebAppsRestOperations DeletedSiteDeletedWebAppsRestClient => _deletedSiteDeletedWebAppsRestClient ??= new DeletedWebAppsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, GetApiVersionOrNull(DeletedSiteResource.ResourceType)); private ClientDiagnostics KubeEnvironmentClientDiagnostics => _kubeEnvironmentClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.AppService", KubeEnvironmentResource.ResourceType.Namespace, Diagnostics); @@ -577,6 +581,94 @@ public virtual Pageable GetAppCertificates(string filter return PageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new AppCertificateResource(Client, AppCertificateData.DeserializeAppCertificateData(e)), AppCertificateCertificatesClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetAppCertificates", "value", "nextLink", cancellationToken); } + /// + /// Get the Container Apps in a given subscription. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.Web/containerApps + /// + /// + /// Operation Id + /// ContainerApps_ListBySubscription + /// + /// + /// + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetContainerAppsAsync(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => ContainerAppRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => ContainerAppRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); + return PageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new ContainerAppResource(Client, ContainerAppData.DeserializeContainerAppData(e)), ContainerAppClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetContainerApps", "value", "nextLink", cancellationToken); + } + + /// + /// Get the Container Apps in a given subscription. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.Web/containerApps + /// + /// + /// Operation Id + /// ContainerApps_ListBySubscription + /// + /// + /// + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetContainerApps(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => ContainerAppRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => ContainerAppRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); + return PageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new ContainerAppResource(Client, ContainerAppData.DeserializeContainerAppData(e)), ContainerAppClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetContainerApps", "value", "nextLink", cancellationToken); + } + + /// + /// List secrets for a container app + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.Web/containerApps/{name}/listSecrets + /// + /// + /// Operation Id + /// ContainerApps_ListSecrets + /// + /// + /// + /// Name of the Container App. + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetSecretsContainerAppsAsync(string name, CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => ContainerAppRestClient.CreateListSecretsRequest(Id.SubscriptionId, name); + return PageableHelpers.CreateAsyncPageable(FirstPageRequest, null, ContainerAppSecret.DeserializeContainerAppSecret, ContainerAppClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetSecretsContainerApps", "value", null, cancellationToken); + } + + /// + /// List secrets for a container app + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.Web/containerApps/{name}/listSecrets + /// + /// + /// Operation Id + /// ContainerApps_ListSecrets + /// + /// + /// + /// Name of the Container App. + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetSecretsContainerApps(string name, CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => ContainerAppRestClient.CreateListSecretsRequest(Id.SubscriptionId, name); + return PageableHelpers.CreatePageable(FirstPageRequest, null, ContainerAppSecret.DeserializeContainerAppSecret, ContainerAppClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetSecretsContainerApps", "value", null, cancellationToken); + } + /// /// Description for Get all deleted apps for a subscription at location /// @@ -1101,6 +1193,52 @@ public virtual Response CheckAppServiceNameAvailabilit } } + /// + /// Get custom hostnames under this subscription + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.Web/customhostnameSites + /// + /// + /// Operation Id + /// ListCustomHostNameSites + /// + /// + /// + /// Specific hostname. + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetCustomHostNameSitesAsync(string hostname = null, CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => DefaultRestClient.CreateListCustomHostNameSitesRequest(Id.SubscriptionId, hostname); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => DefaultRestClient.CreateListCustomHostNameSitesNextPageRequest(nextLink, Id.SubscriptionId, hostname); + return PageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, CustomHostnameSites.DeserializeCustomHostnameSites, DefaultClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetCustomHostNameSites", "value", "nextLink", cancellationToken); + } + + /// + /// Get custom hostnames under this subscription + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.Web/customhostnameSites + /// + /// + /// Operation Id + /// ListCustomHostNameSites + /// + /// + /// + /// Specific hostname. + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetCustomHostNameSites(string hostname = null, CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => DefaultRestClient.CreateListCustomHostNameSitesRequest(Id.SubscriptionId, hostname); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => DefaultRestClient.CreateListCustomHostNameSitesNextPageRequest(nextLink, Id.SubscriptionId, hostname); + return PageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, CustomHostnameSites.DeserializeCustomHostnameSites, DefaultClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetCustomHostNameSites", "value", "nextLink", cancellationToken); + } + /// /// Description for Gets list of available geo regions plus ministamps /// diff --git a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/KubeEnvironmentData.cs b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/KubeEnvironmentData.cs index 802d1e14116a..8950595a76ef 100644 --- a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/KubeEnvironmentData.cs +++ b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/KubeEnvironmentData.cs @@ -38,6 +38,7 @@ public KubeEnvironmentData(AzureLocation location) : base(location) /// Only visible within Vnet/Subnet. /// Default Domain Name for the cluster. /// Static IP of the KubeEnvironment. + /// Type of Kubernetes Environment. Only supported for Container App Environments with value as Managed. /// /// Cluster configuration which determines the ARC cluster /// components types. Eg: Choosing between BuildService kind, @@ -48,9 +49,10 @@ public KubeEnvironmentData(AzureLocation location) : base(location) /// app logs to a destination. Currently only "log-analytics" is /// supported /// + /// Cluster configuration for Container Apps Environments to configure Dapr Instrumentation Key and VNET Configuration. /// /// Kind of resource. - internal KubeEnvironmentData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, ExtendedLocation extendedLocation, KubeEnvironmentProvisioningState? provisioningState, string deploymentErrors, bool? isInternalLoadBalancerEnabled, string defaultDomain, string staticIP, ArcConfiguration arcConfiguration, AppLogsConfiguration appLogsConfiguration, ResourceIdentifier aksResourceId, string kind) : base(id, name, resourceType, systemData, tags, location) + internal KubeEnvironmentData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, ExtendedLocation extendedLocation, KubeEnvironmentProvisioningState? provisioningState, string deploymentErrors, bool? isInternalLoadBalancerEnabled, string defaultDomain, string staticIP, string environmentType, ArcConfiguration arcConfiguration, AppLogsConfiguration appLogsConfiguration, ContainerAppsConfiguration containerAppsConfiguration, ResourceIdentifier aksResourceId, string kind) : base(id, name, resourceType, systemData, tags, location) { ExtendedLocation = extendedLocation; ProvisioningState = provisioningState; @@ -58,8 +60,10 @@ internal KubeEnvironmentData(ResourceIdentifier id, string name, ResourceType re IsInternalLoadBalancerEnabled = isInternalLoadBalancerEnabled; DefaultDomain = defaultDomain; StaticIP = staticIP; + EnvironmentType = environmentType; ArcConfiguration = arcConfiguration; AppLogsConfiguration = appLogsConfiguration; + ContainerAppsConfiguration = containerAppsConfiguration; AksResourceId = aksResourceId; Kind = kind; } @@ -76,6 +80,8 @@ internal KubeEnvironmentData(ResourceIdentifier id, string name, ResourceType re public string DefaultDomain { get; } /// Static IP of the KubeEnvironment. public string StaticIP { get; set; } + /// Type of Kubernetes Environment. Only supported for Container App Environments with value as Managed. + public string EnvironmentType { get; set; } /// /// Cluster configuration which determines the ARC cluster /// components types. Eg: Choosing between BuildService kind, @@ -88,6 +94,8 @@ internal KubeEnvironmentData(ResourceIdentifier id, string name, ResourceType re /// supported /// public AppLogsConfiguration AppLogsConfiguration { get; set; } + /// Cluster configuration for Container Apps Environments to configure Dapr Instrumentation Key and VNET Configuration. + public ContainerAppsConfiguration ContainerAppsConfiguration { get; set; } /// Gets or sets the aks resource id. public ResourceIdentifier AksResourceId { get; set; } /// Kind of resource. diff --git a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/LongRunningOperation/ContainerAppOperationSource.cs b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/LongRunningOperation/ContainerAppOperationSource.cs new file mode 100644 index 000000000000..87317201f6df --- /dev/null +++ b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/LongRunningOperation/ContainerAppOperationSource.cs @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure; +using Azure.Core; +using Azure.ResourceManager; + +namespace Azure.ResourceManager.AppService +{ + internal class ContainerAppOperationSource : IOperationSource + { + private readonly ArmClient _client; + + internal ContainerAppOperationSource(ArmClient client) + { + _client = client; + } + + ContainerAppResource IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) + { + using var document = JsonDocument.Parse(response.ContentStream); + var data = ContainerAppData.DeserializeContainerAppData(document.RootElement); + return new ContainerAppResource(_client, data); + } + + async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) + { + using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false); + var data = ContainerAppData.DeserializeContainerAppData(document.RootElement); + return new ContainerAppResource(_client, data); + } + } +} diff --git a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/LongRunningOperation/SiteDeploymentStatuOperationSource.cs b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/LongRunningOperation/SiteDeploymentStatuOperationSource.cs new file mode 100644 index 000000000000..5668094a18cb --- /dev/null +++ b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/LongRunningOperation/SiteDeploymentStatuOperationSource.cs @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure; +using Azure.Core; +using Azure.ResourceManager; + +namespace Azure.ResourceManager.AppService +{ + internal class SiteDeploymentStatuOperationSource : IOperationSource + { + private readonly ArmClient _client; + + internal SiteDeploymentStatuOperationSource(ArmClient client) + { + _client = client; + } + + SiteDeploymentStatuResource IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) + { + using var document = JsonDocument.Parse(response.ContentStream); + var data = CsmDeploymentStatusData.DeserializeCsmDeploymentStatusData(document.RootElement); + return new SiteDeploymentStatuResource(_client, data); + } + + async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) + { + using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false); + var data = CsmDeploymentStatusData.DeserializeCsmDeploymentStatusData(document.RootElement); + return new SiteDeploymentStatuResource(_client, data); + } + } +} diff --git a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/LongRunningOperation/SiteSlotDeploymentStatuOperationSource.cs b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/LongRunningOperation/SiteSlotDeploymentStatuOperationSource.cs new file mode 100644 index 000000000000..71aa3b08ea4d --- /dev/null +++ b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/LongRunningOperation/SiteSlotDeploymentStatuOperationSource.cs @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure; +using Azure.Core; +using Azure.ResourceManager; + +namespace Azure.ResourceManager.AppService +{ + internal class SiteSlotDeploymentStatuOperationSource : IOperationSource + { + private readonly ArmClient _client; + + internal SiteSlotDeploymentStatuOperationSource(ArmClient client) + { + _client = client; + } + + SiteSlotDeploymentStatuResource IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) + { + using var document = JsonDocument.Parse(response.ContentStream); + var data = CsmDeploymentStatusData.DeserializeCsmDeploymentStatusData(document.RootElement); + return new SiteSlotDeploymentStatuResource(_client, data); + } + + async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) + { + using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false); + var data = CsmDeploymentStatusData.DeserializeCsmDeploymentStatusData(document.RootElement); + return new SiteSlotDeploymentStatuResource(_client, data); + } + } +} diff --git a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/LongRunningOperation/StaticSiteBuildLinkedBackendOperationSource.cs b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/LongRunningOperation/StaticSiteBuildLinkedBackendOperationSource.cs new file mode 100644 index 000000000000..7a5deaeef5be --- /dev/null +++ b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/LongRunningOperation/StaticSiteBuildLinkedBackendOperationSource.cs @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure; +using Azure.Core; +using Azure.ResourceManager; + +namespace Azure.ResourceManager.AppService +{ + internal class StaticSiteBuildLinkedBackendOperationSource : IOperationSource + { + private readonly ArmClient _client; + + internal StaticSiteBuildLinkedBackendOperationSource(ArmClient client) + { + _client = client; + } + + StaticSiteBuildLinkedBackendResource IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) + { + using var document = JsonDocument.Parse(response.ContentStream); + var data = StaticSiteLinkedBackendARMResourceData.DeserializeStaticSiteLinkedBackendARMResourceData(document.RootElement); + return new StaticSiteBuildLinkedBackendResource(_client, data); + } + + async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) + { + using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false); + var data = StaticSiteLinkedBackendARMResourceData.DeserializeStaticSiteLinkedBackendARMResourceData(document.RootElement); + return new StaticSiteBuildLinkedBackendResource(_client, data); + } + } +} diff --git a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/LongRunningOperation/StaticSiteLinkedBackendOperationSource.cs b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/LongRunningOperation/StaticSiteLinkedBackendOperationSource.cs new file mode 100644 index 000000000000..1147e5f305d8 --- /dev/null +++ b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/LongRunningOperation/StaticSiteLinkedBackendOperationSource.cs @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure; +using Azure.Core; +using Azure.ResourceManager; + +namespace Azure.ResourceManager.AppService +{ + internal class StaticSiteLinkedBackendOperationSource : IOperationSource + { + private readonly ArmClient _client; + + internal StaticSiteLinkedBackendOperationSource(ArmClient client) + { + _client = client; + } + + StaticSiteLinkedBackendResource IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) + { + using var document = JsonDocument.Parse(response.ContentStream); + var data = StaticSiteLinkedBackendARMResourceData.DeserializeStaticSiteLinkedBackendARMResourceData(document.RootElement); + return new StaticSiteLinkedBackendResource(_client, data); + } + + async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) + { + using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false); + var data = StaticSiteLinkedBackendARMResourceData.DeserializeStaticSiteLinkedBackendARMResourceData(document.RootElement); + return new StaticSiteLinkedBackendResource(_client, data); + } + } +} diff --git a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/ActiveRevisionsMode.cs b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/ActiveRevisionsMode.cs new file mode 100644 index 000000000000..45f14711d2e7 --- /dev/null +++ b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/ActiveRevisionsMode.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 Azure.ResourceManager.AppService.Models +{ + /// + /// ActiveRevisionsMode controls how active revisions are handled for the Container app: + /// <list><item>Multiple: multiple revisions can be active. If no value if provided, this is the default</item><item>Single: Only one revision can be active at a time. Revision weights can not be used in this mode</item></list> + /// + public readonly partial struct ActiveRevisionsMode : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public ActiveRevisionsMode(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string MultipleValue = "multiple"; + private const string SingleValue = "single"; + + /// multiple. + public static ActiveRevisionsMode Multiple { get; } = new ActiveRevisionsMode(MultipleValue); + /// single. + public static ActiveRevisionsMode Single { get; } = new ActiveRevisionsMode(SingleValue); + /// Determines if two values are the same. + public static bool operator ==(ActiveRevisionsMode left, ActiveRevisionsMode right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(ActiveRevisionsMode left, ActiveRevisionsMode right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator ActiveRevisionsMode(string value) => new ActiveRevisionsMode(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is ActiveRevisionsMode other && Equals(other); + /// + public bool Equals(ActiveRevisionsMode 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/Azure.ResourceManager.AppService/src/Generated/Models/AppServiceCertificateEmail.Serialization.cs b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/AppServiceCertificateEmail.Serialization.cs index e9523c6e7f1c..cda3573ec571 100644 --- a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/AppServiceCertificateEmail.Serialization.cs +++ b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/AppServiceCertificateEmail.Serialization.cs @@ -8,106 +8,34 @@ using System; using System.Text.Json; using Azure.Core; -using Azure.ResourceManager.Models; namespace Azure.ResourceManager.AppService.Models { - public partial class AppServiceCertificateEmail : IUtf8JsonSerializable + public partial class AppServiceCertificateEmail { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(Kind)) - { - writer.WritePropertyName("kind"u8); - writer.WriteStringValue(Kind); - } - writer.WritePropertyName("properties"u8); - writer.WriteStartObject(); - if (Optional.IsDefined(EmailId)) - { - writer.WritePropertyName("emailId"u8); - writer.WriteStringValue(EmailId); - } - if (Optional.IsDefined(TimeStamp)) - { - writer.WritePropertyName("timeStamp"u8); - writer.WriteStringValue(TimeStamp.Value, "O"); - } - writer.WriteEndObject(); - writer.WriteEndObject(); - } - internal static AppServiceCertificateEmail DeserializeAppServiceCertificateEmail(JsonElement element) { - Optional kind = default; - ResourceIdentifier id = default; - string name = default; - ResourceType type = default; - Optional systemData = default; Optional emailId = default; Optional timeStamp = default; foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("kind"u8)) - { - kind = property.Value.GetString(); - continue; - } - if (property.NameEquals("id"u8)) - { - id = new ResourceIdentifier(property.Value.GetString()); - continue; - } - if (property.NameEquals("name"u8)) - { - name = property.Value.GetString(); - continue; - } - if (property.NameEquals("type"u8)) - { - type = new ResourceType(property.Value.GetString()); - continue; - } - if (property.NameEquals("systemData"u8)) + if (property.NameEquals("emailId"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - systemData = JsonSerializer.Deserialize(property.Value.GetRawText()); + emailId = property.Value.GetString(); continue; } - if (property.NameEquals("properties"u8)) + if (property.NameEquals("timeStamp"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) { property.ThrowNonNullablePropertyIsNull(); continue; } - foreach (var property0 in property.Value.EnumerateObject()) - { - if (property0.NameEquals("emailId"u8)) - { - emailId = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("timeStamp"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - timeStamp = property0.Value.GetDateTimeOffset("O"); - continue; - } - } + timeStamp = property.Value.GetDateTimeOffset("O"); continue; } } - return new AppServiceCertificateEmail(id, name, type, systemData.Value, emailId.Value, Optional.ToNullable(timeStamp), kind.Value); + return new AppServiceCertificateEmail(emailId.Value, Optional.ToNullable(timeStamp)); } } } diff --git a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/AppServiceCertificateEmail.cs b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/AppServiceCertificateEmail.cs index 31e8d4a67777..f818e7065562 100644 --- a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/AppServiceCertificateEmail.cs +++ b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/AppServiceCertificateEmail.cs @@ -6,39 +6,29 @@ #nullable disable using System; -using Azure.Core; -using Azure.ResourceManager.Models; namespace Azure.ResourceManager.AppService.Models { /// SSL certificate email. - public partial class AppServiceCertificateEmail : ResourceData + public partial class AppServiceCertificateEmail { /// Initializes a new instance of AppServiceCertificateEmail. - public AppServiceCertificateEmail() + internal AppServiceCertificateEmail() { } /// Initializes a new instance of AppServiceCertificateEmail. - /// The id. - /// The name. - /// The resourceType. - /// The systemData. /// Email id. /// Time stamp. - /// Kind of resource. - internal AppServiceCertificateEmail(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, string emailId, DateTimeOffset? timeStamp, string kind) : base(id, name, resourceType, systemData) + internal AppServiceCertificateEmail(string emailId, DateTimeOffset? timeStamp) { EmailId = emailId; TimeStamp = timeStamp; - Kind = kind; } /// Email id. - public string EmailId { get; set; } + public string EmailId { get; } /// Time stamp. - public DateTimeOffset? TimeStamp { get; set; } - /// Kind of resource. - public string Kind { get; set; } + public DateTimeOffset? TimeStamp { get; } } } diff --git a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/AppServiceEndpointDetail.Serialization.cs b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/AppServiceEndpointDetail.Serialization.cs index a2316111833f..3a4924d66830 100644 --- a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/AppServiceEndpointDetail.Serialization.cs +++ b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/AppServiceEndpointDetail.Serialization.cs @@ -15,7 +15,7 @@ public partial class AppServiceEndpointDetail { internal static AppServiceEndpointDetail DeserializeAppServiceEndpointDetail(JsonElement element) { - Optional ipAddress = default; + Optional ipAddress = default; Optional port = default; Optional latency = default; Optional isAccessible = default; @@ -28,7 +28,7 @@ internal static AppServiceEndpointDetail DeserializeAppServiceEndpointDetail(Jso property.ThrowNonNullablePropertyIsNull(); continue; } - ipAddress = IPAddress.Parse(property.Value.GetString()); + ipAddress = System.Net.IPAddress.Parse(property.Value.GetString()); continue; } if (property.NameEquals("port"u8)) diff --git a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/AppServiceEndpointDetail.cs b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/AppServiceEndpointDetail.cs index a9e49d1e20d6..7eb74656aefd 100644 --- a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/AppServiceEndpointDetail.cs +++ b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/AppServiceEndpointDetail.cs @@ -22,7 +22,7 @@ internal AppServiceEndpointDetail() /// 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 AppServiceEndpointDetail(IPAddress ipAddress, int? port, double? latency, bool? isAccessible) + internal AppServiceEndpointDetail(System.Net.IPAddress ipAddress, int? port, double? latency, bool? isAccessible) { IPAddress = ipAddress; Port = port; @@ -31,7 +31,7 @@ internal AppServiceEndpointDetail(IPAddress ipAddress, int? port, double? latenc } /// An IP Address that Domain Name currently resolves to. - public IPAddress IPAddress { get; } + public System.Net.IPAddress 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. diff --git a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/AppServiceEnvironmentAddressResult.Serialization.cs b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/AppServiceEnvironmentAddressResult.Serialization.cs index 71ab3223cc37..8ae47286fa60 100644 --- a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/AppServiceEnvironmentAddressResult.Serialization.cs +++ b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/AppServiceEnvironmentAddressResult.Serialization.cs @@ -66,9 +66,9 @@ internal static AppServiceEnvironmentAddressResult DeserializeAppServiceEnvironm string name = default; ResourceType type = default; Optional systemData = default; - Optional serviceIPAddress = default; - Optional internalIPAddress = default; - Optional> outboundIPAddresses = default; + Optional serviceIPAddress = default; + Optional internalIPAddress = default; + Optional> outboundIPAddresses = default; Optional> vipMappings = default; foreach (var property in element.EnumerateObject()) { @@ -118,7 +118,7 @@ internal static AppServiceEnvironmentAddressResult DeserializeAppServiceEnvironm property0.ThrowNonNullablePropertyIsNull(); continue; } - serviceIPAddress = IPAddress.Parse(property0.Value.GetString()); + serviceIPAddress = System.Net.IPAddress.Parse(property0.Value.GetString()); continue; } if (property0.NameEquals("internalIpAddress"u8)) @@ -128,7 +128,7 @@ internal static AppServiceEnvironmentAddressResult DeserializeAppServiceEnvironm property0.ThrowNonNullablePropertyIsNull(); continue; } - internalIPAddress = IPAddress.Parse(property0.Value.GetString()); + internalIPAddress = System.Net.IPAddress.Parse(property0.Value.GetString()); continue; } if (property0.NameEquals("outboundIpAddresses"u8)) @@ -138,10 +138,10 @@ internal static AppServiceEnvironmentAddressResult DeserializeAppServiceEnvironm property0.ThrowNonNullablePropertyIsNull(); continue; } - List array = new List(); + List array = new List(); foreach (var item in property0.Value.EnumerateArray()) { - array.Add(IPAddress.Parse(item.GetString())); + array.Add(System.Net.IPAddress.Parse(item.GetString())); } outboundIPAddresses = array; continue; diff --git a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/AppServiceEnvironmentAddressResult.cs b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/AppServiceEnvironmentAddressResult.cs index 32d569351f22..6494af12a9ee 100644 --- a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/AppServiceEnvironmentAddressResult.cs +++ b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/AppServiceEnvironmentAddressResult.cs @@ -18,7 +18,7 @@ public partial class AppServiceEnvironmentAddressResult : ResourceData /// Initializes a new instance of AppServiceEnvironmentAddressResult. public AppServiceEnvironmentAddressResult() { - OutboundIPAddresses = new ChangeTrackingList(); + OutboundIPAddresses = new ChangeTrackingList(); VirtualIPMappings = new ChangeTrackingList(); } @@ -32,7 +32,7 @@ public AppServiceEnvironmentAddressResult() /// IP addresses appearing on outbound connections. /// Additional virtual IPs. /// Kind of resource. - internal AppServiceEnvironmentAddressResult(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IPAddress serviceIPAddress, IPAddress internalIPAddress, IList outboundIPAddresses, IList virtualIPMappings, string kind) : base(id, name, resourceType, systemData) + internal AppServiceEnvironmentAddressResult(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, System.Net.IPAddress serviceIPAddress, System.Net.IPAddress internalIPAddress, IList outboundIPAddresses, IList virtualIPMappings, string kind) : base(id, name, resourceType, systemData) { ServiceIPAddress = serviceIPAddress; InternalIPAddress = internalIPAddress; @@ -42,11 +42,11 @@ internal AppServiceEnvironmentAddressResult(ResourceIdentifier id, string name, } /// Main public virtual IP. - public IPAddress ServiceIPAddress { get; set; } + public System.Net.IPAddress ServiceIPAddress { get; set; } /// Virtual Network internal IP address of the App Service Environment if it is in internal load-balancing mode. - public IPAddress InternalIPAddress { get; set; } + public System.Net.IPAddress InternalIPAddress { get; set; } /// IP addresses appearing on outbound connections. - public IList OutboundIPAddresses { get; } + public IList OutboundIPAddresses { get; } /// Additional virtual IPs. public IList VirtualIPMappings { get; } /// Kind of resource. diff --git a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/AppServiceEnvironmentData.Serialization.cs b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/AppServiceEnvironmentData.Serialization.cs index 83572603f63c..99f6bb99c5e9 100644 --- a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/AppServiceEnvironmentData.Serialization.cs +++ b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/AppServiceEnvironmentData.Serialization.cs @@ -88,6 +88,11 @@ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) } writer.WriteEndArray(); } + if (Optional.IsDefined(UpgradePreference)) + { + writer.WritePropertyName("upgradePreference"u8); + writer.WriteStringValue(UpgradePreference.Value.ToString()); + } if (Optional.IsDefined(DedicatedHostCount)) { writer.WritePropertyName("dedicatedHostCount"u8); @@ -98,6 +103,16 @@ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) writer.WritePropertyName("zoneRedundant"u8); writer.WriteBooleanValue(IsZoneRedundant.Value); } + if (Optional.IsDefined(CustomDnsSuffixConfiguration)) + { + writer.WritePropertyName("customDnsSuffixConfiguration"u8); + writer.WriteObjectValue(CustomDnsSuffixConfiguration); + } + if (Optional.IsDefined(NetworkingConfiguration)) + { + writer.WritePropertyName("networkingConfiguration"u8); + writer.WriteObjectValue(NetworkingConfiguration); + } writer.WriteEndObject(); writer.WriteEndObject(); } @@ -125,8 +140,12 @@ internal static AppServiceEnvironmentData DeserializeAppServiceEnvironmentData(J Optional> clusterSettings = default; Optional> userWhitelistedIPRanges = default; Optional hasLinuxWorkers = default; + Optional upgradePreference = default; Optional dedicatedHostCount = default; Optional zoneRedundant = default; + Optional customDnsSuffixConfiguration = default; + Optional networkingConfiguration = default; + Optional upgradeAvailability = default; foreach (var property in element.EnumerateObject()) { if (property.NameEquals("kind"u8)) @@ -328,6 +347,16 @@ internal static AppServiceEnvironmentData DeserializeAppServiceEnvironmentData(J hasLinuxWorkers = property0.Value.GetBoolean(); continue; } + if (property0.NameEquals("upgradePreference"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + upgradePreference = new UpgradePreference(property0.Value.GetString()); + continue; + } if (property0.NameEquals("dedicatedHostCount"u8)) { if (property0.Value.ValueKind == JsonValueKind.Null) @@ -348,11 +377,41 @@ internal static AppServiceEnvironmentData DeserializeAppServiceEnvironmentData(J zoneRedundant = property0.Value.GetBoolean(); continue; } + if (property0.NameEquals("customDnsSuffixConfiguration"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + customDnsSuffixConfiguration = CustomDnsSuffixConfigurationData.DeserializeCustomDnsSuffixConfigurationData(property0.Value); + continue; + } + if (property0.NameEquals("networkingConfiguration"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + networkingConfiguration = AseV3NetworkingConfigurationData.DeserializeAseV3NetworkingConfigurationData(property0.Value); + continue; + } + if (property0.NameEquals("upgradeAvailability"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + upgradeAvailability = new UpgradeAvailability(property0.Value.GetString()); + continue; + } } continue; } } - return new AppServiceEnvironmentData(id, name, type, systemData.Value, Optional.ToDictionary(tags), location, 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), Optional.ToNullable(zoneRedundant), kind.Value); + return new AppServiceEnvironmentData(id, name, type, systemData.Value, Optional.ToDictionary(tags), location, 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(upgradePreference), Optional.ToNullable(dedicatedHostCount), Optional.ToNullable(zoneRedundant), customDnsSuffixConfiguration.Value, networkingConfiguration.Value, Optional.ToNullable(upgradeAvailability), kind.Value); } } } diff --git a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/AppServiceEnvironmentPatch.Serialization.cs b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/AppServiceEnvironmentPatch.Serialization.cs index 27023736c65e..8daacbc92518 100644 --- a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/AppServiceEnvironmentPatch.Serialization.cs +++ b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/AppServiceEnvironmentPatch.Serialization.cs @@ -8,6 +8,7 @@ using System.Collections.Generic; using System.Text.Json; using Azure.Core; +using Azure.ResourceManager.AppService; using Azure.ResourceManager.Models; namespace Azure.ResourceManager.AppService.Models @@ -74,6 +75,11 @@ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) } writer.WriteEndArray(); } + if (Optional.IsDefined(UpgradePreference)) + { + writer.WritePropertyName("upgradePreference"u8); + writer.WriteStringValue(UpgradePreference.Value.ToString()); + } if (Optional.IsDefined(DedicatedHostCount)) { writer.WritePropertyName("dedicatedHostCount"u8); @@ -84,6 +90,16 @@ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) writer.WritePropertyName("zoneRedundant"u8); writer.WriteBooleanValue(IsZoneRedundant.Value); } + if (Optional.IsDefined(CustomDnsSuffixConfiguration)) + { + writer.WritePropertyName("customDnsSuffixConfiguration"u8); + writer.WriteObjectValue(CustomDnsSuffixConfiguration); + } + if (Optional.IsDefined(NetworkingConfiguration)) + { + writer.WritePropertyName("networkingConfiguration"u8); + writer.WriteObjectValue(NetworkingConfiguration); + } writer.WriteEndObject(); writer.WriteEndObject(); } @@ -109,8 +125,12 @@ internal static AppServiceEnvironmentPatch DeserializeAppServiceEnvironmentPatch Optional> clusterSettings = default; Optional> userWhitelistedIPRanges = default; Optional hasLinuxWorkers = default; + Optional upgradePreference = default; Optional dedicatedHostCount = default; Optional zoneRedundant = default; + Optional customDnsSuffixConfiguration = default; + Optional networkingConfiguration = default; + Optional upgradeAvailability = default; foreach (var property in element.EnumerateObject()) { if (property.NameEquals("kind"u8)) @@ -292,6 +312,16 @@ internal static AppServiceEnvironmentPatch DeserializeAppServiceEnvironmentPatch hasLinuxWorkers = property0.Value.GetBoolean(); continue; } + if (property0.NameEquals("upgradePreference"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + upgradePreference = new UpgradePreference(property0.Value.GetString()); + continue; + } if (property0.NameEquals("dedicatedHostCount"u8)) { if (property0.Value.ValueKind == JsonValueKind.Null) @@ -312,11 +342,41 @@ internal static AppServiceEnvironmentPatch DeserializeAppServiceEnvironmentPatch zoneRedundant = property0.Value.GetBoolean(); continue; } + if (property0.NameEquals("customDnsSuffixConfiguration"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + customDnsSuffixConfiguration = CustomDnsSuffixConfigurationData.DeserializeCustomDnsSuffixConfigurationData(property0.Value); + continue; + } + if (property0.NameEquals("networkingConfiguration"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + networkingConfiguration = AseV3NetworkingConfigurationData.DeserializeAseV3NetworkingConfigurationData(property0.Value); + continue; + } + if (property0.NameEquals("upgradeAvailability"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + upgradeAvailability = new UpgradeAvailability(property0.Value.GetString()); + continue; + } } continue; } } - return new AppServiceEnvironmentPatch(id, name, type, systemData.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), Optional.ToNullable(zoneRedundant), kind.Value); + return new AppServiceEnvironmentPatch(id, name, type, systemData.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(upgradePreference), Optional.ToNullable(dedicatedHostCount), Optional.ToNullable(zoneRedundant), customDnsSuffixConfiguration.Value, networkingConfiguration.Value, Optional.ToNullable(upgradeAvailability), kind.Value); } } } diff --git a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/AppServiceEnvironmentPatch.cs b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/AppServiceEnvironmentPatch.cs index a6de2c84dde1..05c9284129fd 100644 --- a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/AppServiceEnvironmentPatch.cs +++ b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/AppServiceEnvironmentPatch.cs @@ -7,6 +7,7 @@ using System.Collections.Generic; using Azure.Core; +using Azure.ResourceManager.AppService; using Azure.ResourceManager.Models; namespace Azure.ResourceManager.AppService.Models @@ -41,12 +42,16 @@ public AppServiceEnvironmentPatch() /// (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. + /// User added list of IP Ranges allowed on ASE db. /// Flag that displays whether an ASE has linux workers or not. + /// Upgrade Preference. /// Dedicated Host Count. /// Whether or not this App Service Environment is zone-redundant. + /// Full view of the custom domain suffix configuration for ASEv3. + /// Full view of networking configuration for an ASE. + /// Whether an upgrade is available for this App Service Environment. /// Kind of resource. - internal AppServiceEnvironmentPatch(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, ProvisioningState? provisioningState, HostingEnvironmentStatus? status, AppServiceVirtualNetworkProfile virtualNetwork, LoadBalancingMode? internalLoadBalancingMode, string multiSize, int? multiRoleCount, int? ipSslAddressCount, string dnsSuffix, int? maximumNumberOfMachines, int? frontEndScaleFactor, bool? isSuspended, IList clusterSettings, IList userWhitelistedIPRanges, bool? hasLinuxWorkers, int? dedicatedHostCount, bool? isZoneRedundant, string kind) : base(id, name, resourceType, systemData) + internal AppServiceEnvironmentPatch(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, ProvisioningState? provisioningState, HostingEnvironmentStatus? status, AppServiceVirtualNetworkProfile virtualNetwork, LoadBalancingMode? internalLoadBalancingMode, string multiSize, int? multiRoleCount, int? ipSslAddressCount, string dnsSuffix, int? maximumNumberOfMachines, int? frontEndScaleFactor, bool? isSuspended, IList clusterSettings, IList userWhitelistedIPRanges, bool? hasLinuxWorkers, UpgradePreference? upgradePreference, int? dedicatedHostCount, bool? isZoneRedundant, CustomDnsSuffixConfigurationData customDnsSuffixConfiguration, AseV3NetworkingConfigurationData networkingConfiguration, UpgradeAvailability? upgradeAvailability, string kind) : base(id, name, resourceType, systemData) { ProvisioningState = provisioningState; Status = status; @@ -62,8 +67,12 @@ internal AppServiceEnvironmentPatch(ResourceIdentifier id, string name, Resource ClusterSettings = clusterSettings; UserWhitelistedIPRanges = userWhitelistedIPRanges; HasLinuxWorkers = hasLinuxWorkers; + UpgradePreference = upgradePreference; DedicatedHostCount = dedicatedHostCount; IsZoneRedundant = isZoneRedundant; + CustomDnsSuffixConfiguration = customDnsSuffixConfiguration; + NetworkingConfiguration = networkingConfiguration; + UpgradeAvailability = upgradeAvailability; Kind = kind; } @@ -94,14 +103,22 @@ internal AppServiceEnvironmentPatch(ResourceIdentifier id, string name, Resource public bool? IsSuspended { 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. + /// User added list of IP Ranges allowed on ASE db. public IList UserWhitelistedIPRanges { get; } /// Flag that displays whether an ASE has linux workers or not. public bool? HasLinuxWorkers { get; } + /// Upgrade Preference. + public UpgradePreference? UpgradePreference { get; set; } /// Dedicated Host Count. public int? DedicatedHostCount { get; set; } /// Whether or not this App Service Environment is zone-redundant. public bool? IsZoneRedundant { get; set; } + /// Full view of the custom domain suffix configuration for ASEv3. + public CustomDnsSuffixConfigurationData CustomDnsSuffixConfiguration { get; set; } + /// Full view of networking configuration for an ASE. + public AseV3NetworkingConfigurationData NetworkingConfiguration { get; set; } + /// Whether an upgrade is available for this App Service Environment. + public UpgradeAvailability? UpgradeAvailability { get; } /// Kind of resource. public string Kind { get; set; } } diff --git a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/AppServiceEnvironmentProperties.Serialization.cs b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/AppServiceEnvironmentProperties.Serialization.cs index fbbf96069968..ca5539af6022 100644 --- a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/AppServiceEnvironmentProperties.Serialization.cs +++ b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/AppServiceEnvironmentProperties.Serialization.cs @@ -8,6 +8,7 @@ using System.Collections.Generic; using System.Text.Json; using Azure.Core; +using Azure.ResourceManager.AppService; namespace Azure.ResourceManager.AppService.Models { @@ -63,6 +64,11 @@ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) } writer.WriteEndArray(); } + if (Optional.IsDefined(UpgradePreference)) + { + writer.WritePropertyName("upgradePreference"u8); + writer.WriteStringValue(UpgradePreference.Value.ToString()); + } if (Optional.IsDefined(DedicatedHostCount)) { writer.WritePropertyName("dedicatedHostCount"u8); @@ -73,6 +79,16 @@ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) writer.WritePropertyName("zoneRedundant"u8); writer.WriteBooleanValue(IsZoneRedundant.Value); } + if (Optional.IsDefined(CustomDnsSuffixConfiguration)) + { + writer.WritePropertyName("customDnsSuffixConfiguration"u8); + writer.WriteObjectValue(CustomDnsSuffixConfiguration); + } + if (Optional.IsDefined(NetworkingConfiguration)) + { + writer.WritePropertyName("networkingConfiguration"u8); + writer.WriteObjectValue(NetworkingConfiguration); + } writer.WriteEndObject(); } @@ -92,8 +108,12 @@ internal static AppServiceEnvironmentProperties DeserializeAppServiceEnvironment Optional> clusterSettings = default; Optional> userWhitelistedIPRanges = default; Optional hasLinuxWorkers = default; + Optional upgradePreference = default; Optional dedicatedHostCount = default; Optional zoneRedundant = default; + Optional customDnsSuffixConfiguration = default; + Optional networkingConfiguration = default; + Optional upgradeAvailability = default; foreach (var property in element.EnumerateObject()) { if (property.NameEquals("provisioningState"u8)) @@ -231,6 +251,16 @@ internal static AppServiceEnvironmentProperties DeserializeAppServiceEnvironment hasLinuxWorkers = property.Value.GetBoolean(); continue; } + if (property.NameEquals("upgradePreference"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + upgradePreference = new UpgradePreference(property.Value.GetString()); + continue; + } if (property.NameEquals("dedicatedHostCount"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -251,8 +281,38 @@ internal static AppServiceEnvironmentProperties DeserializeAppServiceEnvironment zoneRedundant = property.Value.GetBoolean(); continue; } + if (property.NameEquals("customDnsSuffixConfiguration"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + customDnsSuffixConfiguration = CustomDnsSuffixConfigurationData.DeserializeCustomDnsSuffixConfigurationData(property.Value); + continue; + } + if (property.NameEquals("networkingConfiguration"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + networkingConfiguration = AseV3NetworkingConfigurationData.DeserializeAseV3NetworkingConfigurationData(property.Value); + continue; + } + if (property.NameEquals("upgradeAvailability"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + upgradeAvailability = new UpgradeAvailability(property.Value.GetString()); + continue; + } } - return new AppServiceEnvironmentProperties(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), Optional.ToNullable(zoneRedundant)); + return new AppServiceEnvironmentProperties(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(upgradePreference), Optional.ToNullable(dedicatedHostCount), Optional.ToNullable(zoneRedundant), customDnsSuffixConfiguration.Value, networkingConfiguration.Value, Optional.ToNullable(upgradeAvailability)); } } } diff --git a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/AppServiceEnvironmentProperties.cs b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/AppServiceEnvironmentProperties.cs index c1488e601ef4..7f3676b33d59 100644 --- a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/AppServiceEnvironmentProperties.cs +++ b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/AppServiceEnvironmentProperties.cs @@ -8,6 +8,7 @@ using System; using System.Collections.Generic; using Azure.Core; +using Azure.ResourceManager.AppService; namespace Azure.ResourceManager.AppService.Models { @@ -42,11 +43,15 @@ public AppServiceEnvironmentProperties(AppServiceVirtualNetworkProfile virtualNe /// (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. + /// User added list of IP Ranges allowed on ASE db. /// Flag that displays whether an ASE has linux workers or not. + /// Upgrade Preference. /// Dedicated Host Count. /// Whether or not this App Service Environment is zone-redundant. - internal AppServiceEnvironmentProperties(ProvisioningState? provisioningState, HostingEnvironmentStatus? status, AppServiceVirtualNetworkProfile virtualNetwork, LoadBalancingMode? internalLoadBalancingMode, string multiSize, int? multiRoleCount, int? ipSslAddressCount, string dnsSuffix, int? maximumNumberOfMachines, int? frontEndScaleFactor, bool? isSuspended, IList clusterSettings, IList userWhitelistedIPRanges, bool? hasLinuxWorkers, int? dedicatedHostCount, bool? isZoneRedundant) + /// Full view of the custom domain suffix configuration for ASEv3. + /// Full view of networking configuration for an ASE. + /// Whether an upgrade is available for this App Service Environment. + internal AppServiceEnvironmentProperties(ProvisioningState? provisioningState, HostingEnvironmentStatus? status, AppServiceVirtualNetworkProfile virtualNetwork, LoadBalancingMode? internalLoadBalancingMode, string multiSize, int? multiRoleCount, int? ipSslAddressCount, string dnsSuffix, int? maximumNumberOfMachines, int? frontEndScaleFactor, bool? isSuspended, IList clusterSettings, IList userWhitelistedIPRanges, bool? hasLinuxWorkers, UpgradePreference? upgradePreference, int? dedicatedHostCount, bool? isZoneRedundant, CustomDnsSuffixConfigurationData customDnsSuffixConfiguration, AseV3NetworkingConfigurationData networkingConfiguration, UpgradeAvailability? upgradeAvailability) { ProvisioningState = provisioningState; Status = status; @@ -62,8 +67,12 @@ internal AppServiceEnvironmentProperties(ProvisioningState? provisioningState, H ClusterSettings = clusterSettings; UserWhitelistedIPRanges = userWhitelistedIPRanges; HasLinuxWorkers = hasLinuxWorkers; + UpgradePreference = upgradePreference; DedicatedHostCount = dedicatedHostCount; IsZoneRedundant = isZoneRedundant; + CustomDnsSuffixConfiguration = customDnsSuffixConfiguration; + NetworkingConfiguration = networkingConfiguration; + UpgradeAvailability = upgradeAvailability; } /// Provisioning state of the App Service Environment. @@ -93,13 +102,21 @@ internal AppServiceEnvironmentProperties(ProvisioningState? provisioningState, H public bool? IsSuspended { 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. + /// User added list of IP Ranges allowed on ASE db. public IList UserWhitelistedIPRanges { get; } /// Flag that displays whether an ASE has linux workers or not. public bool? HasLinuxWorkers { get; } + /// Upgrade Preference. + public UpgradePreference? UpgradePreference { get; set; } /// Dedicated Host Count. public int? DedicatedHostCount { get; set; } /// Whether or not this App Service Environment is zone-redundant. public bool? IsZoneRedundant { get; set; } + /// Full view of the custom domain suffix configuration for ASEv3. + public CustomDnsSuffixConfigurationData CustomDnsSuffixConfiguration { get; set; } + /// Full view of networking configuration for an ASE. + public AseV3NetworkingConfigurationData NetworkingConfiguration { get; set; } + /// Whether an upgrade is available for this App Service Environment. + public UpgradeAvailability? UpgradeAvailability { get; } } } diff --git a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/AppServiceKind.cs b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/AppServiceKind.cs new file mode 100644 index 000000000000..7e3041c75c5f --- /dev/null +++ b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/AppServiceKind.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.AppService.Models +{ + /// The workflow kind. + public readonly partial struct AppServiceKind : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public AppServiceKind(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string StatefulValue = "Stateful"; + private const string StatelessValue = "Stateless"; + + /// Stateful. + public static AppServiceKind Stateful { get; } = new AppServiceKind(StatefulValue); + /// Stateless. + public static AppServiceKind Stateless { get; } = new AppServiceKind(StatelessValue); + /// Determines if two values are the same. + public static bool operator ==(AppServiceKind left, AppServiceKind right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(AppServiceKind left, AppServiceKind right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator AppServiceKind(string value) => new AppServiceKind(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is AppServiceKind other && Equals(other); + /// + public bool Equals(AppServiceKind 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/Azure.ResourceManager.AppService/src/Generated/Models/AppServiceOperation.Serialization.cs b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/AppServiceOperation.Serialization.cs index 5e2cb4903349..e165837073d6 100644 --- a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/AppServiceOperation.Serialization.cs +++ b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/AppServiceOperation.Serialization.cs @@ -8,7 +8,6 @@ using System; using System.Collections.Generic; using System.Text.Json; -using Azure; using Azure.Core; namespace Azure.ResourceManager.AppService.Models @@ -20,7 +19,7 @@ internal static AppServiceOperation DeserializeAppServiceOperation(JsonElement e Optional id = default; Optional name = default; Optional status = default; - Optional> errors = default; + Optional> errors = default; Optional createdTime = default; Optional modifiedTime = default; Optional expirationTime = default; @@ -54,10 +53,10 @@ internal static AppServiceOperation DeserializeAppServiceOperation(JsonElement e property.ThrowNonNullablePropertyIsNull(); continue; } - List array = new List(); + List array = new List(); foreach (var item in property.Value.EnumerateArray()) { - array.Add(JsonSerializer.Deserialize(item.GetRawText())); + array.Add(ErrorEntity.DeserializeErrorEntity(item)); } errors = array; continue; diff --git a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/AppServiceOperation.cs b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/AppServiceOperation.cs index 953a406bd7c0..b1e84db0ef3e 100644 --- a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/AppServiceOperation.cs +++ b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/AppServiceOperation.cs @@ -7,7 +7,6 @@ using System; using System.Collections.Generic; -using Azure; using Azure.Core; namespace Azure.ResourceManager.AppService.Models @@ -18,7 +17,7 @@ public partial class AppServiceOperation /// Initializes a new instance of AppServiceOperation. internal AppServiceOperation() { - Errors = new ChangeTrackingList(); + Errors = new ChangeTrackingList(); } /// Initializes a new instance of AppServiceOperation. @@ -30,7 +29,7 @@ internal AppServiceOperation() /// Time when operation has been updated. /// Time when operation will expire. /// Applicable only for stamp operation ids. - internal AppServiceOperation(string id, string name, AppServiceOperationStatus? status, IReadOnlyList errors, DateTimeOffset? createdOn, DateTimeOffset? modifiedOn, DateTimeOffset? expireOn, Guid? geoMasterOperationId) + internal AppServiceOperation(string id, string name, AppServiceOperationStatus? status, IReadOnlyList errors, DateTimeOffset? createdOn, DateTimeOffset? modifiedOn, DateTimeOffset? expireOn, Guid? geoMasterOperationId) { Id = id; Name = name; @@ -49,7 +48,7 @@ internal AppServiceOperation(string id, string name, AppServiceOperationStatus? /// The current status of the operation. public AppServiceOperationStatus? Status { get; } /// Any errors associate with the operation. - public IReadOnlyList Errors { get; } + public IReadOnlyList Errors { get; } /// Time when operation has started. public DateTimeOffset? CreatedOn { get; } /// Time when operation has been updated. diff --git a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/AppServicePlanData.Serialization.cs b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/AppServicePlanData.Serialization.cs index 55b118afc607..e7f7e8436df7 100644 --- a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/AppServicePlanData.Serialization.cs +++ b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/AppServicePlanData.Serialization.cs @@ -173,6 +173,7 @@ internal static AppServicePlanData DeserializeAppServicePlanData(JsonElement ele Optional subscription = default; Optional hostingEnvironmentProfile = default; Optional maximumNumberOfWorkers = default; + Optional numberOfWorkers = default; Optional geoRegion = default; Optional perSiteScaling = default; Optional elasticScaleEnabled = default; @@ -311,6 +312,16 @@ internal static AppServicePlanData DeserializeAppServicePlanData(JsonElement ele maximumNumberOfWorkers = property0.Value.GetInt32(); continue; } + if (property0.NameEquals("numberOfWorkers"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + numberOfWorkers = property0.Value.GetInt32(); + continue; + } if (property0.NameEquals("geoRegion"u8)) { geoRegion = property0.Value.GetString(); @@ -475,7 +486,7 @@ internal static AppServicePlanData DeserializeAppServicePlanData(JsonElement ele continue; } } - return new AppServicePlanData(id, name, type, systemData.Value, Optional.ToDictionary(tags), location, sku.Value, extendedLocation, workerTierName.Value, Optional.ToNullable(status), subscription.Value, hostingEnvironmentProfile.Value, Optional.ToNullable(maximumNumberOfWorkers), geoRegion.Value, Optional.ToNullable(perSiteScaling), Optional.ToNullable(elasticScaleEnabled), 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, Optional.ToNullable(zoneRedundant), kind.Value); + return new AppServicePlanData(id, name, type, systemData.Value, Optional.ToDictionary(tags), location, sku.Value, extendedLocation, workerTierName.Value, Optional.ToNullable(status), subscription.Value, hostingEnvironmentProfile.Value, Optional.ToNullable(maximumNumberOfWorkers), Optional.ToNullable(numberOfWorkers), geoRegion.Value, Optional.ToNullable(perSiteScaling), Optional.ToNullable(elasticScaleEnabled), 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, Optional.ToNullable(zoneRedundant), kind.Value); } } } diff --git a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/AppServicePlanPatch.Serialization.cs b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/AppServicePlanPatch.Serialization.cs index 2530c1992c00..0b7f693fbe8b 100644 --- a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/AppServicePlanPatch.Serialization.cs +++ b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/AppServicePlanPatch.Serialization.cs @@ -115,6 +115,7 @@ internal static AppServicePlanPatch DeserializeAppServicePlanPatch(JsonElement e Optional subscription = default; Optional hostingEnvironmentProfile = default; Optional maximumNumberOfWorkers = default; + Optional numberOfWorkers = default; Optional geoRegion = default; Optional perSiteScaling = default; Optional elasticScaleEnabled = default; @@ -213,6 +214,16 @@ internal static AppServicePlanPatch DeserializeAppServicePlanPatch(JsonElement e maximumNumberOfWorkers = property0.Value.GetInt32(); continue; } + if (property0.NameEquals("numberOfWorkers"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + numberOfWorkers = property0.Value.GetInt32(); + continue; + } if (property0.NameEquals("geoRegion"u8)) { geoRegion = property0.Value.GetString(); @@ -377,7 +388,7 @@ internal static AppServicePlanPatch DeserializeAppServicePlanPatch(JsonElement e continue; } } - return new AppServicePlanPatch(id, name, type, systemData.Value, workerTierName.Value, Optional.ToNullable(status), subscription.Value, hostingEnvironmentProfile.Value, Optional.ToNullable(maximumNumberOfWorkers), geoRegion.Value, Optional.ToNullable(perSiteScaling), Optional.ToNullable(elasticScaleEnabled), 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, Optional.ToNullable(zoneRedundant), kind.Value); + return new AppServicePlanPatch(id, name, type, systemData.Value, workerTierName.Value, Optional.ToNullable(status), subscription.Value, hostingEnvironmentProfile.Value, Optional.ToNullable(maximumNumberOfWorkers), Optional.ToNullable(numberOfWorkers), geoRegion.Value, Optional.ToNullable(perSiteScaling), Optional.ToNullable(elasticScaleEnabled), 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, Optional.ToNullable(zoneRedundant), kind.Value); } } } diff --git a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/AppServicePlanPatch.cs b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/AppServicePlanPatch.cs index 931c95fa92bf..5adbaa18bf1f 100644 --- a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/AppServicePlanPatch.cs +++ b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/AppServicePlanPatch.cs @@ -29,6 +29,7 @@ public AppServicePlanPatch() /// 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. + /// The number of instances that are 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. @@ -41,7 +42,7 @@ public AppServicePlanPatch() /// 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. + /// If Linux app service plan <code>true</code>, <code>false</code> otherwise. This property is required for Linux app service plans. /// 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. @@ -53,13 +54,14 @@ public AppServicePlanPatch() /// If <code>false</code>, this App Service Plan will not perform availability zone balancing. /// /// Kind of resource. - internal AppServicePlanPatch(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, string workerTierName, AppServicePlanStatus? status, string subscription, HostingEnvironmentProfile hostingEnvironmentProfile, int? maximumNumberOfWorkers, string geoRegion, bool? isPerSiteScaling, bool? isElasticScaleEnabled, int? maximumElasticWorkerCount, int? numberOfSites, bool? isSpot, DateTimeOffset? spotExpirationOn, DateTimeOffset? freeOfferExpirationOn, string resourceGroup, bool? isReserved, bool? isXenon, bool? isHyperV, int? targetWorkerCount, int? targetWorkerSizeId, ProvisioningState? provisioningState, KubeEnvironmentProfile kubeEnvironmentProfile, bool? isZoneRedundant, string kind) : base(id, name, resourceType, systemData) + internal AppServicePlanPatch(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, string workerTierName, AppServicePlanStatus? status, string subscription, HostingEnvironmentProfile hostingEnvironmentProfile, int? maximumNumberOfWorkers, int? numberOfWorkers, string geoRegion, bool? isPerSiteScaling, bool? isElasticScaleEnabled, int? maximumElasticWorkerCount, int? numberOfSites, bool? isSpot, DateTimeOffset? spotExpirationOn, DateTimeOffset? freeOfferExpirationOn, string resourceGroup, bool? isReserved, bool? isXenon, bool? isHyperV, int? targetWorkerCount, int? targetWorkerSizeId, ProvisioningState? provisioningState, KubeEnvironmentProfile kubeEnvironmentProfile, bool? isZoneRedundant, string kind) : base(id, name, resourceType, systemData) { WorkerTierName = workerTierName; Status = status; Subscription = subscription; HostingEnvironmentProfile = hostingEnvironmentProfile; MaximumNumberOfWorkers = maximumNumberOfWorkers; + NumberOfWorkers = numberOfWorkers; GeoRegion = geoRegion; IsPerSiteScaling = isPerSiteScaling; IsElasticScaleEnabled = isElasticScaleEnabled; @@ -90,6 +92,8 @@ internal AppServicePlanPatch(ResourceIdentifier id, string name, ResourceType re public HostingEnvironmentProfile HostingEnvironmentProfile { get; set; } /// Maximum number of instances that can be assigned to this App Service plan. public int? MaximumNumberOfWorkers { get; } + /// The number of instances that are assigned to this App Service plan. + public int? NumberOfWorkers { get; } /// Geographical location for the App Service plan. public string GeoRegion { get; } /// @@ -111,7 +115,7 @@ internal AppServicePlanPatch(ResourceIdentifier id, string name, ResourceType re public DateTimeOffset? FreeOfferExpirationOn { 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. + /// If Linux app service plan <code>true</code>, <code>false</code> otherwise. This property is required for Linux app service plans. public bool? IsReserved { get; set; } /// Obsolete: If Hyper-V container app service plan <code>true</code>, <code>false</code> otherwise. public bool? IsXenon { get; set; } diff --git a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/AseV3NetworkingConfigurationData.Serialization.cs b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/AseV3NetworkingConfigurationData.Serialization.cs index e9bed72bc55c..a04d0ae5b708 100644 --- a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/AseV3NetworkingConfigurationData.Serialization.cs +++ b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/AseV3NetworkingConfigurationData.Serialization.cs @@ -30,6 +30,21 @@ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) writer.WritePropertyName("allowNewPrivateEndpointConnections"u8); writer.WriteBooleanValue(AllowNewPrivateEndpointConnections.Value); } + if (Optional.IsDefined(FtpEnabled)) + { + writer.WritePropertyName("ftpEnabled"u8); + writer.WriteBooleanValue(FtpEnabled.Value); + } + if (Optional.IsDefined(RemoteDebugEnabled)) + { + writer.WritePropertyName("remoteDebugEnabled"u8); + writer.WriteBooleanValue(RemoteDebugEnabled.Value); + } + if (Optional.IsDefined(InboundIPAddressOverride)) + { + writer.WritePropertyName("inboundIpAddressOverride"u8); + writer.WriteStringValue(InboundIPAddressOverride); + } writer.WriteEndObject(); writer.WriteEndObject(); } @@ -46,6 +61,9 @@ internal static AseV3NetworkingConfigurationData DeserializeAseV3NetworkingConfi Optional> externalInboundIPAddresses = default; Optional> internalInboundIPAddresses = default; Optional allowNewPrivateEndpointConnections = default; + Optional ftpEnabled = default; + Optional remoteDebugEnabled = default; + Optional inboundIPAddressOverride = default; foreach (var property in element.EnumerateObject()) { if (property.NameEquals("kind"u8)) @@ -157,11 +175,36 @@ internal static AseV3NetworkingConfigurationData DeserializeAseV3NetworkingConfi allowNewPrivateEndpointConnections = property0.Value.GetBoolean(); continue; } + if (property0.NameEquals("ftpEnabled"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + ftpEnabled = property0.Value.GetBoolean(); + continue; + } + if (property0.NameEquals("remoteDebugEnabled"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + remoteDebugEnabled = property0.Value.GetBoolean(); + continue; + } + if (property0.NameEquals("inboundIpAddressOverride"u8)) + { + inboundIPAddressOverride = property0.Value.GetString(); + continue; + } } continue; } } - return new AseV3NetworkingConfigurationData(id, name, type, systemData.Value, Optional.ToList(windowsOutboundIPAddresses), Optional.ToList(linuxOutboundIPAddresses), Optional.ToList(externalInboundIPAddresses), Optional.ToList(internalInboundIPAddresses), Optional.ToNullable(allowNewPrivateEndpointConnections), kind.Value); + return new AseV3NetworkingConfigurationData(id, name, type, systemData.Value, Optional.ToList(windowsOutboundIPAddresses), Optional.ToList(linuxOutboundIPAddresses), Optional.ToList(externalInboundIPAddresses), Optional.ToList(internalInboundIPAddresses), Optional.ToNullable(allowNewPrivateEndpointConnections), Optional.ToNullable(ftpEnabled), Optional.ToNullable(remoteDebugEnabled), inboundIPAddressOverride.Value, kind.Value); } } } diff --git a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/AzureResourceErrorInfo.Serialization.cs b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/AzureResourceErrorInfo.Serialization.cs new file mode 100644 index 000000000000..d31e433da72b --- /dev/null +++ b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/AzureResourceErrorInfo.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 Azure.ResourceManager.AppService.Models +{ + public partial class AzureResourceErrorInfo + { + internal static AzureResourceErrorInfo DeserializeAzureResourceErrorInfo(JsonElement element) + { + string message = default; + Optional> details = default; + string code = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("message"u8)) + { + message = property.Value.GetString(); + continue; + } + if (property.NameEquals("details"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(DeserializeAzureResourceErrorInfo(item)); + } + details = array; + continue; + } + if (property.NameEquals("code"u8)) + { + code = property.Value.GetString(); + continue; + } + } + return new AzureResourceErrorInfo(code, message, Optional.ToList(details)); + } + } +} diff --git a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/AzureResourceErrorInfo.cs b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/AzureResourceErrorInfo.cs new file mode 100644 index 000000000000..8e0e99d8e096 --- /dev/null +++ b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/AzureResourceErrorInfo.cs @@ -0,0 +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; + +namespace Azure.ResourceManager.AppService.Models +{ + /// The azure resource error info. + public partial class AzureResourceErrorInfo : ErrorInfo + { + /// Initializes a new instance of AzureResourceErrorInfo. + /// The error code. + /// The error message. + /// or is null. + internal AzureResourceErrorInfo(string code, string message) : base(code) + { + Argument.AssertNotNull(code, nameof(code)); + Argument.AssertNotNull(message, nameof(message)); + + Message = message; + Details = new ChangeTrackingList(); + } + + /// Initializes a new instance of AzureResourceErrorInfo. + /// The error code. + /// The error message. + /// The error details. + /// is null. + internal AzureResourceErrorInfo(string code, string message, IReadOnlyList details) : base(code) + { + Argument.AssertNotNull(code, nameof(code)); + + Message = message; + Details = details; + } + + /// The error message. + public string Message { get; } + /// The error details. + public IReadOnlyList Details { get; } + } +} diff --git a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/CertificateOrderAction.Serialization.cs b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/CertificateOrderAction.Serialization.cs index cc2ee3eec733..ee7cc6c71347 100644 --- a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/CertificateOrderAction.Serialization.cs +++ b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/CertificateOrderAction.Serialization.cs @@ -8,101 +8,39 @@ using System; using System.Text.Json; using Azure.Core; -using Azure.ResourceManager.Models; namespace Azure.ResourceManager.AppService.Models { - public partial class CertificateOrderAction : IUtf8JsonSerializable + public partial class CertificateOrderAction { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(Kind)) - { - writer.WritePropertyName("kind"u8); - writer.WriteStringValue(Kind); - } - writer.WritePropertyName("properties"u8); - writer.WriteStartObject(); - writer.WriteEndObject(); - writer.WriteEndObject(); - } - internal static CertificateOrderAction DeserializeCertificateOrderAction(JsonElement element) { - Optional kind = default; - ResourceIdentifier id = default; - string name = default; - ResourceType type = default; - Optional systemData = default; Optional actionType = default; Optional createdAt = default; foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("kind"u8)) - { - kind = property.Value.GetString(); - continue; - } - if (property.NameEquals("id"u8)) - { - id = new ResourceIdentifier(property.Value.GetString()); - continue; - } - if (property.NameEquals("name"u8)) - { - name = property.Value.GetString(); - continue; - } - if (property.NameEquals("type"u8)) - { - type = new ResourceType(property.Value.GetString()); - continue; - } - if (property.NameEquals("systemData"u8)) + if (property.NameEquals("actionType"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) { property.ThrowNonNullablePropertyIsNull(); continue; } - systemData = JsonSerializer.Deserialize(property.Value.GetRawText()); + actionType = property.Value.GetString().ToCertificateOrderActionType(); continue; } - if (property.NameEquals("properties"u8)) + if (property.NameEquals("createdAt"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) { property.ThrowNonNullablePropertyIsNull(); continue; } - foreach (var property0 in property.Value.EnumerateObject()) - { - if (property0.NameEquals("actionType"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - actionType = property0.Value.GetString().ToCertificateOrderActionType(); - continue; - } - if (property0.NameEquals("createdAt"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - createdAt = property0.Value.GetDateTimeOffset("O"); - continue; - } - } + createdAt = property.Value.GetDateTimeOffset("O"); continue; } } - return new CertificateOrderAction(id, name, type, systemData.Value, Optional.ToNullable(actionType), Optional.ToNullable(createdAt), kind.Value); + return new CertificateOrderAction(Optional.ToNullable(actionType), Optional.ToNullable(createdAt)); } } } diff --git a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/CertificateOrderAction.cs b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/CertificateOrderAction.cs index 381a5c4fe2cf..87dd5eb2c3b5 100644 --- a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/CertificateOrderAction.cs +++ b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/CertificateOrderAction.cs @@ -6,39 +6,29 @@ #nullable disable using System; -using Azure.Core; -using Azure.ResourceManager.Models; namespace Azure.ResourceManager.AppService.Models { /// Certificate order action. - public partial class CertificateOrderAction : ResourceData + public partial class CertificateOrderAction { /// Initializes a new instance of CertificateOrderAction. - public CertificateOrderAction() + internal CertificateOrderAction() { } /// Initializes a new instance of CertificateOrderAction. - /// The id. - /// The name. - /// The resourceType. - /// The systemData. /// Action type. /// Time at which the certificate action was performed. - /// Kind of resource. - internal CertificateOrderAction(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, CertificateOrderActionType? actionType, DateTimeOffset? createdOn, string kind) : base(id, name, resourceType, systemData) + internal CertificateOrderAction(CertificateOrderActionType? actionType, DateTimeOffset? createdOn) { ActionType = actionType; CreatedOn = createdOn; - Kind = kind; } /// Action type. public CertificateOrderActionType? ActionType { get; } /// Time at which the certificate action was performed. public DateTimeOffset? CreatedOn { get; } - /// Kind of resource. - public string Kind { get; set; } } } diff --git a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/Configuration.Serialization.cs b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/Configuration.Serialization.cs new file mode 100644 index 000000000000..db5f69865e29 --- /dev/null +++ b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/Configuration.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 Azure.ResourceManager.AppService.Models +{ + public partial class Configuration : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsCollectionDefined(Secrets)) + { + writer.WritePropertyName("secrets"u8); + writer.WriteStartArray(); + foreach (var item in Secrets) + { + writer.WriteObjectValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(ActiveRevisionsMode)) + { + writer.WritePropertyName("activeRevisionsMode"u8); + writer.WriteStringValue(ActiveRevisionsMode.Value.ToString()); + } + if (Optional.IsDefined(Ingress)) + { + writer.WritePropertyName("ingress"u8); + writer.WriteObjectValue(Ingress); + } + if (Optional.IsCollectionDefined(Registries)) + { + writer.WritePropertyName("registries"u8); + writer.WriteStartArray(); + foreach (var item in Registries) + { + writer.WriteObjectValue(item); + } + writer.WriteEndArray(); + } + writer.WriteEndObject(); + } + + internal static Configuration DeserializeConfiguration(JsonElement element) + { + Optional> secrets = default; + Optional activeRevisionsMode = default; + Optional ingress = default; + Optional> registries = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("secrets"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(Secret.DeserializeSecret(item)); + } + secrets = array; + continue; + } + if (property.NameEquals("activeRevisionsMode"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + activeRevisionsMode = new ActiveRevisionsMode(property.Value.GetString()); + continue; + } + if (property.NameEquals("ingress"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + ingress = Ingress.DeserializeIngress(property.Value); + continue; + } + if (property.NameEquals("registries"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(RegistryCredentials.DeserializeRegistryCredentials(item)); + } + registries = array; + continue; + } + } + return new Configuration(Optional.ToList(secrets), Optional.ToNullable(activeRevisionsMode), ingress.Value, Optional.ToList(registries)); + } + } +} diff --git a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/Configuration.cs b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/Configuration.cs new file mode 100644 index 000000000000..23e5335b0eb7 --- /dev/null +++ b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/Configuration.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.ResourceManager.AppService.Models +{ + /// Non versioned Container App configuration properties that define the mutable settings of a Container app. + public partial class Configuration + { + /// Initializes a new instance of Configuration. + public Configuration() + { + Secrets = new ChangeTrackingList(); + Registries = new ChangeTrackingList(); + } + + /// Initializes a new instance of Configuration. + /// Collection of secrets used by a Container app. + /// + /// ActiveRevisionsMode controls how active revisions are handled for the Container app: + /// <list><item>Multiple: multiple revisions can be active. If no value if provided, this is the default</item><item>Single: Only one revision can be active at a time. Revision weights can not be used in this mode</item></list> + /// + /// Ingress configurations. + /// Collection of private container registry credentials for containers used by the Container app. + internal Configuration(IList secrets, ActiveRevisionsMode? activeRevisionsMode, Ingress ingress, IList registries) + { + Secrets = secrets; + ActiveRevisionsMode = activeRevisionsMode; + Ingress = ingress; + Registries = registries; + } + + /// Collection of secrets used by a Container app. + public IList Secrets { get; } + /// + /// ActiveRevisionsMode controls how active revisions are handled for the Container app: + /// <list><item>Multiple: multiple revisions can be active. If no value if provided, this is the default</item><item>Single: Only one revision can be active at a time. Revision weights can not be used in this mode</item></list> + /// + public ActiveRevisionsMode? ActiveRevisionsMode { get; set; } + /// Ingress configurations. + public Ingress Ingress { get; set; } + /// Collection of private container registry credentials for containers used by the Container app. + public IList Registries { get; } + } +} diff --git a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/Container.Serialization.cs b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/Container.Serialization.cs new file mode 100644 index 000000000000..d59dc01a301f --- /dev/null +++ b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/Container.Serialization.cs @@ -0,0 +1,146 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.AppService.Models +{ + public partial class Container : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(Image)) + { + writer.WritePropertyName("image"u8); + writer.WriteStringValue(Image); + } + if (Optional.IsDefined(Name)) + { + writer.WritePropertyName("name"u8); + writer.WriteStringValue(Name); + } + if (Optional.IsCollectionDefined(Command)) + { + writer.WritePropertyName("command"u8); + writer.WriteStartArray(); + foreach (var item in Command) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(Args)) + { + writer.WritePropertyName("args"u8); + writer.WriteStartArray(); + foreach (var item in Args) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(Env)) + { + writer.WritePropertyName("env"u8); + writer.WriteStartArray(); + foreach (var item in Env) + { + writer.WriteObjectValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(Resources)) + { + writer.WritePropertyName("resources"u8); + writer.WriteObjectValue(Resources); + } + writer.WriteEndObject(); + } + + internal static Container DeserializeContainer(JsonElement element) + { + Optional image = default; + Optional name = default; + Optional> command = default; + Optional> args = default; + Optional> env = default; + Optional resources = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("image"u8)) + { + image = property.Value.GetString(); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("command"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + command = array; + continue; + } + if (property.NameEquals("args"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + args = array; + continue; + } + if (property.NameEquals("env"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(EnvironmentVar.DeserializeEnvironmentVar(item)); + } + env = array; + continue; + } + if (property.NameEquals("resources"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + resources = ContainerResources.DeserializeContainerResources(property.Value); + continue; + } + } + return new Container(image.Value, name.Value, Optional.ToList(command), Optional.ToList(args), Optional.ToList(env), resources.Value); + } + } +} diff --git a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/Container.cs b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/Container.cs new file mode 100644 index 000000000000..6bbfffabdb04 --- /dev/null +++ b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/Container.cs @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.ResourceManager.AppService.Models +{ + /// Container App container definition. + public partial class Container + { + /// Initializes a new instance of Container. + public Container() + { + Command = new ChangeTrackingList(); + Args = new ChangeTrackingList(); + Env = new ChangeTrackingList(); + } + + /// Initializes a new instance of Container. + /// Container image tag. + /// Custom container name. + /// Container start command. + /// Container start command arguments. + /// Container environment variables. + /// Container resource requirements. + internal Container(string image, string name, IList command, IList args, IList env, ContainerResources resources) + { + Image = image; + Name = name; + Command = command; + Args = args; + Env = env; + Resources = resources; + } + + /// Container image tag. + public string Image { get; set; } + /// Custom container name. + public string Name { get; set; } + /// Container start command. + public IList Command { get; } + /// Container start command arguments. + public IList Args { get; } + /// Container environment variables. + public IList Env { get; } + /// Container resource requirements. + public ContainerResources Resources { get; set; } + } +} diff --git a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/ContainerAppCollection.Serialization.cs b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/ContainerAppCollection.Serialization.cs new file mode 100644 index 000000000000..df4f27a7d7c2 --- /dev/null +++ b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/ContainerAppCollection.Serialization.cs @@ -0,0 +1,42 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; +using Azure.ResourceManager.AppService; + +namespace Azure.ResourceManager.AppService.Models +{ + internal partial class ContainerAppCollection + { + internal static ContainerAppCollection DeserializeContainerAppCollection(JsonElement element) + { + IReadOnlyList value = default; + Optional nextLink = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(ContainerAppData.DeserializeContainerAppData(item)); + } + value = array; + continue; + } + if (property.NameEquals("nextLink"u8)) + { + nextLink = property.Value.GetString(); + continue; + } + } + return new ContainerAppCollection(value, nextLink.Value); + } + } +} diff --git a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/ContainerAppCollection.cs b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/ContainerAppCollection.cs new file mode 100644 index 000000000000..55632547f10e --- /dev/null +++ b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/ContainerAppCollection.cs @@ -0,0 +1,43 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; +using Azure.Core; +using Azure.ResourceManager.AppService; + +namespace Azure.ResourceManager.AppService.Models +{ + /// Container App collection ARM resource. + internal partial class ContainerAppCollection + { + /// Initializes a new instance of ContainerAppCollection. + /// Collection of resources. + /// is null. + internal ContainerAppCollection(IEnumerable value) + { + Argument.AssertNotNull(value, nameof(value)); + + Value = value.ToList(); + } + + /// Initializes a new instance of ContainerAppCollection. + /// Collection of resources. + /// Link to next page of resources. + internal ContainerAppCollection(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/Azure.ResourceManager.AppService/src/Generated/Models/ContainerAppData.Serialization.cs b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/ContainerAppData.Serialization.cs new file mode 100644 index 000000000000..5d53847cc48e --- /dev/null +++ b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/ContainerAppData.Serialization.cs @@ -0,0 +1,188 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; +using Azure.ResourceManager.AppService.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.AppService +{ + public partial class ContainerAppData : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(Kind)) + { + writer.WritePropertyName("kind"u8); + writer.WriteStringValue(Kind); + } + if (Optional.IsCollectionDefined(Tags)) + { + writer.WritePropertyName("tags"u8); + writer.WriteStartObject(); + foreach (var item in Tags) + { + writer.WritePropertyName(item.Key); + writer.WriteStringValue(item.Value); + } + writer.WriteEndObject(); + } + writer.WritePropertyName("location"u8); + writer.WriteStringValue(Location); + writer.WritePropertyName("properties"u8); + writer.WriteStartObject(); + if (Optional.IsDefined(KubeEnvironmentId)) + { + writer.WritePropertyName("kubeEnvironmentId"u8); + writer.WriteStringValue(KubeEnvironmentId); + } + if (Optional.IsDefined(Configuration)) + { + writer.WritePropertyName("configuration"u8); + writer.WriteObjectValue(Configuration); + } + if (Optional.IsDefined(Template)) + { + writer.WritePropertyName("template"u8); + writer.WriteObjectValue(Template); + } + writer.WriteEndObject(); + writer.WriteEndObject(); + } + + internal static ContainerAppData DeserializeContainerAppData(JsonElement element) + { + Optional kind = default; + Optional> tags = default; + AzureLocation location = default; + ResourceIdentifier id = default; + string name = default; + ResourceType type = default; + Optional systemData = default; + Optional provisioningState = default; + Optional kubeEnvironmentId = default; + Optional latestRevisionName = default; + Optional latestRevisionFqdn = default; + Optional configuration = default; + Optional