diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/api/Azure.ResourceManager.AppContainers.net8.0.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/api/Azure.ResourceManager.AppContainers.net8.0.cs index 7e9ebab3c1b5..50aca5d735fa 100644 --- a/sdk/containerapps/Azure.ResourceManager.AppContainers/api/Azure.ResourceManager.AppContainers.net8.0.cs +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/api/Azure.ResourceManager.AppContainers.net8.0.cs @@ -2,17 +2,26 @@ namespace Azure.ResourceManager.AppContainers { public static partial class AppContainersExtensions { + public static Azure.ResourceManager.AppContainers.AppContainersPrivateEndpointConnectionResource GetAppContainersPrivateEndpointConnectionResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.ResourceManager.AppContainers.AppResiliencyResource GetAppResiliencyResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } public static Azure.Pageable GetAvailableWorkloadProfiles(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, Azure.Core.AzureLocation location, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public static Azure.AsyncPageable GetAvailableWorkloadProfilesAsync(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, Azure.Core.AzureLocation location, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public static Azure.Pageable GetBillingMeters(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, Azure.Core.AzureLocation location, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public static Azure.AsyncPageable GetBillingMetersAsync(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, Azure.Core.AzureLocation location, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.ResourceManager.AppContainers.BuilderResource GetBuilderResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.Response GetBuilderResource(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string builderName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static System.Threading.Tasks.Task> GetBuilderResourceAsync(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string builderName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.ResourceManager.AppContainers.BuilderResourceCollection GetBuilderResources(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource) { throw null; } + public static Azure.Pageable GetBuilderResources(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.AsyncPageable GetBuilderResourcesAsync(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.ResourceManager.AppContainers.BuildResource GetBuildResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.ResourceManager.AppContainers.ConnectedEnvironmentDaprComponentResource GetConnectedEnvironmentDaprComponentResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } public static Azure.Response GetContainerApp(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string containerAppName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public static System.Threading.Tasks.Task> GetContainerAppAsync(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string containerAppName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public static Azure.ResourceManager.AppContainers.ContainerAppAuthConfigResource GetContainerAppAuthConfigResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } public static Azure.Response GetContainerAppConnectedEnvironment(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string connectedEnvironmentName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public static System.Threading.Tasks.Task> GetContainerAppConnectedEnvironmentAsync(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string connectedEnvironmentName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public static Azure.ResourceManager.AppContainers.ContainerAppConnectedEnvironmentCertificateResource GetContainerAppConnectedEnvironmentCertificateResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } - public static Azure.ResourceManager.AppContainers.ContainerAppConnectedEnvironmentDaprComponentResource GetContainerAppConnectedEnvironmentDaprComponentResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } public static Azure.ResourceManager.AppContainers.ContainerAppConnectedEnvironmentResource GetContainerAppConnectedEnvironmentResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } public static Azure.ResourceManager.AppContainers.ContainerAppConnectedEnvironmentCollection GetContainerAppConnectedEnvironments(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource) { throw null; } public static Azure.Pageable GetContainerAppConnectedEnvironments(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } @@ -48,10 +57,19 @@ public static partial class AppContainersExtensions public static Azure.ResourceManager.AppContainers.ContainerAppCollection GetContainerApps(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource) { throw null; } public static Azure.Pageable GetContainerApps(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public static Azure.AsyncPageable GetContainerAppsAsync(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.ResourceManager.AppContainers.ContainerAppsBuildResource GetContainerAppsBuildResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } public static Azure.ResourceManager.AppContainers.ContainerAppSourceControlResource GetContainerAppSourceControlResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.ResourceManager.AppContainers.ContainerAppsPatchResource GetContainerAppsPatchResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } public static Azure.Response GetCustomDomainVerificationId(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public static System.Threading.Tasks.Task> GetCustomDomainVerificationIdAsync(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.ResourceManager.AppContainers.DaprComponentResiliencyPolicyResource GetDaprComponentResiliencyPolicyResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.ResourceManager.AppContainers.DaprSubscriptionResource GetDaprSubscriptionResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.ResourceManager.AppContainers.DotNetComponentResource GetDotNetComponentResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.ResourceManager.AppContainers.HttpRouteConfigResource GetHttpRouteConfigResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } public static Azure.ResourceManager.AppContainers.JavaComponentResource GetJavaComponentResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.ResourceManager.AppContainers.LabelHistoryResource GetLabelHistoryResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.ResourceManager.AppContainers.LogicAppResource GetLogicAppResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.ResourceManager.AppContainers.MaintenanceConfigurationResource GetMaintenanceConfigurationResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } public static Azure.Response GetSessionPool(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string sessionPoolName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public static System.Threading.Tasks.Task> GetSessionPoolAsync(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string sessionPoolName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public static Azure.ResourceManager.AppContainers.SessionPoolResource GetSessionPoolResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } @@ -60,6 +78,109 @@ public static partial class AppContainersExtensions public static Azure.AsyncPageable GetSessionPoolsAsync(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public static Azure.Pageable GetUsages(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, Azure.Core.AzureLocation location, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public static Azure.AsyncPageable GetUsagesAsync(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, Azure.Core.AzureLocation location, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.ResourceManager.AppContainers.WorkflowEnvelopeResource GetWorkflowEnvelopeResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + } + public partial class AppContainersPrivateEndpointConnectionCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected AppContainersPrivateEndpointConnectionCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string privateEndpointConnectionName, Azure.ResourceManager.AppContainers.AppContainersPrivateEndpointConnectionData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string privateEndpointConnectionName, Azure.ResourceManager.AppContainers.AppContainersPrivateEndpointConnectionData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string privateEndpointConnectionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string privateEndpointConnectionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string privateEndpointConnectionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string privateEndpointConnectionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string privateEndpointConnectionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string privateEndpointConnectionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } + System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } + } + public partial class AppContainersPrivateEndpointConnectionData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public AppContainersPrivateEndpointConnectionData() { } + public Azure.ResourceManager.AppContainers.Models.AppContainersPrivateLinkServiceConnectionState ConnectionState { get { throw null; } set { } } + public System.Collections.Generic.IReadOnlyList GroupIds { get { throw null; } } + public Azure.Core.ResourceIdentifier PrivateEndpointId { get { throw null; } } + public Azure.ResourceManager.AppContainers.Models.AppContainersPrivateEndpointConnectionProvisioningState? ProvisioningState { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.AppContainersPrivateEndpointConnectionData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.AppContainersPrivateEndpointConnectionData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class AppContainersPrivateEndpointConnectionResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected AppContainersPrivateEndpointConnectionResource() { } + public virtual Azure.ResourceManager.AppContainers.AppContainersPrivateEndpointConnectionData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string environmentName, string privateEndpointConnectionName) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + Azure.ResourceManager.AppContainers.AppContainersPrivateEndpointConnectionData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.AppContainersPrivateEndpointConnectionData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.AppContainers.AppContainersPrivateEndpointConnectionData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.AppContainers.AppContainersPrivateEndpointConnectionData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public partial class AppResiliencyCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected AppResiliencyCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string name, Azure.ResourceManager.AppContainers.AppResiliencyData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string name, Azure.ResourceManager.AppContainers.AppResiliencyData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string name, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string name, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string name, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string name, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string name, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string name, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } + System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } + } + public partial class AppResiliencyData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public AppResiliencyData() { } + public Azure.ResourceManager.AppContainers.Models.CircuitBreakerPolicy CircuitBreakerPolicy { get { throw null; } set { } } + public Azure.ResourceManager.AppContainers.Models.HttpConnectionPool HttpConnectionPool { get { throw null; } set { } } + public Azure.ResourceManager.AppContainers.Models.HttpRetryPolicy HttpRetryPolicy { get { throw null; } set { } } + public int? MaxConnections { get { throw null; } set { } } + public int? TcpRetryMaxConnectAttempts { get { throw null; } set { } } + public Azure.ResourceManager.AppContainers.Models.ContainerAppTimeoutPolicy TimeoutPolicy { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.AppResiliencyData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.AppResiliencyData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class AppResiliencyResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected AppResiliencyResource() { } + public virtual Azure.ResourceManager.AppContainers.AppResiliencyData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string appName, string name) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + Azure.ResourceManager.AppContainers.AppResiliencyData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.AppResiliencyData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + public virtual Azure.Response Update(Azure.ResourceManager.AppContainers.AppResiliencyData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.ResourceManager.AppContainers.AppResiliencyData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } } public partial class AzureResourceManagerAppContainersContext : System.ClientModel.Primitives.ModelReaderWriterContext { @@ -67,6 +188,179 @@ internal AzureResourceManagerAppContainersContext() { } public static Azure.ResourceManager.AppContainers.AzureResourceManagerAppContainersContext Default { get { throw null; } } protected override bool TryGetTypeBuilderCore(System.Type type, out System.ClientModel.Primitives.ModelReaderWriterTypeBuilder builder) { throw null; } } + public partial class BuilderResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected BuilderResource() { } + public virtual Azure.ResourceManager.AppContainers.BuilderResourceData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public virtual Azure.Response AddTag(string key, string value, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> AddTagAsync(string key, string value, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string builderName) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response GetBuildResource(string buildName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetBuildResourceAsync(string buildName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.AppContainers.BuildResourceCollection GetBuildResources() { throw null; } + public virtual Azure.Response RemoveTag(string key, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> RemoveTagAsync(string key, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response SetTags(System.Collections.Generic.IDictionary tags, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> SetTagsAsync(System.Collections.Generic.IDictionary tags, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + Azure.ResourceManager.AppContainers.BuilderResourceData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.BuilderResourceData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.AppContainers.Models.BuilderResourcePatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.AppContainers.Models.BuilderResourcePatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public partial class BuilderResourceCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected BuilderResourceCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string builderName, Azure.ResourceManager.AppContainers.BuilderResourceData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string builderName, Azure.ResourceManager.AppContainers.BuilderResourceData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string builderName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string builderName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string builderName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string builderName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string builderName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string builderName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } + System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } + } + public partial class BuilderResourceData : Azure.ResourceManager.Models.TrackedResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public BuilderResourceData(Azure.Core.AzureLocation location) { } + public System.Collections.Generic.IList ContainerRegistries { get { throw null; } } + public Azure.Core.ResourceIdentifier EnvironmentId { get { throw null; } set { } } + public Azure.ResourceManager.Models.ManagedServiceIdentity Identity { get { throw null; } set { } } + public Azure.ResourceManager.AppContainers.Models.ContainerAppBuilderProvisioningState? ProvisioningState { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.BuilderResourceData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.BuilderResourceData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class BuildResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected BuildResource() { } + public virtual Azure.ResourceManager.AppContainers.BuildResourceData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string builderName, string buildName) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response GetBuildAuthToken(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetBuildAuthTokenAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + Azure.ResourceManager.AppContainers.BuildResourceData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.BuildResourceData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.AppContainers.BuildResourceData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.AppContainers.BuildResourceData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public partial class BuildResourceCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected BuildResourceCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string buildName, Azure.ResourceManager.AppContainers.BuildResourceData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string buildName, Azure.ResourceManager.AppContainers.BuildResourceData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string buildName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string buildName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string buildName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string buildName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string buildName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string buildName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } + System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } + } + public partial class BuildResourceData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public BuildResourceData() { } + public Azure.ResourceManager.AppContainers.Models.ContainerAppBuildStatus? BuildStatus { get { throw null; } } + public Azure.ResourceManager.AppContainers.Models.ContainerAppBuildConfiguration Configuration { get { throw null; } set { } } + public Azure.ResourceManager.AppContainers.Models.ContainerRegistryWithCustomImage DestinationContainerRegistry { get { throw null; } set { } } + public string LogStreamEndpoint { get { throw null; } } + public Azure.ResourceManager.AppContainers.Models.ContainerAppBuildProvisioningState? ProvisioningState { get { throw null; } } + public string TokenEndpoint { get { throw null; } } + public string UploadEndpoint { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.BuildResourceData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.BuildResourceData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ConnectedEnvironmentDaprComponentCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected ConnectedEnvironmentDaprComponentCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string componentName, Azure.ResourceManager.AppContainers.ConnectedEnvironmentDaprComponentData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string componentName, Azure.ResourceManager.AppContainers.ConnectedEnvironmentDaprComponentData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string componentName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string componentName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string componentName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string componentName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string componentName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string componentName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } + System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } + } + public partial class ConnectedEnvironmentDaprComponentData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ConnectedEnvironmentDaprComponentData() { } + public string ComponentType { get { throw null; } set { } } + public string DeploymentErrors { get { throw null; } } + public bool? IgnoreErrors { get { throw null; } set { } } + public string InitTimeout { get { throw null; } set { } } + public System.Collections.Generic.IList Metadata { get { throw null; } } + public Azure.ResourceManager.AppContainers.Models.ConnectedEnvironmentDaprComponentProvisioningState? ProvisioningState { get { throw null; } } + public System.Collections.Generic.IList Scopes { get { throw null; } } + public System.Collections.Generic.IList Secrets { get { throw null; } } + public string SecretStoreComponent { get { throw null; } set { } } + public System.Collections.Generic.IList ServiceComponentBind { get { throw null; } } + public string Version { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.ConnectedEnvironmentDaprComponentData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.ConnectedEnvironmentDaprComponentData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ConnectedEnvironmentDaprComponentResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected ConnectedEnvironmentDaprComponentResource() { } + public virtual Azure.ResourceManager.AppContainers.ConnectedEnvironmentDaprComponentData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string connectedEnvironmentName, string componentName) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetSecrets(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetSecretsAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + Azure.ResourceManager.AppContainers.ConnectedEnvironmentDaprComponentData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.ConnectedEnvironmentDaprComponentData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.AppContainers.ConnectedEnvironmentDaprComponentData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.AppContainers.ConnectedEnvironmentDaprComponentData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } public partial class ContainerAppAuthConfigCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable { protected ContainerAppAuthConfigCollection() { } @@ -186,8 +480,8 @@ protected ContainerAppConnectedEnvironmentCertificateResource() { } Azure.ResourceManager.AppContainers.ContainerAppCertificateData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - public virtual Azure.Response Update(Azure.ResourceManager.AppContainers.Models.ContainerAppCertificatePatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.ResourceManager.AppContainers.Models.ContainerAppCertificatePatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.AppContainers.Models.ContainerAppCertificatePatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.AppContainers.Models.ContainerAppCertificatePatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } } public partial class ContainerAppConnectedEnvironmentCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable { @@ -206,44 +500,6 @@ protected ContainerAppConnectedEnvironmentCollection() { } System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } } - public partial class ContainerAppConnectedEnvironmentDaprComponentCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable - { - protected ContainerAppConnectedEnvironmentDaprComponentCollection() { } - public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string componentName, Azure.ResourceManager.AppContainers.ContainerAppDaprComponentData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string componentName, Azure.ResourceManager.AppContainers.ContainerAppDaprComponentData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.Response Exists(string componentName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> ExistsAsync(string componentName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.Response Get(string componentName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.Pageable GetAll(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.AsyncPageable GetAllAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> GetAsync(string componentName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.NullableResponse GetIfExists(string componentName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string componentName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } - System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } - System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } - } - public partial class ContainerAppConnectedEnvironmentDaprComponentResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel - { - public static readonly Azure.Core.ResourceType ResourceType; - protected ContainerAppConnectedEnvironmentDaprComponentResource() { } - public virtual Azure.ResourceManager.AppContainers.ContainerAppDaprComponentData Data { get { throw null; } } - public virtual bool HasData { get { throw null; } } - public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string connectedEnvironmentName, string componentName) { throw null; } - public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.Pageable GetSecrets(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.AsyncPageable GetSecretsAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - Azure.ResourceManager.AppContainers.ContainerAppDaprComponentData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.ResourceManager.AppContainers.ContainerAppDaprComponentData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.AppContainers.ContainerAppDaprComponentData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.AppContainers.ContainerAppDaprComponentData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - } public partial class ContainerAppConnectedEnvironmentData : Azure.ResourceManager.Models.TrackedResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public ContainerAppConnectedEnvironmentData(Azure.Core.AzureLocation location) { } @@ -267,6 +523,8 @@ public partial class ContainerAppConnectedEnvironmentResource : Azure.ResourceMa protected ContainerAppConnectedEnvironmentResource() { } public virtual Azure.ResourceManager.AppContainers.ContainerAppConnectedEnvironmentData Data { get { throw null; } } public virtual bool HasData { get { throw null; } } + public virtual Azure.Response AddTag(string key, string value, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> AddTagAsync(string key, string value, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Response CheckNameAvailability(Azure.ResourceManager.AppContainers.Models.ContainerAppNameAvailabilityContent content, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> CheckNameAvailabilityAsync(Azure.ResourceManager.AppContainers.Models.ContainerAppNameAvailabilityContent content, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string connectedEnvironmentName) { throw null; } @@ -274,22 +532,26 @@ protected ContainerAppConnectedEnvironmentResource() { } public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response GetConnectedEnvironmentDaprComponent(string componentName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetConnectedEnvironmentDaprComponentAsync(string componentName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.AppContainers.ConnectedEnvironmentDaprComponentCollection GetConnectedEnvironmentDaprComponents() { throw null; } public virtual Azure.Response GetContainerAppConnectedEnvironmentCertificate(string certificateName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> GetContainerAppConnectedEnvironmentCertificateAsync(string certificateName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.ResourceManager.AppContainers.ContainerAppConnectedEnvironmentCertificateCollection GetContainerAppConnectedEnvironmentCertificates() { throw null; } - public virtual Azure.Response GetContainerAppConnectedEnvironmentDaprComponent(string componentName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> GetContainerAppConnectedEnvironmentDaprComponentAsync(string componentName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.ResourceManager.AppContainers.ContainerAppConnectedEnvironmentDaprComponentCollection GetContainerAppConnectedEnvironmentDaprComponents() { throw null; } public virtual Azure.Response GetContainerAppConnectedEnvironmentStorage(string storageName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> GetContainerAppConnectedEnvironmentStorageAsync(string storageName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.ResourceManager.AppContainers.ContainerAppConnectedEnvironmentStorageCollection GetContainerAppConnectedEnvironmentStorages() { throw null; } + public virtual Azure.Response RemoveTag(string key, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> RemoveTagAsync(string key, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response SetTags(System.Collections.Generic.IDictionary tags, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> SetTagsAsync(System.Collections.Generic.IDictionary tags, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } Azure.ResourceManager.AppContainers.ContainerAppConnectedEnvironmentData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.AppContainers.ContainerAppConnectedEnvironmentData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - public virtual Azure.Response Update(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> UpdateAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Update(Azure.ResourceManager.AppContainers.Models.ContainerAppConnectedEnvironmentPatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.ResourceManager.AppContainers.Models.ContainerAppConnectedEnvironmentPatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } } public partial class ContainerAppConnectedEnvironmentStorageCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable { @@ -311,7 +573,7 @@ protected ContainerAppConnectedEnvironmentStorageCollection() { } public partial class ContainerAppConnectedEnvironmentStorageData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public ContainerAppConnectedEnvironmentStorageData() { } - public Azure.ResourceManager.AppContainers.Models.ContainerAppAzureFileProperties ConnectedEnvironmentStorageAzureFile { get { throw null; } set { } } + public Azure.ResourceManager.AppContainers.Models.ConnectedEnvironmentStorageProperties Properties { get { throw null; } set { } } protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.AppContainers.ContainerAppConnectedEnvironmentStorageData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } @@ -348,6 +610,7 @@ public ContainerAppDaprComponentData() { } public System.Collections.Generic.IList Scopes { get { throw null; } } public System.Collections.Generic.IList Secrets { get { throw null; } } public string SecretStoreComponent { get { throw null; } set { } } + public System.Collections.Generic.IList ServiceComponentBind { get { throw null; } } public string Version { get { throw null; } set { } } protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.AppContainers.ContainerAppDaprComponentData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -361,10 +624,12 @@ public partial class ContainerAppData : Azure.ResourceManager.Models.TrackedReso public ContainerAppData(Azure.Core.AzureLocation location) { } public Azure.ResourceManager.AppContainers.Models.ContainerAppConfiguration Configuration { get { throw null; } set { } } public string CustomDomainVerificationId { get { throw null; } } + public string DeploymentErrors { get { throw null; } } public Azure.Core.ResourceIdentifier EnvironmentId { get { throw null; } set { } } public System.Uri EventStreamEndpoint { get { throw null; } } public Azure.ResourceManager.AppContainers.Models.ContainerAppExtendedLocation ExtendedLocation { get { throw null; } set { } } public Azure.ResourceManager.Models.ManagedServiceIdentity Identity { get { throw null; } set { } } + public Azure.ResourceManager.AppContainers.Models.AppContainersKind? Kind { get { throw null; } set { } } public string LatestReadyRevisionName { get { throw null; } } public string LatestRevisionFqdn { get { throw null; } } public string LatestRevisionName { get { throw null; } } @@ -374,6 +639,7 @@ public ContainerAppData(Azure.Core.AzureLocation location) { } [System.ObsoleteAttribute("This property is obsolete and will be removed in a future release", false)] public System.Collections.Generic.IReadOnlyList OutboundIPAddresses { get { throw null; } } public System.Collections.Generic.IReadOnlyList OutboundIPAddressList { get { throw null; } } + public Azure.ResourceManager.AppContainers.Models.PatchingMode? PatchingMode { get { throw null; } set { } } public Azure.ResourceManager.AppContainers.Models.ContainerAppProvisioningState? ProvisioningState { get { throw null; } } public Azure.ResourceManager.AppContainers.Models.ContainerAppRunningStatus? RunningStatus { get { throw null; } } public Azure.ResourceManager.AppContainers.Models.ContainerAppTemplate Template { get { throw null; } set { } } @@ -496,9 +762,11 @@ public ContainerAppJobData(Azure.Core.AzureLocation location) { } public Azure.ResourceManager.AppContainers.Models.ContainerAppJobConfiguration Configuration { get { throw null; } set { } } public string EnvironmentId { get { throw null; } set { } } public string EventStreamEndpoint { get { throw null; } } + public Azure.ResourceManager.AppContainers.Models.ContainerAppExtendedLocation ExtendedLocation { get { throw null; } set { } } public Azure.ResourceManager.Models.ManagedServiceIdentity Identity { get { throw null; } set { } } public System.Collections.Generic.IReadOnlyList OutboundIPAddresses { get { throw null; } } public Azure.ResourceManager.AppContainers.Models.ContainerAppJobProvisioningState? ProvisioningState { get { throw null; } } + public Azure.ResourceManager.AppContainers.Models.ContainerAppJobRunningState? RunningState { get { throw null; } } public Azure.ResourceManager.AppContainers.Models.ContainerAppJobTemplate Template { get { throw null; } set { } } public string WorkloadProfileName { get { throw null; } set { } } protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } @@ -581,6 +849,7 @@ protected ContainerAppJobExecutionCollection() { } public partial class ContainerAppJobExecutionData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { internal ContainerAppJobExecutionData() { } + public System.Collections.Generic.IReadOnlyList DetailedStatusReplicas { get { throw null; } } public System.DateTimeOffset? EndOn { get { throw null; } } public System.DateTimeOffset? StartOn { get { throw null; } } public Azure.ResourceManager.AppContainers.Models.JobExecutionRunningState? Status { get { throw null; } } @@ -635,12 +904,16 @@ protected ContainerAppJobResource() { } public virtual Azure.AsyncPageable GetSecretsAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Response RemoveTag(string key, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> RemoveTagAsync(string key, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Resume(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ResumeAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Response SetTags(System.Collections.Generic.IDictionary tags, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> SetTagsAsync(System.Collections.Generic.IDictionary tags, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.ResourceManager.ArmOperation Start(Azure.WaitUntil waitUntil, Azure.ResourceManager.AppContainers.Models.ContainerAppJobExecutionTemplate template = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> StartAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.AppContainers.Models.ContainerAppJobExecutionTemplate template = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.ResourceManager.ArmOperation StopMultipleExecutions(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> StopMultipleExecutionsAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Suspend(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> SuspendAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } Azure.ResourceManager.AppContainers.ContainerAppJobData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.AppContainers.ContainerAppJobData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -789,6 +1062,9 @@ protected ContainerAppManagedEnvironmentDaprComponentResource() { } public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.AppContainers.DaprComponentResiliencyPolicyCollection GetDaprComponentResiliencyPolicies() { throw null; } + public virtual Azure.Response GetDaprComponentResiliencyPolicy(string name, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetDaprComponentResiliencyPolicyAsync(string name, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Pageable GetSecrets(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.AsyncPageable GetSecretsAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } Azure.ResourceManager.AppContainers.ContainerAppDaprComponentData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -802,22 +1078,30 @@ protected ContainerAppManagedEnvironmentDaprComponentResource() { } public partial class ContainerAppManagedEnvironmentData : Azure.ResourceManager.Models.TrackedResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public ContainerAppManagedEnvironmentData(Azure.Core.AzureLocation location) { } + public string AppInsightsConnectionString { get { throw null; } set { } } public Azure.ResourceManager.AppContainers.Models.ContainerAppLogsConfiguration AppLogsConfiguration { get { throw null; } set { } } + public System.Collections.Generic.IList AvailabilityZones { get { throw null; } } public Azure.ResourceManager.AppContainers.Models.ContainerAppCustomDomainConfiguration CustomDomainConfiguration { get { throw null; } set { } } public string DaprAIConnectionString { get { throw null; } set { } } public string DaprAIInstrumentationKey { get { throw null; } set { } } public string DaprVersion { get { throw null; } } public string DefaultDomain { get { throw null; } } public string DeploymentErrors { get { throw null; } } + public Azure.ResourceManager.AppContainers.Models.DiskEncryptionConfigurationKeyVaultConfiguration DiskEncryptionKeyVaultConfiguration { get { throw null; } set { } } public string EventStreamEndpoint { get { throw null; } } public Azure.ResourceManager.Models.ManagedServiceIdentity Identity { get { throw null; } set { } } public string InfrastructureResourceGroup { get { throw null; } set { } } + public Azure.ResourceManager.AppContainers.Models.IngressConfiguration IngressConfiguration { get { throw null; } set { } } public bool? IsEnabled { get { throw null; } set { } } public bool? IsMtlsEnabled { get { throw null; } set { } } public bool? IsZoneRedundant { get { throw null; } set { } } public string KedaVersion { get { throw null; } } public string Kind { get { throw null; } set { } } + public Azure.ResourceManager.AppContainers.Models.OpenTelemetryConfiguration OpenTelemetryConfiguration { get { throw null; } set { } } + public System.Collections.Generic.IReadOnlyList PrivateEndpointConnections { get { throw null; } } + public string PrivateLinkDefaultDomain { get { throw null; } } public Azure.ResourceManager.AppContainers.Models.ContainerAppEnvironmentProvisioningState? ProvisioningState { get { throw null; } } + public Azure.ResourceManager.AppContainers.Models.PublicNetworkAccess? PublicNetworkAccess { get { throw null; } set { } } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public Azure.ResourceManager.AppContainers.Models.AppContainersSkuName? SkuName { get { throw null; } set { } } public System.Net.IPAddress StaticIP { get { throw null; } } @@ -889,6 +1173,9 @@ protected ContainerAppManagedEnvironmentResource() { } public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response GetAppContainersPrivateEndpointConnection(string privateEndpointConnectionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAppContainersPrivateEndpointConnectionAsync(string privateEndpointConnectionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.AppContainers.AppContainersPrivateEndpointConnectionCollection GetAppContainersPrivateEndpointConnections() { throw null; } public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Response GetAuthToken(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> GetAuthTokenAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } @@ -908,9 +1195,23 @@ protected ContainerAppManagedEnvironmentResource() { } public virtual Azure.Response GetContainerAppManagedEnvironmentStorage(string storageName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> GetContainerAppManagedEnvironmentStorageAsync(string storageName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.ResourceManager.AppContainers.ContainerAppManagedEnvironmentStorageCollection GetContainerAppManagedEnvironmentStorages() { throw null; } + public virtual Azure.Response GetDaprSubscription(string name, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetDaprSubscriptionAsync(string name, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.AppContainers.DaprSubscriptionCollection GetDaprSubscriptions() { throw null; } + public virtual Azure.Response GetDotNetComponent(string name, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetDotNetComponentAsync(string name, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.AppContainers.DotNetComponentCollection GetDotNetComponents() { throw null; } + public virtual Azure.Response GetHttpRouteConfig(string httpRouteName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetHttpRouteConfigAsync(string httpRouteName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.AppContainers.HttpRouteConfigCollection GetHttpRouteConfigs() { throw null; } public virtual Azure.Response GetJavaComponent(string name, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> GetJavaComponentAsync(string name, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.ResourceManager.AppContainers.JavaComponentCollection GetJavaComponents() { throw null; } + public virtual Azure.Response GetMaintenanceConfigurationResource(string configName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetMaintenanceConfigurationResourceAsync(string configName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.AppContainers.MaintenanceConfigurationResourceCollection GetMaintenanceConfigurationResources() { throw null; } + public virtual Azure.Pageable GetManagedEnvironmentPrivateLinkResources(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetManagedEnvironmentPrivateLinkResourcesAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Pageable GetManagedEnvironmentUsages(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.AsyncPageable GetManagedEnvironmentUsagesAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Pageable GetWorkloadProfileStates(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } @@ -1033,6 +1334,9 @@ protected ContainerAppResource() { } public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.AppContainers.AppResiliencyCollection GetAppResiliencies() { throw null; } + public virtual Azure.Response GetAppResiliency(string name, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAppResiliencyAsync(string name, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Response GetAuthToken(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> GetAuthTokenAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } @@ -1049,11 +1353,23 @@ protected ContainerAppResource() { } public virtual Azure.Response GetContainerAppRevision(string revisionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> GetContainerAppRevisionAsync(string revisionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.ResourceManager.AppContainers.ContainerAppRevisionCollection GetContainerAppRevisions() { throw null; } + public virtual Azure.Response GetContainerAppsBuildResource(string buildName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetContainerAppsBuildResourceAsync(string buildName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.AppContainers.ContainerAppsBuildResourceCollection GetContainerAppsBuildResources() { throw null; } public virtual Azure.Response GetContainerAppSourceControl(string sourceControlName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> GetContainerAppSourceControlAsync(string sourceControlName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.ResourceManager.AppContainers.ContainerAppSourceControlCollection GetContainerAppSourceControls() { throw null; } + public virtual Azure.Response GetContainerAppsPatchResource(string patchName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetContainerAppsPatchResourceAsync(string patchName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.AppContainers.ContainerAppsPatchResourceCollection GetContainerAppsPatchResources() { throw null; } public virtual Azure.Response GetCustomHostNameAnalysis(string customHostname = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> GetCustomHostNameAnalysisAsync(string customHostname = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.AppContainers.LabelHistoryCollection GetLabelHistories() { throw null; } + public virtual Azure.Response GetLabelHistory(string labelName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetLabelHistoryAsync(string labelName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response GetLogicApp(string logicAppName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetLogicAppAsync(string logicAppName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.AppContainers.LogicAppCollection GetLogicApps() { throw null; } public virtual Azure.Pageable GetSecrets(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.AsyncPageable GetSecretsAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Response RemoveTag(string key, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } @@ -1094,6 +1410,7 @@ public ContainerAppRevisionData() { } public string Fqdn { get { throw null; } } public Azure.ResourceManager.AppContainers.Models.ContainerAppRevisionHealthState? HealthState { get { throw null; } } public bool? IsActive { get { throw null; } } + public System.Collections.Generic.IReadOnlyList Labels { get { throw null; } } public System.DateTimeOffset? LastActiveOn { get { throw null; } } public string ProvisioningError { get { throw null; } } public Azure.ResourceManager.AppContainers.Models.ContainerAppRevisionProvisioningState? ProvisioningState { get { throw null; } } @@ -1124,6 +1441,8 @@ protected ContainerAppRevisionResource() { } public virtual Azure.Response GetContainerAppReplica(string replicaName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> GetContainerAppReplicaAsync(string replicaName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.ResourceManager.AppContainers.ContainerAppReplicaCollection GetContainerAppReplicas() { throw null; } + public virtual Azure.Response InvokeFunctionsHostFunctionsExtension(string functionAppName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> InvokeFunctionsHostFunctionsExtensionAsync(string functionAppName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Response RestartRevision(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task RestartRevisionAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } Azure.ResourceManager.AppContainers.ContainerAppRevisionData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -1132,11 +1451,58 @@ protected ContainerAppRevisionResource() { } string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } + public partial class ContainerAppsBuildResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected ContainerAppsBuildResource() { } + public virtual Azure.ResourceManager.AppContainers.ContainerAppsBuildResourceData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string containerAppName, string buildName) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + Azure.ResourceManager.AppContainers.ContainerAppsBuildResourceData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.ContainerAppsBuildResourceData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ContainerAppsBuildResourceCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected ContainerAppsBuildResourceCollection() { } + public virtual Azure.Response Exists(string buildName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string buildName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string buildName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string buildName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string buildName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string buildName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } + System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } + } + public partial class ContainerAppsBuildResourceData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ContainerAppsBuildResourceData() { } + public Azure.ResourceManager.AppContainers.Models.ContainerAppBuildStatus? BuildStatus { get { throw null; } } + public Azure.ResourceManager.AppContainers.Models.ContainerAppsBuildConfiguration Configuration { get { throw null; } } + public Azure.ResourceManager.AppContainers.Models.ContainerRegistryWithCustomImage DestinationContainerRegistry { get { throw null; } } + public string LogStreamEndpoint { get { throw null; } } + public Azure.ResourceManager.AppContainers.Models.ContainerAppBuildProvisioningState? ProvisioningState { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.ContainerAppsBuildResourceData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.ContainerAppsBuildResourceData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } public partial class ContainerAppSourceControlCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable { protected ContainerAppSourceControlCollection() { } - public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string sourceControlName, Azure.ResourceManager.AppContainers.ContainerAppSourceControlData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string sourceControlName, Azure.ResourceManager.AppContainers.ContainerAppSourceControlData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string sourceControlName, Azure.ResourceManager.AppContainers.ContainerAppSourceControlData data, string xMsGitHubAuxiliary = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string sourceControlName, Azure.ResourceManager.AppContainers.ContainerAppSourceControlData data, string xMsGitHubAuxiliary = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Response Exists(string sourceControlName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> ExistsAsync(string sourceControlName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Response Get(string sourceControlName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } @@ -1170,8 +1536,8 @@ protected ContainerAppSourceControlResource() { } public virtual Azure.ResourceManager.AppContainers.ContainerAppSourceControlData Data { get { throw null; } } public virtual bool HasData { get { throw null; } } public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string containerAppName, string sourceControlName) { throw null; } - public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, string xMsGitHubAuxiliary = null, bool? ignoreWorkflowDeletionFailure = default(bool?), bool? deleteWorkflow = default(bool?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, string xMsGitHubAuxiliary = null, bool? ignoreWorkflowDeletionFailure = default(bool?), bool? deleteWorkflow = default(bool?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } Azure.ResourceManager.AppContainers.ContainerAppSourceControlData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -1179,8 +1545,253 @@ protected ContainerAppSourceControlResource() { } Azure.ResourceManager.AppContainers.ContainerAppSourceControlData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.AppContainers.ContainerAppSourceControlData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.AppContainers.ContainerAppSourceControlData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.AppContainers.ContainerAppSourceControlData data, string xMsGitHubAuxiliary = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.AppContainers.ContainerAppSourceControlData data, string xMsGitHubAuxiliary = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public partial class ContainerAppsPatchResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected ContainerAppsPatchResource() { } + public virtual Azure.ResourceManager.AppContainers.ContainerAppsPatchResourceData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public virtual Azure.ResourceManager.ArmOperation Apply(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ApplyAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string containerAppName, string patchName) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.ArmOperation SkipConfigure(Azure.WaitUntil waitUntil, Azure.ResourceManager.AppContainers.Models.PatchSkipConfig patchSkipConfig, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task SkipConfigureAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.AppContainers.Models.PatchSkipConfig patchSkipConfig, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + Azure.ResourceManager.AppContainers.ContainerAppsPatchResourceData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.ContainerAppsPatchResourceData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ContainerAppsPatchResourceCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected ContainerAppsPatchResourceCollection() { } + public virtual Azure.Response Exists(string patchName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string patchName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string patchName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(string filter = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(string filter = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string patchName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string patchName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string patchName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } + System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } + } + public partial class ContainerAppsPatchResourceData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ContainerAppsPatchResourceData() { } + public Azure.ResourceManager.AppContainers.Models.PatchProperties Properties { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.ContainerAppsPatchResourceData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.ContainerAppsPatchResourceData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DaprComponentResiliencyPolicyCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected DaprComponentResiliencyPolicyCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string name, Azure.ResourceManager.AppContainers.DaprComponentResiliencyPolicyData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string name, Azure.ResourceManager.AppContainers.DaprComponentResiliencyPolicyData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string name, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string name, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string name, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string name, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string name, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string name, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } + System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } + } + public partial class DaprComponentResiliencyPolicyData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DaprComponentResiliencyPolicyData() { } + public Azure.ResourceManager.AppContainers.Models.DaprComponentResiliencyPolicyConfiguration InboundPolicy { get { throw null; } set { } } + public Azure.ResourceManager.AppContainers.Models.DaprComponentResiliencyPolicyConfiguration OutboundPolicy { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.DaprComponentResiliencyPolicyData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.DaprComponentResiliencyPolicyData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DaprComponentResiliencyPolicyResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected DaprComponentResiliencyPolicyResource() { } + public virtual Azure.ResourceManager.AppContainers.DaprComponentResiliencyPolicyData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string environmentName, string componentName, string name) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + Azure.ResourceManager.AppContainers.DaprComponentResiliencyPolicyData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.DaprComponentResiliencyPolicyData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.AppContainers.DaprComponentResiliencyPolicyData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.AppContainers.DaprComponentResiliencyPolicyData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public partial class DaprSubscriptionCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected DaprSubscriptionCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string name, Azure.ResourceManager.AppContainers.DaprSubscriptionData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string name, Azure.ResourceManager.AppContainers.DaprSubscriptionData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string name, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string name, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string name, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string name, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string name, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string name, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } + System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } + } + public partial class DaprSubscriptionData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DaprSubscriptionData() { } + public Azure.ResourceManager.AppContainers.Models.DaprSubscriptionBulkSubscribeConfig BulkSubscribe { get { throw null; } set { } } + public string DeadLetterTopic { get { throw null; } set { } } + public System.Collections.Generic.IDictionary Metadata { get { throw null; } } + public string PubsubName { get { throw null; } set { } } + public Azure.ResourceManager.AppContainers.Models.DaprSubscriptionRoutes Routes { get { throw null; } set { } } + public System.Collections.Generic.IList Scopes { get { throw null; } } + public string Topic { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.DaprSubscriptionData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.DaprSubscriptionData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DaprSubscriptionResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected DaprSubscriptionResource() { } + public virtual Azure.ResourceManager.AppContainers.DaprSubscriptionData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string environmentName, string name) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + Azure.ResourceManager.AppContainers.DaprSubscriptionData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.DaprSubscriptionData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.AppContainers.DaprSubscriptionData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.AppContainers.DaprSubscriptionData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public partial class DotNetComponentCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected DotNetComponentCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string name, Azure.ResourceManager.AppContainers.DotNetComponentData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string name, Azure.ResourceManager.AppContainers.DotNetComponentData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string name, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string name, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string name, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string name, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string name, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string name, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } + System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } + } + public partial class DotNetComponentData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DotNetComponentData() { } + public Azure.ResourceManager.AppContainers.Models.DotNetComponentType? ComponentType { get { throw null; } set { } } + public System.Collections.Generic.IList Configurations { get { throw null; } } + public Azure.ResourceManager.AppContainers.Models.DotNetComponentProvisioningState? ProvisioningState { get { throw null; } } + public System.Collections.Generic.IList ServiceBinds { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.DotNetComponentData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.DotNetComponentData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DotNetComponentResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected DotNetComponentResource() { } + public virtual Azure.ResourceManager.AppContainers.DotNetComponentData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string environmentName, string name) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + Azure.ResourceManager.AppContainers.DotNetComponentData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.DotNetComponentData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.AppContainers.DotNetComponentData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.AppContainers.DotNetComponentData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public partial class HttpRouteConfigCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected HttpRouteConfigCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string httpRouteName, Azure.ResourceManager.AppContainers.HttpRouteConfigData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string httpRouteName, Azure.ResourceManager.AppContainers.HttpRouteConfigData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string httpRouteName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string httpRouteName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string httpRouteName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string httpRouteName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string httpRouteName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string httpRouteName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } + System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } + } + public partial class HttpRouteConfigData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public HttpRouteConfigData() { } + public Azure.ResourceManager.AppContainers.Models.HttpRouteConfigProperties Properties { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.HttpRouteConfigData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.HttpRouteConfigData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class HttpRouteConfigResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected HttpRouteConfigResource() { } + public virtual Azure.ResourceManager.AppContainers.HttpRouteConfigData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string environmentName, string httpRouteName) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + Azure.ResourceManager.AppContainers.HttpRouteConfigData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.HttpRouteConfigData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + public virtual Azure.Response Update(Azure.ResourceManager.AppContainers.HttpRouteConfigData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.ResourceManager.AppContainers.HttpRouteConfigData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } } public partial class JavaComponentCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable { @@ -1229,6 +1840,147 @@ protected JavaComponentResource() { } public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.AppContainers.JavaComponentData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.AppContainers.JavaComponentData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } } + public partial class LabelHistoryCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected LabelHistoryCollection() { } + public virtual Azure.Response Exists(string labelName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string labelName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string labelName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(string filter = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(string filter = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string labelName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string labelName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string labelName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } + System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } + } + public partial class LabelHistoryData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public LabelHistoryData() { } + public System.Collections.Generic.IReadOnlyList LabelHistoryRecords { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.LabelHistoryData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.LabelHistoryData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class LabelHistoryResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected LabelHistoryResource() { } + public virtual Azure.ResourceManager.AppContainers.LabelHistoryData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string containerAppName, string labelName) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + Azure.ResourceManager.AppContainers.LabelHistoryData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.LabelHistoryData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class LogicAppCollection : Azure.ResourceManager.ArmCollection + { + protected LogicAppCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string logicAppName, Azure.ResourceManager.AppContainers.LogicAppData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string logicAppName, Azure.ResourceManager.AppContainers.LogicAppData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string logicAppName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string logicAppName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string logicAppName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string logicAppName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string logicAppName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string logicAppName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public partial class LogicAppData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public LogicAppData() { } + public System.BinaryData Properties { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.LogicAppData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.LogicAppData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class LogicAppResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected LogicAppResource() { } + public virtual Azure.ResourceManager.AppContainers.LogicAppData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string containerAppName, string logicAppName) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response DeployWorkflowArtifacts(Azure.ResourceManager.AppContainers.Models.ContainerAppWorkflowArtifacts workflowArtifacts = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task DeployWorkflowArtifactsAsync(Azure.ResourceManager.AppContainers.Models.ContainerAppWorkflowArtifacts workflowArtifacts = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response GetWorkflowEnvelope(string workflowName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetWorkflowEnvelopeAsync(string workflowName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.AppContainers.WorkflowEnvelopeCollection GetWorkflowEnvelopes() { throw null; } + public virtual Azure.Response GetWorkflowsConnections(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetWorkflowsConnectionsAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Invoke(string xMsLogicAppsProxyPath, Azure.ResourceManager.AppContainers.Models.LogicAppsProxyMethod xMsLogicAppsProxyMethod, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> InvokeAsync(string xMsLogicAppsProxyPath, Azure.ResourceManager.AppContainers.Models.LogicAppsProxyMethod xMsLogicAppsProxyMethod, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + Azure.ResourceManager.AppContainers.LogicAppData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.LogicAppData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.AppContainers.LogicAppData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.AppContainers.LogicAppData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public partial class MaintenanceConfigurationResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected MaintenanceConfigurationResource() { } + public virtual Azure.ResourceManager.AppContainers.MaintenanceConfigurationResourceData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string environmentName, string configName) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + Azure.ResourceManager.AppContainers.MaintenanceConfigurationResourceData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.MaintenanceConfigurationResourceData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.AppContainers.MaintenanceConfigurationResourceData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.AppContainers.MaintenanceConfigurationResourceData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public partial class MaintenanceConfigurationResourceCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected MaintenanceConfigurationResourceCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string configName, Azure.ResourceManager.AppContainers.MaintenanceConfigurationResourceData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string configName, Azure.ResourceManager.AppContainers.MaintenanceConfigurationResourceData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string configName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string configName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string configName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string configName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string configName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string configName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } + System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } + } + public partial class MaintenanceConfigurationResourceData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public MaintenanceConfigurationResourceData() { } + public System.Collections.Generic.IList ScheduledEntries { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.MaintenanceConfigurationResourceData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.MaintenanceConfigurationResourceData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } public partial class SessionPoolCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable { protected SessionPoolCollection() { } @@ -1294,15 +2046,62 @@ protected SessionPoolResource() { } public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.AppContainers.Models.SessionPoolPatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.AppContainers.Models.SessionPoolPatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } } + public partial class WorkflowEnvelopeCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected WorkflowEnvelopeCollection() { } + public virtual Azure.Response Exists(string workflowName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string workflowName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string workflowName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string workflowName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string workflowName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string workflowName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } + System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } + } + public partial class WorkflowEnvelopeData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal WorkflowEnvelopeData() { } + public string Kind { get { throw null; } } + public Azure.Core.AzureLocation? Location { get { throw null; } } + public Azure.ResourceManager.AppContainers.Models.ContainerAppWorkflowEnvelopeProperties Properties { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.WorkflowEnvelopeData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.WorkflowEnvelopeData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class WorkflowEnvelopeResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected WorkflowEnvelopeResource() { } + public virtual Azure.ResourceManager.AppContainers.WorkflowEnvelopeData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string containerAppName, string logicAppName, string workflowName) { throw null; } + public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + Azure.ResourceManager.AppContainers.WorkflowEnvelopeData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.WorkflowEnvelopeData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } } namespace Azure.ResourceManager.AppContainers.Mocking { public partial class MockableAppContainersArmClient : Azure.ResourceManager.ArmResource { protected MockableAppContainersArmClient() { } + public virtual Azure.ResourceManager.AppContainers.AppContainersPrivateEndpointConnectionResource GetAppContainersPrivateEndpointConnectionResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.AppContainers.AppResiliencyResource GetAppResiliencyResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.AppContainers.BuilderResource GetBuilderResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.AppContainers.BuildResource GetBuildResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.AppContainers.ConnectedEnvironmentDaprComponentResource GetConnectedEnvironmentDaprComponentResource(Azure.Core.ResourceIdentifier id) { throw null; } public virtual Azure.ResourceManager.AppContainers.ContainerAppAuthConfigResource GetContainerAppAuthConfigResource(Azure.Core.ResourceIdentifier id) { throw null; } public virtual Azure.ResourceManager.AppContainers.ContainerAppConnectedEnvironmentCertificateResource GetContainerAppConnectedEnvironmentCertificateResource(Azure.Core.ResourceIdentifier id) { throw null; } - public virtual Azure.ResourceManager.AppContainers.ContainerAppConnectedEnvironmentDaprComponentResource GetContainerAppConnectedEnvironmentDaprComponentResource(Azure.Core.ResourceIdentifier id) { throw null; } public virtual Azure.ResourceManager.AppContainers.ContainerAppConnectedEnvironmentResource GetContainerAppConnectedEnvironmentResource(Azure.Core.ResourceIdentifier id) { throw null; } public virtual Azure.ResourceManager.AppContainers.ContainerAppConnectedEnvironmentStorageResource GetContainerAppConnectedEnvironmentStorageResource(Azure.Core.ResourceIdentifier id) { throw null; } public virtual Azure.ResourceManager.AppContainers.ContainerAppDetectorPropertyResource GetContainerAppDetectorPropertyResource(Azure.Core.ResourceIdentifier id) { throw null; } @@ -1322,13 +2121,26 @@ protected MockableAppContainersArmClient() { } public virtual Azure.ResourceManager.AppContainers.ContainerAppReplicaResource GetContainerAppReplicaResource(Azure.Core.ResourceIdentifier id) { throw null; } public virtual Azure.ResourceManager.AppContainers.ContainerAppResource GetContainerAppResource(Azure.Core.ResourceIdentifier id) { throw null; } public virtual Azure.ResourceManager.AppContainers.ContainerAppRevisionResource GetContainerAppRevisionResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.AppContainers.ContainerAppsBuildResource GetContainerAppsBuildResource(Azure.Core.ResourceIdentifier id) { throw null; } public virtual Azure.ResourceManager.AppContainers.ContainerAppSourceControlResource GetContainerAppSourceControlResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.AppContainers.ContainerAppsPatchResource GetContainerAppsPatchResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.AppContainers.DaprComponentResiliencyPolicyResource GetDaprComponentResiliencyPolicyResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.AppContainers.DaprSubscriptionResource GetDaprSubscriptionResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.AppContainers.DotNetComponentResource GetDotNetComponentResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.AppContainers.HttpRouteConfigResource GetHttpRouteConfigResource(Azure.Core.ResourceIdentifier id) { throw null; } public virtual Azure.ResourceManager.AppContainers.JavaComponentResource GetJavaComponentResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.AppContainers.LabelHistoryResource GetLabelHistoryResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.AppContainers.LogicAppResource GetLogicAppResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.AppContainers.MaintenanceConfigurationResource GetMaintenanceConfigurationResource(Azure.Core.ResourceIdentifier id) { throw null; } public virtual Azure.ResourceManager.AppContainers.SessionPoolResource GetSessionPoolResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.AppContainers.WorkflowEnvelopeResource GetWorkflowEnvelopeResource(Azure.Core.ResourceIdentifier id) { throw null; } } public partial class MockableAppContainersResourceGroupResource : Azure.ResourceManager.ArmResource { protected MockableAppContainersResourceGroupResource() { } + public virtual Azure.Response GetBuilderResource(string builderName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetBuilderResourceAsync(string builderName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.AppContainers.BuilderResourceCollection GetBuilderResources() { throw null; } public virtual Azure.Response GetContainerApp(string containerAppName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> GetContainerAppAsync(string containerAppName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Response GetContainerAppConnectedEnvironment(string connectedEnvironmentName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } @@ -1352,6 +2164,8 @@ protected MockableAppContainersSubscriptionResource() { } public virtual Azure.AsyncPageable GetAvailableWorkloadProfilesAsync(Azure.Core.AzureLocation location, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Pageable GetBillingMeters(Azure.Core.AzureLocation location, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.AsyncPageable GetBillingMetersAsync(Azure.Core.AzureLocation location, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetBuilderResources(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetBuilderResourcesAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Pageable GetContainerAppConnectedEnvironments(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.AsyncPageable GetContainerAppConnectedEnvironmentsAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Pageable GetContainerAppJobs(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } @@ -1393,6 +2207,7 @@ public partial class AppContainerResources : System.ClientModel.Primitives.IJson public AppContainerResources() { } public double? Cpu { get { throw null; } set { } } public string EphemeralStorage { get { throw null; } } + public double? Gpu { get { throw null; } set { } } public string Memory { get { throw null; } set { } } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.AppContainers.Models.AppContainerResources System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -1401,6 +2216,92 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct AppContainersKind : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public AppContainersKind(string value) { throw null; } + public static Azure.ResourceManager.AppContainers.Models.AppContainersKind Workflowapp { get { throw null; } } + public bool Equals(Azure.ResourceManager.AppContainers.Models.AppContainersKind other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.AppContainers.Models.AppContainersKind left, Azure.ResourceManager.AppContainers.Models.AppContainersKind right) { throw null; } + public static implicit operator Azure.ResourceManager.AppContainers.Models.AppContainersKind (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.AppContainers.Models.AppContainersKind left, Azure.ResourceManager.AppContainers.Models.AppContainersKind right) { throw null; } + public override string ToString() { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct AppContainersPrivateEndpointConnectionProvisioningState : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public AppContainersPrivateEndpointConnectionProvisioningState(string value) { throw null; } + public static Azure.ResourceManager.AppContainers.Models.AppContainersPrivateEndpointConnectionProvisioningState Canceled { get { throw null; } } + public static Azure.ResourceManager.AppContainers.Models.AppContainersPrivateEndpointConnectionProvisioningState Deleting { get { throw null; } } + public static Azure.ResourceManager.AppContainers.Models.AppContainersPrivateEndpointConnectionProvisioningState Failed { get { throw null; } } + public static Azure.ResourceManager.AppContainers.Models.AppContainersPrivateEndpointConnectionProvisioningState Pending { get { throw null; } } + public static Azure.ResourceManager.AppContainers.Models.AppContainersPrivateEndpointConnectionProvisioningState Succeeded { get { throw null; } } + public static Azure.ResourceManager.AppContainers.Models.AppContainersPrivateEndpointConnectionProvisioningState Updating { get { throw null; } } + public static Azure.ResourceManager.AppContainers.Models.AppContainersPrivateEndpointConnectionProvisioningState Waiting { get { throw null; } } + public bool Equals(Azure.ResourceManager.AppContainers.Models.AppContainersPrivateEndpointConnectionProvisioningState other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.AppContainers.Models.AppContainersPrivateEndpointConnectionProvisioningState left, Azure.ResourceManager.AppContainers.Models.AppContainersPrivateEndpointConnectionProvisioningState right) { throw null; } + public static implicit operator Azure.ResourceManager.AppContainers.Models.AppContainersPrivateEndpointConnectionProvisioningState (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.AppContainers.Models.AppContainersPrivateEndpointConnectionProvisioningState left, Azure.ResourceManager.AppContainers.Models.AppContainersPrivateEndpointConnectionProvisioningState right) { throw null; } + public override string ToString() { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct AppContainersPrivateEndpointServiceConnectionStatus : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public AppContainersPrivateEndpointServiceConnectionStatus(string value) { throw null; } + public static Azure.ResourceManager.AppContainers.Models.AppContainersPrivateEndpointServiceConnectionStatus Approved { get { throw null; } } + public static Azure.ResourceManager.AppContainers.Models.AppContainersPrivateEndpointServiceConnectionStatus Disconnected { get { throw null; } } + public static Azure.ResourceManager.AppContainers.Models.AppContainersPrivateEndpointServiceConnectionStatus Pending { get { throw null; } } + public static Azure.ResourceManager.AppContainers.Models.AppContainersPrivateEndpointServiceConnectionStatus Rejected { get { throw null; } } + public bool Equals(Azure.ResourceManager.AppContainers.Models.AppContainersPrivateEndpointServiceConnectionStatus other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.AppContainers.Models.AppContainersPrivateEndpointServiceConnectionStatus left, Azure.ResourceManager.AppContainers.Models.AppContainersPrivateEndpointServiceConnectionStatus right) { throw null; } + public static implicit operator Azure.ResourceManager.AppContainers.Models.AppContainersPrivateEndpointServiceConnectionStatus (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.AppContainers.Models.AppContainersPrivateEndpointServiceConnectionStatus left, Azure.ResourceManager.AppContainers.Models.AppContainersPrivateEndpointServiceConnectionStatus right) { throw null; } + public override string ToString() { throw null; } + } + public partial class AppContainersPrivateLinkResource : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public AppContainersPrivateLinkResource() { } + public string GroupId { get { throw null; } } + public System.Collections.Generic.IReadOnlyList RequiredMembers { get { throw null; } } + public System.Collections.Generic.IList RequiredZoneNames { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.Models.AppContainersPrivateLinkResource System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.Models.AppContainersPrivateLinkResource System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class AppContainersPrivateLinkServiceConnectionState : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public AppContainersPrivateLinkServiceConnectionState() { } + public string ActionsRequired { get { throw null; } set { } } + public string Description { get { throw null; } set { } } + public Azure.ResourceManager.AppContainers.Models.AppContainersPrivateEndpointServiceConnectionStatus? Status { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.Models.AppContainersPrivateLinkServiceConnectionState System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.Models.AppContainersPrivateLinkServiceConnectionState System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential, Size=1)] public readonly partial struct AppContainersSkuName : System.IEquatable @@ -1420,43 +2321,68 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer } public static partial class ArmAppContainersModelFactory { - public static Azure.ResourceManager.AppContainers.Models.AppContainerResources AppContainerResources(double? cpu = default(double?), string memory = null, string ephemeralStorage = null) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public static Azure.ResourceManager.AppContainers.Models.AppContainerResources AppContainerResources(double? cpu, string memory, string ephemeralStorage) { throw null; } + public static Azure.ResourceManager.AppContainers.Models.AppContainerResources AppContainerResources(double? cpu = default(double?), string memory = null, string ephemeralStorage = null, double? gpu = default(double?)) { throw null; } + public static Azure.ResourceManager.AppContainers.AppContainersPrivateEndpointConnectionData AppContainersPrivateEndpointConnectionData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IEnumerable groupIds = null, Azure.Core.ResourceIdentifier privateEndpointId = null, Azure.ResourceManager.AppContainers.Models.AppContainersPrivateLinkServiceConnectionState connectionState = null, Azure.ResourceManager.AppContainers.Models.AppContainersPrivateEndpointConnectionProvisioningState? provisioningState = default(Azure.ResourceManager.AppContainers.Models.AppContainersPrivateEndpointConnectionProvisioningState?)) { throw null; } + public static Azure.ResourceManager.AppContainers.Models.AppContainersPrivateLinkResource AppContainersPrivateLinkResource(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, string groupId = null, System.Collections.Generic.IEnumerable requiredMembers = null, System.Collections.Generic.IEnumerable requiredZoneNames = null) { throw null; } + public static Azure.ResourceManager.AppContainers.AppResiliencyData AppResiliencyData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.AppContainers.Models.ContainerAppTimeoutPolicy timeoutPolicy = null, Azure.ResourceManager.AppContainers.Models.HttpRetryPolicy httpRetryPolicy = null, int? tcpRetryMaxConnectAttempts = default(int?), Azure.ResourceManager.AppContainers.Models.CircuitBreakerPolicy circuitBreakerPolicy = null, Azure.ResourceManager.AppContainers.Models.HttpConnectionPool httpConnectionPool = null, int? maxConnections = default(int?)) { throw null; } + public static Azure.ResourceManager.AppContainers.BuilderResourceData BuilderResourceData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IDictionary tags = null, Azure.Core.AzureLocation location = default(Azure.Core.AzureLocation), Azure.ResourceManager.Models.ManagedServiceIdentity identity = null, Azure.ResourceManager.AppContainers.Models.ContainerAppBuilderProvisioningState? provisioningState = default(Azure.ResourceManager.AppContainers.Models.ContainerAppBuilderProvisioningState?), Azure.Core.ResourceIdentifier environmentId = null, System.Collections.Generic.IEnumerable containerRegistries = null) { throw null; } + public static Azure.ResourceManager.AppContainers.BuildResourceData BuildResourceData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.AppContainers.Models.ContainerAppBuildProvisioningState? provisioningState = default(Azure.ResourceManager.AppContainers.Models.ContainerAppBuildProvisioningState?), Azure.ResourceManager.AppContainers.Models.ContainerAppBuildStatus? buildStatus = default(Azure.ResourceManager.AppContainers.Models.ContainerAppBuildStatus?), Azure.ResourceManager.AppContainers.Models.ContainerRegistryWithCustomImage destinationContainerRegistry = null, Azure.ResourceManager.AppContainers.Models.ContainerAppBuildConfiguration configuration = null, string uploadEndpoint = null, string logStreamEndpoint = null, string tokenEndpoint = null) { throw null; } + public static Azure.ResourceManager.AppContainers.ConnectedEnvironmentDaprComponentData ConnectedEnvironmentDaprComponentData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, string componentType = null, string version = null, bool? ignoreErrors = default(bool?), string initTimeout = null, System.Collections.Generic.IEnumerable secrets = null, string secretStoreComponent = null, System.Collections.Generic.IEnumerable metadata = null, System.Collections.Generic.IEnumerable scopes = null, System.Collections.Generic.IEnumerable serviceComponentBind = null, Azure.ResourceManager.AppContainers.Models.ConnectedEnvironmentDaprComponentProvisioningState? provisioningState = default(Azure.ResourceManager.AppContainers.Models.ConnectedEnvironmentDaprComponentProvisioningState?), string deploymentErrors = null) { throw null; } + public static Azure.ResourceManager.AppContainers.Models.ConnectedEnvironmentStorageProperties ConnectedEnvironmentStorageProperties(Azure.ResourceManager.AppContainers.Models.ConnectedEnvironmentStorageProvisioningState? provisioningState = default(Azure.ResourceManager.AppContainers.Models.ConnectedEnvironmentStorageProvisioningState?), string deploymentErrors = null, Azure.ResourceManager.AppContainers.Models.ContainerAppAzureFileProperties azureFile = null, Azure.ResourceManager.AppContainers.Models.SmbStorage smb = null) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public static Azure.ResourceManager.AppContainers.ContainerAppAuthConfigData ContainerAppAuthConfigData(Azure.Core.ResourceIdentifier id, string name, Azure.Core.ResourceType resourceType, Azure.ResourceManager.Models.SystemData systemData, Azure.ResourceManager.AppContainers.Models.ContainerAppAuthPlatform platform, Azure.ResourceManager.AppContainers.Models.ContainerAppGlobalValidation globalValidation, Azure.ResourceManager.AppContainers.Models.ContainerAppIdentityProvidersConfiguration identityProviders, Azure.ResourceManager.AppContainers.Models.ContainerAppLogin login, Azure.ResourceManager.AppContainers.Models.ContainerAppHttpSettings httpSettings) { throw null; } public static Azure.ResourceManager.AppContainers.ContainerAppAuthConfigData ContainerAppAuthConfigData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.AppContainers.Models.ContainerAppAuthPlatform platform = null, Azure.ResourceManager.AppContainers.Models.ContainerAppGlobalValidation globalValidation = null, Azure.ResourceManager.AppContainers.Models.ContainerAppIdentityProvidersConfiguration identityProviders = null, Azure.ResourceManager.AppContainers.Models.ContainerAppLogin login = null, Azure.ResourceManager.AppContainers.Models.ContainerAppHttpSettings httpSettings = null, Azure.ResourceManager.AppContainers.Models.EncryptionSettings encryptionSettings = null) { throw null; } public static Azure.ResourceManager.AppContainers.Models.ContainerAppAuthToken ContainerAppAuthToken(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IDictionary tags = null, Azure.Core.AzureLocation location = default(Azure.Core.AzureLocation), string token = null, System.DateTimeOffset? expireOn = default(System.DateTimeOffset?)) { throw null; } public static Azure.ResourceManager.AppContainers.Models.ContainerAppAvailableWorkloadProfile ContainerAppAvailableWorkloadProfile(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.Core.AzureLocation? location = default(Azure.Core.AzureLocation?), Azure.ResourceManager.AppContainers.Models.ContainerAppAvailableWorkloadProfileProperties properties = null) { throw null; } public static Azure.ResourceManager.AppContainers.Models.ContainerAppBillingMeter ContainerAppBillingMeter(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.Core.AzureLocation? location = default(Azure.Core.AzureLocation?), Azure.ResourceManager.AppContainers.Models.ContainerAppBillingMeterProperties properties = null) { throw null; } + public static Azure.ResourceManager.AppContainers.Models.ContainerAppBillingMeterProperties ContainerAppBillingMeterProperties(string workloadProfileCategory = null, string meterType = null, string displayName = null) { throw null; } + public static Azure.ResourceManager.AppContainers.Models.ContainerAppBuildToken ContainerAppBuildToken(string token = null, System.DateTimeOffset? expires = default(System.DateTimeOffset?)) { throw null; } public static Azure.ResourceManager.AppContainers.ContainerAppCertificateData ContainerAppCertificateData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IDictionary tags = null, Azure.Core.AzureLocation location = default(Azure.Core.AzureLocation), Azure.ResourceManager.AppContainers.Models.ContainerAppCertificateProperties properties = null) { throw null; } - public static Azure.ResourceManager.AppContainers.Models.ContainerAppCertificateProperties ContainerAppCertificateProperties(Azure.ResourceManager.AppContainers.Models.ContainerAppCertificateProvisioningState? provisioningState = default(Azure.ResourceManager.AppContainers.Models.ContainerAppCertificateProvisioningState?), Azure.ResourceManager.AppContainers.Models.ContainerAppCertificateKeyVaultProperties certificateKeyVaultProperties = null, string password = null, string subjectName = null, System.Collections.Generic.IEnumerable subjectAlternativeNames = null, byte[] value = null, string issuer = null, System.DateTimeOffset? issueOn = default(System.DateTimeOffset?), System.DateTimeOffset? expireOn = default(System.DateTimeOffset?), string thumbprint = null, bool? isValid = default(bool?), string publicKeyHash = null) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public static Azure.ResourceManager.AppContainers.Models.ContainerAppCertificateProperties ContainerAppCertificateProperties(Azure.ResourceManager.AppContainers.Models.ContainerAppCertificateProvisioningState? provisioningState, Azure.ResourceManager.AppContainers.Models.ContainerAppCertificateKeyVaultProperties certificateKeyVaultProperties, string password, string subjectName, System.Collections.Generic.IEnumerable subjectAlternativeNames, byte[] value, string issuer, System.DateTimeOffset? issueOn, System.DateTimeOffset? expireOn, string thumbprint, bool? isValid, string publicKeyHash) { throw null; } + public static Azure.ResourceManager.AppContainers.Models.ContainerAppCertificateProperties ContainerAppCertificateProperties(Azure.ResourceManager.AppContainers.Models.ContainerAppCertificateProvisioningState? provisioningState = default(Azure.ResourceManager.AppContainers.Models.ContainerAppCertificateProvisioningState?), string deploymentErrors = null, Azure.ResourceManager.AppContainers.Models.ContainerAppCertificateKeyVaultProperties certificateKeyVaultProperties = null, string password = null, string subjectName = null, System.Collections.Generic.IEnumerable subjectAlternativeNames = null, byte[] value = null, string issuer = null, System.DateTimeOffset? issueOn = default(System.DateTimeOffset?), System.DateTimeOffset? expireOn = default(System.DateTimeOffset?), string thumbprint = null, bool? isValid = default(bool?), string publicKeyHash = null, Azure.ResourceManager.AppContainers.Models.ContainerAppCertificateType? certificateType = default(Azure.ResourceManager.AppContainers.Models.ContainerAppCertificateType?)) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public static Azure.ResourceManager.AppContainers.Models.ContainerAppCertificateProperties ContainerAppCertificateProperties(Azure.ResourceManager.AppContainers.Models.ContainerAppCertificateProvisioningState? provisioningState, string password, string subjectName, System.Collections.Generic.IEnumerable subjectAlternativeNames, byte[] value, string issuer, System.DateTimeOffset? issueOn, System.DateTimeOffset? expireOn, string thumbprint, bool? isValid, string publicKeyHash) { throw null; } public static Azure.ResourceManager.AppContainers.ContainerAppConnectedEnvironmentData ContainerAppConnectedEnvironmentData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IDictionary tags = null, Azure.Core.AzureLocation location = default(Azure.Core.AzureLocation), Azure.ResourceManager.AppContainers.Models.ContainerAppExtendedLocation extendedLocation = null, Azure.ResourceManager.AppContainers.Models.ContainerAppConnectedEnvironmentProvisioningState? provisioningState = default(Azure.ResourceManager.AppContainers.Models.ContainerAppConnectedEnvironmentProvisioningState?), string deploymentErrors = null, string defaultDomain = null, System.Net.IPAddress staticIP = null, string daprAIConnectionString = null, Azure.ResourceManager.AppContainers.Models.ContainerAppCustomDomainConfiguration customDomainConfiguration = null) { throw null; } - public static Azure.ResourceManager.AppContainers.ContainerAppConnectedEnvironmentStorageData ContainerAppConnectedEnvironmentStorageData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.AppContainers.Models.ContainerAppAzureFileProperties connectedEnvironmentStorageAzureFile = null) { throw null; } + public static Azure.ResourceManager.AppContainers.ContainerAppConnectedEnvironmentStorageData ContainerAppConnectedEnvironmentStorageData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.AppContainers.Models.ConnectedEnvironmentStorageProperties properties = null) { throw null; } public static Azure.ResourceManager.AppContainers.Models.ContainerAppCustomDomainConfiguration ContainerAppCustomDomainConfiguration(string customDomainVerificationId = null, string dnsSuffix = null, Azure.ResourceManager.AppContainers.Models.ContainerAppCertificateKeyVaultProperties certificateKeyVaultProperties = null, byte[] certificateValue = null, string certificatePassword = null, System.DateTimeOffset? expireOn = default(System.DateTimeOffset?), string thumbprint = null, string subjectName = null) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public static Azure.ResourceManager.AppContainers.Models.ContainerAppCustomDomainConfiguration ContainerAppCustomDomainConfiguration(string customDomainVerificationId, string dnsSuffix, byte[] certificateValue, string certificatePassword, System.DateTimeOffset? expireOn, string thumbprint, string subjectName) { throw null; } public static Azure.ResourceManager.AppContainers.Models.ContainerAppCustomDomainVerificationFailureInfo ContainerAppCustomDomainVerificationFailureInfo(string code = null, string message = null, string target = null, System.Collections.Generic.IEnumerable details = null) { throw null; } public static Azure.ResourceManager.AppContainers.Models.ContainerAppCustomDomainVerificationFailureInfoDetailsItem ContainerAppCustomDomainVerificationFailureInfoDetailsItem(string code = null, string message = null, string target = null) { throw null; } public static Azure.ResourceManager.AppContainers.Models.ContainerAppCustomHostnameAnalysisResult ContainerAppCustomHostnameAnalysisResult(string hostName = null, bool? isHostnameAlreadyVerified = default(bool?), Azure.ResourceManager.AppContainers.Models.ContainerAppDnsVerificationTestResult? customDomainVerificationTest = default(Azure.ResourceManager.AppContainers.Models.ContainerAppDnsVerificationTestResult?), Azure.ResourceManager.AppContainers.Models.ContainerAppCustomDomainVerificationFailureInfo customDomainVerificationFailureInfo = null, bool? hasConflictOnManagedEnvironment = default(bool?), bool? conflictWithEnvironmentCustomDomain = default(bool?), string conflictingContainerAppResourceId = null, System.Collections.Generic.IEnumerable cNameRecords = null, System.Collections.Generic.IEnumerable txtRecords = null, System.Collections.Generic.IEnumerable aRecords = null, System.Collections.Generic.IEnumerable alternateCNameRecords = null, System.Collections.Generic.IEnumerable alternateTxtRecords = null) { throw null; } - public static Azure.ResourceManager.AppContainers.ContainerAppDaprComponentData ContainerAppDaprComponentData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, string componentType = null, string version = null, bool? ignoreErrors = default(bool?), string initTimeout = null, System.Collections.Generic.IEnumerable secrets = null, string secretStoreComponent = null, System.Collections.Generic.IEnumerable metadata = null, System.Collections.Generic.IEnumerable scopes = null) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public static Azure.ResourceManager.AppContainers.ContainerAppDaprComponentData ContainerAppDaprComponentData(Azure.Core.ResourceIdentifier id, string name, Azure.Core.ResourceType resourceType, Azure.ResourceManager.Models.SystemData systemData, string componentType, string version, bool? ignoreErrors, string initTimeout, System.Collections.Generic.IEnumerable secrets, string secretStoreComponent, System.Collections.Generic.IEnumerable metadata, System.Collections.Generic.IEnumerable scopes) { throw null; } + public static Azure.ResourceManager.AppContainers.ContainerAppDaprComponentData ContainerAppDaprComponentData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, string componentType = null, string version = null, bool? ignoreErrors = default(bool?), string initTimeout = null, System.Collections.Generic.IEnumerable secrets = null, string secretStoreComponent = null, System.Collections.Generic.IEnumerable metadata = null, System.Collections.Generic.IEnumerable scopes = null, System.Collections.Generic.IEnumerable serviceComponentBind = null) { throw null; } public static Azure.ResourceManager.AppContainers.Models.ContainerAppDaprSecret ContainerAppDaprSecret(string name = null, string value = null) { throw null; } + public static Azure.ResourceManager.AppContainers.ContainerAppData ContainerAppData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IDictionary tags = null, Azure.Core.AzureLocation location = default(Azure.Core.AzureLocation), Azure.ResourceManager.AppContainers.Models.ContainerAppExtendedLocation extendedLocation = null, Azure.ResourceManager.Models.ManagedServiceIdentity identity = null, string managedBy = null, Azure.ResourceManager.AppContainers.Models.AppContainersKind? kind = default(Azure.ResourceManager.AppContainers.Models.AppContainersKind?), Azure.ResourceManager.AppContainers.Models.ContainerAppProvisioningState? provisioningState = default(Azure.ResourceManager.AppContainers.Models.ContainerAppProvisioningState?), Azure.ResourceManager.AppContainers.Models.ContainerAppRunningStatus? runningStatus = default(Azure.ResourceManager.AppContainers.Models.ContainerAppRunningStatus?), string deploymentErrors = null, Azure.Core.ResourceIdentifier managedEnvironmentId = null, Azure.Core.ResourceIdentifier environmentId = null, string workloadProfileName = null, Azure.ResourceManager.AppContainers.Models.PatchingMode? patchingMode = default(Azure.ResourceManager.AppContainers.Models.PatchingMode?), string latestRevisionName = null, string latestReadyRevisionName = null, string latestRevisionFqdn = null, string customDomainVerificationId = null, Azure.ResourceManager.AppContainers.Models.ContainerAppConfiguration configuration = null, Azure.ResourceManager.AppContainers.Models.ContainerAppTemplate template = null, System.Collections.Generic.IEnumerable outboundIPAddressList = null, System.Uri eventStreamEndpoint = null) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public static Azure.ResourceManager.AppContainers.ContainerAppData ContainerAppData(Azure.Core.ResourceIdentifier id, string name, Azure.Core.ResourceType resourceType, Azure.ResourceManager.Models.SystemData systemData, System.Collections.Generic.IDictionary tags, Azure.Core.AzureLocation location, Azure.ResourceManager.AppContainers.Models.ContainerAppExtendedLocation extendedLocation, Azure.ResourceManager.Models.ManagedServiceIdentity identity, string managedBy, Azure.ResourceManager.AppContainers.Models.ContainerAppProvisioningState? provisioningState, Azure.Core.ResourceIdentifier managedEnvironmentId, Azure.Core.ResourceIdentifier environmentId, string workloadProfileName, string latestRevisionName, string latestReadyRevisionName, string latestRevisionFqdn, string customDomainVerificationId, Azure.ResourceManager.AppContainers.Models.ContainerAppConfiguration configuration, Azure.ResourceManager.AppContainers.Models.ContainerAppTemplate template, System.Collections.Generic.IEnumerable outboundIPAddressList, System.Uri eventStreamEndpoint) { throw null; } - public static Azure.ResourceManager.AppContainers.ContainerAppData ContainerAppData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IDictionary tags = null, Azure.Core.AzureLocation location = default(Azure.Core.AzureLocation), Azure.ResourceManager.AppContainers.Models.ContainerAppExtendedLocation extendedLocation = null, Azure.ResourceManager.Models.ManagedServiceIdentity identity = null, string managedBy = null, Azure.ResourceManager.AppContainers.Models.ContainerAppProvisioningState? provisioningState = default(Azure.ResourceManager.AppContainers.Models.ContainerAppProvisioningState?), Azure.ResourceManager.AppContainers.Models.ContainerAppRunningStatus? runningStatus = default(Azure.ResourceManager.AppContainers.Models.ContainerAppRunningStatus?), Azure.Core.ResourceIdentifier managedEnvironmentId = null, Azure.Core.ResourceIdentifier environmentId = null, string workloadProfileName = null, string latestRevisionName = null, string latestReadyRevisionName = null, string latestRevisionFqdn = null, string customDomainVerificationId = null, Azure.ResourceManager.AppContainers.Models.ContainerAppConfiguration configuration = null, Azure.ResourceManager.AppContainers.Models.ContainerAppTemplate template = null, System.Collections.Generic.IEnumerable outboundIPAddressList = null, System.Uri eventStreamEndpoint = null) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public static Azure.ResourceManager.AppContainers.ContainerAppData ContainerAppData(Azure.Core.ResourceIdentifier id, string name, Azure.Core.ResourceType resourceType, Azure.ResourceManager.Models.SystemData systemData, System.Collections.Generic.IDictionary tags, Azure.Core.AzureLocation location, Azure.ResourceManager.AppContainers.Models.ContainerAppExtendedLocation extendedLocation, Azure.ResourceManager.Models.ManagedServiceIdentity identity, string managedBy, Azure.ResourceManager.AppContainers.Models.ContainerAppProvisioningState? provisioningState, Azure.ResourceManager.AppContainers.Models.ContainerAppRunningStatus? runningStatus, Azure.Core.ResourceIdentifier managedEnvironmentId, Azure.Core.ResourceIdentifier environmentId, string workloadProfileName, string latestRevisionName, string latestReadyRevisionName, string latestRevisionFqdn, string customDomainVerificationId, Azure.ResourceManager.AppContainers.Models.ContainerAppConfiguration configuration, Azure.ResourceManager.AppContainers.Models.ContainerAppTemplate template, System.Collections.Generic.IEnumerable outboundIPAddressList, System.Uri eventStreamEndpoint) { throw null; } public static Azure.ResourceManager.AppContainers.ContainerAppDiagnosticData ContainerAppDiagnosticData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.AppContainers.Models.ContainerAppDiagnosticsProperties properties = null) { throw null; } public static Azure.ResourceManager.AppContainers.Models.ContainerAppDiagnosticsMetadata ContainerAppDiagnosticsMetadata(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, string description = null, string author = null, string category = null, System.Collections.Generic.IEnumerable supportTopicList = null, System.Collections.Generic.IEnumerable analysisTypes = null, float? score = default(float?)) { throw null; } public static Azure.ResourceManager.AppContainers.Models.ContainerAppDiagnosticSupportTopic ContainerAppDiagnosticSupportTopic(string id = null, string pesId = null) { throw null; } public static Azure.ResourceManager.AppContainers.Models.ContainerAppEnvironmentAuthToken ContainerAppEnvironmentAuthToken(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IDictionary tags = null, Azure.Core.AzureLocation location = default(Azure.Core.AzureLocation), string token = null, System.DateTimeOffset? expireOn = default(System.DateTimeOffset?)) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public static Azure.ResourceManager.AppContainers.Models.ContainerAppIngressConfiguration ContainerAppIngressConfiguration(string fqdn, bool? external, int? targetPort, int? exposedPort, Azure.ResourceManager.AppContainers.Models.ContainerAppIngressTransportMethod? transport, System.Collections.Generic.IEnumerable traffic, System.Collections.Generic.IEnumerable customDomains, bool? allowInsecure, System.Collections.Generic.IEnumerable ipSecurityRestrictions, Azure.ResourceManager.AppContainers.Models.Affinity? stickySessionsAffinity, Azure.ResourceManager.AppContainers.Models.ContainerAppIngressClientCertificateMode? clientCertificateMode, Azure.ResourceManager.AppContainers.Models.ContainerAppCorsPolicy corsPolicy) { throw null; } - public static Azure.ResourceManager.AppContainers.Models.ContainerAppIngressConfiguration ContainerAppIngressConfiguration(string fqdn = null, bool? external = default(bool?), int? targetPort = default(int?), int? exposedPort = default(int?), Azure.ResourceManager.AppContainers.Models.ContainerAppIngressTransportMethod? transport = default(Azure.ResourceManager.AppContainers.Models.ContainerAppIngressTransportMethod?), System.Collections.Generic.IEnumerable traffic = null, System.Collections.Generic.IEnumerable customDomains = null, bool? allowInsecure = default(bool?), System.Collections.Generic.IEnumerable ipSecurityRestrictions = null, Azure.ResourceManager.AppContainers.Models.Affinity? stickySessionsAffinity = default(Azure.ResourceManager.AppContainers.Models.Affinity?), Azure.ResourceManager.AppContainers.Models.ContainerAppIngressClientCertificateMode? clientCertificateMode = default(Azure.ResourceManager.AppContainers.Models.ContainerAppIngressClientCertificateMode?), Azure.ResourceManager.AppContainers.Models.ContainerAppCorsPolicy corsPolicy = null, System.Collections.Generic.IEnumerable additionalPortMappings = null) { throw null; } - public static Azure.ResourceManager.AppContainers.ContainerAppJobData ContainerAppJobData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IDictionary tags = null, Azure.Core.AzureLocation location = default(Azure.Core.AzureLocation), Azure.ResourceManager.Models.ManagedServiceIdentity identity = null, Azure.ResourceManager.AppContainers.Models.ContainerAppJobProvisioningState? provisioningState = default(Azure.ResourceManager.AppContainers.Models.ContainerAppJobProvisioningState?), string environmentId = null, string workloadProfileName = null, Azure.ResourceManager.AppContainers.Models.ContainerAppJobConfiguration configuration = null, Azure.ResourceManager.AppContainers.Models.ContainerAppJobTemplate template = null, System.Collections.Generic.IEnumerable outboundIPAddresses = null, string eventStreamEndpoint = null) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public static Azure.ResourceManager.AppContainers.Models.ContainerAppIngressConfiguration ContainerAppIngressConfiguration(string fqdn, bool? external, int? targetPort, int? exposedPort, Azure.ResourceManager.AppContainers.Models.ContainerAppIngressTransportMethod? transport, System.Collections.Generic.IEnumerable traffic, System.Collections.Generic.IEnumerable customDomains, bool? allowInsecure, System.Collections.Generic.IEnumerable ipSecurityRestrictions, Azure.ResourceManager.AppContainers.Models.Affinity? stickySessionsAffinity, Azure.ResourceManager.AppContainers.Models.ContainerAppIngressClientCertificateMode? clientCertificateMode, Azure.ResourceManager.AppContainers.Models.ContainerAppCorsPolicy corsPolicy, System.Collections.Generic.IEnumerable additionalPortMappings) { throw null; } + public static Azure.ResourceManager.AppContainers.Models.ContainerAppIngressConfiguration ContainerAppIngressConfiguration(string fqdn = null, bool? external = default(bool?), int? targetPort = default(int?), int? exposedPort = default(int?), Azure.ResourceManager.AppContainers.Models.ContainerAppIngressTransportMethod? transport = default(Azure.ResourceManager.AppContainers.Models.ContainerAppIngressTransportMethod?), System.Collections.Generic.IEnumerable traffic = null, System.Collections.Generic.IEnumerable customDomains = null, bool? allowInsecure = default(bool?), System.Collections.Generic.IEnumerable ipSecurityRestrictions = null, Azure.ResourceManager.AppContainers.Models.Affinity? stickySessionsAffinity = default(Azure.ResourceManager.AppContainers.Models.Affinity?), Azure.ResourceManager.AppContainers.Models.ContainerAppIngressClientCertificateMode? clientCertificateMode = default(Azure.ResourceManager.AppContainers.Models.ContainerAppIngressClientCertificateMode?), Azure.ResourceManager.AppContainers.Models.ContainerAppCorsPolicy corsPolicy = null, System.Collections.Generic.IEnumerable additionalPortMappings = null, Azure.ResourceManager.AppContainers.Models.IngressTargetPortHttpScheme? targetPortHttpScheme = default(Azure.ResourceManager.AppContainers.Models.IngressTargetPortHttpScheme?)) { throw null; } + public static Azure.ResourceManager.AppContainers.ContainerAppJobData ContainerAppJobData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IDictionary tags = null, Azure.Core.AzureLocation location = default(Azure.Core.AzureLocation), Azure.ResourceManager.AppContainers.Models.ContainerAppExtendedLocation extendedLocation = null, Azure.ResourceManager.Models.ManagedServiceIdentity identity = null, Azure.ResourceManager.AppContainers.Models.ContainerAppJobProvisioningState? provisioningState = default(Azure.ResourceManager.AppContainers.Models.ContainerAppJobProvisioningState?), Azure.ResourceManager.AppContainers.Models.ContainerAppJobRunningState? runningState = default(Azure.ResourceManager.AppContainers.Models.ContainerAppJobRunningState?), string environmentId = null, string workloadProfileName = null, Azure.ResourceManager.AppContainers.Models.ContainerAppJobConfiguration configuration = null, Azure.ResourceManager.AppContainers.Models.ContainerAppJobTemplate template = null, System.Collections.Generic.IEnumerable outboundIPAddresses = null, string eventStreamEndpoint = null) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public static Azure.ResourceManager.AppContainers.ContainerAppJobData ContainerAppJobData(Azure.Core.ResourceIdentifier id, string name, Azure.Core.ResourceType resourceType, Azure.ResourceManager.Models.SystemData systemData, System.Collections.Generic.IDictionary tags, Azure.Core.AzureLocation location, Azure.ResourceManager.Models.ManagedServiceIdentity identity, Azure.ResourceManager.AppContainers.Models.ContainerAppJobProvisioningState? provisioningState, string environmentId, string workloadProfileName, Azure.ResourceManager.AppContainers.Models.ContainerAppJobConfiguration configuration, Azure.ResourceManager.AppContainers.Models.ContainerAppJobTemplate template, System.Collections.Generic.IEnumerable outboundIPAddresses, string eventStreamEndpoint) { throw null; } public static Azure.ResourceManager.AppContainers.Models.ContainerAppJobExecutionBase ContainerAppJobExecutionBase(string name = null, string id = null) { throw null; } - public static Azure.ResourceManager.AppContainers.ContainerAppJobExecutionData ContainerAppJobExecutionData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.AppContainers.Models.JobExecutionRunningState? status = default(Azure.ResourceManager.AppContainers.Models.JobExecutionRunningState?), System.DateTimeOffset? startOn = default(System.DateTimeOffset?), System.DateTimeOffset? endOn = default(System.DateTimeOffset?), Azure.ResourceManager.AppContainers.Models.ContainerAppJobExecutionTemplate template = null) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public static Azure.ResourceManager.AppContainers.ContainerAppJobExecutionData ContainerAppJobExecutionData(Azure.Core.ResourceIdentifier id, string name, Azure.Core.ResourceType resourceType, Azure.ResourceManager.Models.SystemData systemData, Azure.ResourceManager.AppContainers.Models.JobExecutionRunningState? status, System.DateTimeOffset? startOn, System.DateTimeOffset? endOn, Azure.ResourceManager.AppContainers.Models.ContainerAppJobExecutionTemplate template) { throw null; } + public static Azure.ResourceManager.AppContainers.ContainerAppJobExecutionData ContainerAppJobExecutionData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.AppContainers.Models.JobExecutionRunningState? status = default(Azure.ResourceManager.AppContainers.Models.JobExecutionRunningState?), System.DateTimeOffset? startOn = default(System.DateTimeOffset?), System.DateTimeOffset? endOn = default(System.DateTimeOffset?), Azure.ResourceManager.AppContainers.Models.ContainerAppJobExecutionTemplate template = null, System.Collections.Generic.IEnumerable detailedStatusReplicas = null) { throw null; } public static Azure.ResourceManager.AppContainers.Models.ContainerAppJobExecutions ContainerAppJobExecutions(System.Collections.Generic.IEnumerable value = null, string nextLink = null) { throw null; } public static Azure.ResourceManager.AppContainers.ContainerAppManagedCertificateData ContainerAppManagedCertificateData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IDictionary tags = null, Azure.Core.AzureLocation location = default(Azure.Core.AzureLocation), Azure.ResourceManager.AppContainers.Models.ManagedCertificateProperties properties = null) { throw null; } - public static Azure.ResourceManager.AppContainers.ContainerAppManagedEnvironmentData ContainerAppManagedEnvironmentData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IDictionary tags = null, Azure.Core.AzureLocation location = default(Azure.Core.AzureLocation), string kind = null, Azure.ResourceManager.Models.ManagedServiceIdentity identity = null, Azure.ResourceManager.AppContainers.Models.ContainerAppEnvironmentProvisioningState? provisioningState = default(Azure.ResourceManager.AppContainers.Models.ContainerAppEnvironmentProvisioningState?), string daprAIInstrumentationKey = null, string daprAIConnectionString = null, Azure.ResourceManager.AppContainers.Models.ContainerAppVnetConfiguration vnetConfiguration = null, string deploymentErrors = null, string defaultDomain = null, System.Net.IPAddress staticIP = null, Azure.ResourceManager.AppContainers.Models.ContainerAppLogsConfiguration appLogsConfiguration = null, bool? isZoneRedundant = default(bool?), Azure.ResourceManager.AppContainers.Models.ContainerAppCustomDomainConfiguration customDomainConfiguration = null, string eventStreamEndpoint = null, System.Collections.Generic.IEnumerable workloadProfiles = null, string kedaVersion = null, string daprVersion = null, string infrastructureResourceGroup = null, bool? isMtlsEnabled = default(bool?), bool? isEnabled = default(bool?)) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public static Azure.ResourceManager.AppContainers.ContainerAppManagedEnvironmentData ContainerAppManagedEnvironmentData(Azure.Core.ResourceIdentifier id, string name, Azure.Core.ResourceType resourceType, Azure.ResourceManager.Models.SystemData systemData, System.Collections.Generic.IDictionary tags, Azure.Core.AzureLocation location, string kind, Azure.ResourceManager.Models.ManagedServiceIdentity identity, Azure.ResourceManager.AppContainers.Models.ContainerAppEnvironmentProvisioningState? provisioningState, string daprAIInstrumentationKey, string daprAIConnectionString, Azure.ResourceManager.AppContainers.Models.ContainerAppVnetConfiguration vnetConfiguration, string deploymentErrors, string defaultDomain, System.Net.IPAddress staticIP, Azure.ResourceManager.AppContainers.Models.ContainerAppLogsConfiguration appLogsConfiguration, bool? isZoneRedundant, Azure.ResourceManager.AppContainers.Models.ContainerAppCustomDomainConfiguration customDomainConfiguration, string eventStreamEndpoint, System.Collections.Generic.IEnumerable workloadProfiles, string kedaVersion, string daprVersion, string infrastructureResourceGroup, bool? isMtlsEnabled, bool? isEnabled) { throw null; } + public static Azure.ResourceManager.AppContainers.ContainerAppManagedEnvironmentData ContainerAppManagedEnvironmentData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IDictionary tags = null, Azure.Core.AzureLocation location = default(Azure.Core.AzureLocation), string kind = null, Azure.ResourceManager.Models.ManagedServiceIdentity identity = null, Azure.ResourceManager.AppContainers.Models.ContainerAppEnvironmentProvisioningState? provisioningState = default(Azure.ResourceManager.AppContainers.Models.ContainerAppEnvironmentProvisioningState?), string daprAIInstrumentationKey = null, string daprAIConnectionString = null, Azure.ResourceManager.AppContainers.Models.ContainerAppVnetConfiguration vnetConfiguration = null, string deploymentErrors = null, string defaultDomain = null, string privateLinkDefaultDomain = null, System.Net.IPAddress staticIP = null, Azure.ResourceManager.AppContainers.Models.ContainerAppLogsConfiguration appLogsConfiguration = null, string appInsightsConnectionString = null, Azure.ResourceManager.AppContainers.Models.OpenTelemetryConfiguration openTelemetryConfiguration = null, bool? isZoneRedundant = default(bool?), System.Collections.Generic.IEnumerable availabilityZones = null, Azure.ResourceManager.AppContainers.Models.ContainerAppCustomDomainConfiguration customDomainConfiguration = null, string eventStreamEndpoint = null, System.Collections.Generic.IEnumerable workloadProfiles = null, string kedaVersion = null, string daprVersion = null, string infrastructureResourceGroup = null, bool? isMtlsEnabled = default(bool?), bool? isEnabled = default(bool?), Azure.ResourceManager.AppContainers.Models.IngressConfiguration ingressConfiguration = null, System.Collections.Generic.IEnumerable privateEndpointConnections = null, Azure.ResourceManager.AppContainers.Models.PublicNetworkAccess? publicNetworkAccess = default(Azure.ResourceManager.AppContainers.Models.PublicNetworkAccess?), Azure.ResourceManager.AppContainers.Models.DiskEncryptionConfigurationKeyVaultConfiguration diskEncryptionKeyVaultConfiguration = null) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public static Azure.ResourceManager.AppContainers.ContainerAppManagedEnvironmentData ContainerAppManagedEnvironmentData(Azure.Core.ResourceIdentifier id, string name, Azure.Core.ResourceType resourceType, Azure.ResourceManager.Models.SystemData systemData, System.Collections.Generic.IDictionary tags, Azure.Core.AzureLocation location, string kind, Azure.ResourceManager.AppContainers.Models.ContainerAppEnvironmentProvisioningState? provisioningState, string daprAIInstrumentationKey, string daprAIConnectionString, Azure.ResourceManager.AppContainers.Models.ContainerAppVnetConfiguration vnetConfiguration, string deploymentErrors, string defaultDomain, System.Net.IPAddress staticIP, Azure.ResourceManager.AppContainers.Models.ContainerAppLogsConfiguration appLogsConfiguration, bool? isZoneRedundant, Azure.ResourceManager.AppContainers.Models.ContainerAppCustomDomainConfiguration customDomainConfiguration, string eventStreamEndpoint, System.Collections.Generic.IEnumerable workloadProfiles, string kedaVersion, string daprVersion, string infrastructureResourceGroup, bool? isMtlsEnabled) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] @@ -1465,28 +2391,138 @@ public static partial class ArmAppContainersModelFactory public static Azure.ResourceManager.AppContainers.ContainerAppManagedEnvironmentStorageData ContainerAppManagedEnvironmentStorageData(Azure.Core.ResourceIdentifier id, string name, Azure.Core.ResourceType resourceType, Azure.ResourceManager.Models.SystemData systemData, Azure.ResourceManager.AppContainers.Models.ContainerAppAzureFileProperties managedEnvironmentStorageAzureFile = null) { throw null; } public static Azure.ResourceManager.AppContainers.ContainerAppManagedEnvironmentStorageData ContainerAppManagedEnvironmentStorageData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.AppContainers.Models.ManagedEnvironmentStorageProperties properties = null) { throw null; } public static Azure.ResourceManager.AppContainers.Models.ContainerAppNameAvailabilityResult ContainerAppNameAvailabilityResult(bool? isNameAvailable = default(bool?), Azure.ResourceManager.AppContainers.Models.ContainerAppNameUnavailableReason? reason = default(Azure.ResourceManager.AppContainers.Models.ContainerAppNameUnavailableReason?), string message = null) { throw null; } - public static Azure.ResourceManager.AppContainers.Models.ContainerAppReplicaContainer ContainerAppReplicaContainer(string name = null, string containerId = null, bool? isReady = default(bool?), bool? isStarted = default(bool?), int? restartCount = default(int?), Azure.ResourceManager.AppContainers.Models.ContainerAppContainerRunningState? runningState = default(Azure.ResourceManager.AppContainers.Models.ContainerAppContainerRunningState?), string runningStateDetails = null, string logStreamEndpoint = null, string execEndpoint = null) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public static Azure.ResourceManager.AppContainers.Models.ContainerAppReplicaContainer ContainerAppReplicaContainer(string name, string containerId, bool? isReady, bool? isStarted, int? restartCount, Azure.ResourceManager.AppContainers.Models.ContainerAppContainerRunningState? runningState, string runningStateDetails, string logStreamEndpoint, string execEndpoint) { throw null; } + public static Azure.ResourceManager.AppContainers.Models.ContainerAppReplicaContainer ContainerAppReplicaContainer(string name = null, string containerId = null, bool? isReady = default(bool?), bool? isStarted = default(bool?), int? restartCount = default(int?), Azure.ResourceManager.AppContainers.Models.ContainerAppContainerRunningState? runningState = default(Azure.ResourceManager.AppContainers.Models.ContainerAppContainerRunningState?), string runningStateDetails = null, string logStreamEndpoint = null, string execEndpoint = null, string debugEndpoint = null) { throw null; } public static Azure.ResourceManager.AppContainers.ContainerAppReplicaData ContainerAppReplicaData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.DateTimeOffset? createdOn = default(System.DateTimeOffset?), Azure.ResourceManager.AppContainers.Models.ContainerAppReplicaRunningState? runningState = default(Azure.ResourceManager.AppContainers.Models.ContainerAppReplicaRunningState?), string runningStateDetails = null, System.Collections.Generic.IEnumerable containers = null, System.Collections.Generic.IEnumerable initContainers = null) { throw null; } - public static Azure.ResourceManager.AppContainers.ContainerAppRevisionData ContainerAppRevisionData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.DateTimeOffset? createdOn = default(System.DateTimeOffset?), System.DateTimeOffset? lastActiveOn = default(System.DateTimeOffset?), string fqdn = null, Azure.ResourceManager.AppContainers.Models.ContainerAppTemplate template = null, bool? isActive = default(bool?), int? replicas = default(int?), int? trafficWeight = default(int?), string provisioningError = null, Azure.ResourceManager.AppContainers.Models.ContainerAppRevisionHealthState? healthState = default(Azure.ResourceManager.AppContainers.Models.ContainerAppRevisionHealthState?), Azure.ResourceManager.AppContainers.Models.ContainerAppRevisionProvisioningState? provisioningState = default(Azure.ResourceManager.AppContainers.Models.ContainerAppRevisionProvisioningState?), Azure.ResourceManager.AppContainers.Models.RevisionRunningState? runningState = default(Azure.ResourceManager.AppContainers.Models.RevisionRunningState?)) { throw null; } + public static Azure.ResourceManager.AppContainers.ContainerAppRevisionData ContainerAppRevisionData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.DateTimeOffset? createdOn = default(System.DateTimeOffset?), System.DateTimeOffset? lastActiveOn = default(System.DateTimeOffset?), string fqdn = null, Azure.ResourceManager.AppContainers.Models.ContainerAppTemplate template = null, bool? isActive = default(bool?), int? replicas = default(int?), int? trafficWeight = default(int?), System.Collections.Generic.IEnumerable labels = null, string provisioningError = null, Azure.ResourceManager.AppContainers.Models.ContainerAppRevisionHealthState? healthState = default(Azure.ResourceManager.AppContainers.Models.ContainerAppRevisionHealthState?), Azure.ResourceManager.AppContainers.Models.ContainerAppRevisionProvisioningState? provisioningState = default(Azure.ResourceManager.AppContainers.Models.ContainerAppRevisionProvisioningState?), Azure.ResourceManager.AppContainers.Models.RevisionRunningState? runningState = default(Azure.ResourceManager.AppContainers.Models.RevisionRunningState?)) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public static Azure.ResourceManager.AppContainers.ContainerAppRevisionData ContainerAppRevisionData(Azure.Core.ResourceIdentifier id, string name, Azure.Core.ResourceType resourceType, Azure.ResourceManager.Models.SystemData systemData, System.DateTimeOffset? createdOn, System.DateTimeOffset? lastActiveOn, string fqdn, Azure.ResourceManager.AppContainers.Models.ContainerAppTemplate template, bool? isActive, int? replicas, int? trafficWeight, string provisioningError, Azure.ResourceManager.AppContainers.Models.ContainerAppRevisionHealthState? healthState, Azure.ResourceManager.AppContainers.Models.ContainerAppRevisionProvisioningState? provisioningState, Azure.ResourceManager.AppContainers.Models.RevisionRunningState? runningState) { throw null; } + public static Azure.ResourceManager.AppContainers.Models.ContainerAppsBuildConfiguration ContainerAppsBuildConfiguration(string baseOS = null, string platform = null, string platformVersion = null, System.Collections.Generic.IEnumerable environmentVariables = null, System.Collections.Generic.IEnumerable preBuildSteps = null) { throw null; } + public static Azure.ResourceManager.AppContainers.ContainerAppsBuildResourceData ContainerAppsBuildResourceData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.AppContainers.Models.ContainerAppBuildProvisioningState? provisioningState = default(Azure.ResourceManager.AppContainers.Models.ContainerAppBuildProvisioningState?), Azure.ResourceManager.AppContainers.Models.ContainerAppBuildStatus? buildStatus = default(Azure.ResourceManager.AppContainers.Models.ContainerAppBuildStatus?), Azure.ResourceManager.AppContainers.Models.ContainerRegistryWithCustomImage destinationContainerRegistry = null, Azure.ResourceManager.AppContainers.Models.ContainerAppsBuildConfiguration configuration = null, string logStreamEndpoint = null) { throw null; } public static Azure.ResourceManager.AppContainers.Models.ContainerAppSecret ContainerAppSecret(string name = null, string value = null, string identity = null, System.Uri keyVaultUri = null) { throw null; } public static Azure.ResourceManager.AppContainers.ContainerAppSourceControlData ContainerAppSourceControlData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.AppContainers.Models.ContainerAppSourceControlOperationState? operationState = default(Azure.ResourceManager.AppContainers.Models.ContainerAppSourceControlOperationState?), System.Uri repoUri = null, string branch = null, Azure.ResourceManager.AppContainers.Models.ContainerAppGitHubActionConfiguration gitHubActionConfiguration = null) { throw null; } + public static Azure.ResourceManager.AppContainers.ContainerAppsPatchResourceData ContainerAppsPatchResourceData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.AppContainers.Models.PatchProperties properties = null) { throw null; } public static Azure.ResourceManager.AppContainers.Models.ContainerAppUsage ContainerAppUsage(Azure.ResourceManager.AppContainers.Models.ContainerAppUsageUnit unit = default(Azure.ResourceManager.AppContainers.Models.ContainerAppUsageUnit), float currentValue = 0f, float limit = 0f, Azure.ResourceManager.AppContainers.Models.ContainerAppUsageName name = null) { throw null; } public static Azure.ResourceManager.AppContainers.Models.ContainerAppUsageName ContainerAppUsageName(string value = null, string localizedValue = null) { throw null; } + public static Azure.ResourceManager.AppContainers.Models.ContainerAppWorkflowEnvelopeProperties ContainerAppWorkflowEnvelopeProperties(System.BinaryData files = null, Azure.ResourceManager.AppContainers.Models.ContainerAppWorkflowState? flowState = default(Azure.ResourceManager.AppContainers.Models.ContainerAppWorkflowState?), Azure.ResourceManager.AppContainers.Models.ContainerAppWorkflowHealth health = null) { throw null; } + public static Azure.ResourceManager.AppContainers.Models.ContainerAppWorkflowHealth ContainerAppWorkflowHealth(Azure.ResourceManager.AppContainers.Models.ContainerAppWorkflowHealthState state = Azure.ResourceManager.AppContainers.Models.ContainerAppWorkflowHealthState.Unknown, Azure.ResponseError error = null) { throw null; } public static Azure.ResourceManager.AppContainers.Models.ContainerAppWorkloadProfileState ContainerAppWorkloadProfileState(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.AppContainers.Models.ContainerAppWorkloadProfileStateProperties properties = null) { throw null; } + public static Azure.ResourceManager.AppContainers.Models.ContainerExecutionStatus ContainerExecutionStatus(string name = null, int? code = default(int?), string additionalInformation = null, string status = null) { throw null; } + public static Azure.ResourceManager.AppContainers.DaprComponentResiliencyPolicyData DaprComponentResiliencyPolicyData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.AppContainers.Models.DaprComponentResiliencyPolicyConfiguration inboundPolicy = null, Azure.ResourceManager.AppContainers.Models.DaprComponentResiliencyPolicyConfiguration outboundPolicy = null) { throw null; } + public static Azure.ResourceManager.AppContainers.DaprSubscriptionData DaprSubscriptionData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, string pubsubName = null, string topic = null, string deadLetterTopic = null, Azure.ResourceManager.AppContainers.Models.DaprSubscriptionRoutes routes = null, System.Collections.Generic.IEnumerable scopes = null, System.Collections.Generic.IDictionary metadata = null, Azure.ResourceManager.AppContainers.Models.DaprSubscriptionBulkSubscribeConfig bulkSubscribe = null) { throw null; } + public static Azure.ResourceManager.AppContainers.DotNetComponentData DotNetComponentData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.AppContainers.Models.DotNetComponentType? componentType = default(Azure.ResourceManager.AppContainers.Models.DotNetComponentType?), Azure.ResourceManager.AppContainers.Models.DotNetComponentProvisioningState? provisioningState = default(Azure.ResourceManager.AppContainers.Models.DotNetComponentProvisioningState?), System.Collections.Generic.IEnumerable configurations = null, System.Collections.Generic.IEnumerable serviceBinds = null) { throw null; } + public static Azure.ResourceManager.AppContainers.HttpRouteConfigData HttpRouteConfigData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.AppContainers.Models.HttpRouteConfigProperties properties = null) { throw null; } + public static Azure.ResourceManager.AppContainers.Models.HttpRouteConfigProperties HttpRouteConfigProperties(Azure.ResourceManager.AppContainers.Models.HttpRouteProvisioningState? provisioningState = default(Azure.ResourceManager.AppContainers.Models.HttpRouteProvisioningState?), System.Collections.Generic.IEnumerable provisioningErrors = null, string fqdn = null, System.Collections.Generic.IEnumerable customDomains = null, System.Collections.Generic.IEnumerable rules = null) { throw null; } + public static Azure.ResourceManager.AppContainers.Models.HttpRouteProvisioningErrors HttpRouteProvisioningErrors(System.DateTimeOffset? timestamp = default(System.DateTimeOffset?), string message = null) { throw null; } public static Azure.ResourceManager.AppContainers.JavaComponentData JavaComponentData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.AppContainers.Models.JavaComponentProperties properties = null) { throw null; } public static Azure.ResourceManager.AppContainers.Models.JavaComponentProperties JavaComponentProperties(string componentType = null, Azure.ResourceManager.AppContainers.Models.JavaComponentProvisioningState? provisioningState = default(Azure.ResourceManager.AppContainers.Models.JavaComponentProvisioningState?), System.Collections.Generic.IEnumerable configurations = null, Azure.ResourceManager.AppContainers.Models.JavaComponentPropertiesScale scale = null, System.Collections.Generic.IEnumerable serviceBinds = null) { throw null; } + public static Azure.ResourceManager.AppContainers.LabelHistoryData LabelHistoryData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IEnumerable labelHistoryRecords = null) { throw null; } + public static Azure.ResourceManager.AppContainers.Models.LabelHistoryRecordItem LabelHistoryRecordItem(string revision = null, System.DateTimeOffset? start = default(System.DateTimeOffset?), System.DateTimeOffset? stop = default(System.DateTimeOffset?), Azure.ResourceManager.AppContainers.Models.LabelHistoryRecordItemStatus? status = default(Azure.ResourceManager.AppContainers.Models.LabelHistoryRecordItemStatus?)) { throw null; } + public static Azure.ResourceManager.AppContainers.LogicAppData LogicAppData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.BinaryData properties = null) { throw null; } + public static Azure.ResourceManager.AppContainers.MaintenanceConfigurationResourceData MaintenanceConfigurationResourceData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IEnumerable scheduledEntries = null) { throw null; } public static Azure.ResourceManager.AppContainers.Models.ManagedCertificateProperties ManagedCertificateProperties(Azure.ResourceManager.AppContainers.Models.ContainerAppCertificateProvisioningState? provisioningState = default(Azure.ResourceManager.AppContainers.Models.ContainerAppCertificateProvisioningState?), string subjectName = null, string error = null, Azure.ResourceManager.AppContainers.Models.ManagedCertificateDomainControlValidation? domainControlValidation = default(Azure.ResourceManager.AppContainers.Models.ManagedCertificateDomainControlValidation?), string validationToken = null) { throw null; } + public static Azure.ResourceManager.AppContainers.Models.NacosComponent NacosComponent(Azure.ResourceManager.AppContainers.Models.JavaComponentProvisioningState? provisioningState = default(Azure.ResourceManager.AppContainers.Models.JavaComponentProvisioningState?), System.Collections.Generic.IEnumerable configurations = null, Azure.ResourceManager.AppContainers.Models.JavaComponentPropertiesScale scale = null, System.Collections.Generic.IEnumerable serviceBinds = null, string ingressFqdn = null) { throw null; } + public static Azure.ResourceManager.AppContainers.Models.PatchDetails PatchDetails(string targetContainerName = null, string targetImage = null, System.DateTimeOffset lastDetectionOn = default(System.DateTimeOffset), Azure.ResourceManager.AppContainers.Models.DetectionStatus detectionStatus = default(Azure.ResourceManager.AppContainers.Models.DetectionStatus), string newImageName = null, Azure.ResourceManager.AppContainers.Models.PatchDetailsNewLayer newLayer = null, Azure.ResourceManager.AppContainers.Models.PatchDetailsOldLayer oldLayer = null, Azure.ResourceManager.AppContainers.Models.PatchType? patchType = default(Azure.ResourceManager.AppContainers.Models.PatchType?)) { throw null; } + public static Azure.ResourceManager.AppContainers.Models.PatchDetailsNewLayer PatchDetailsNewLayer(string name = null, string frameworkAndVersion = null, string osAndVersion = null) { throw null; } + public static Azure.ResourceManager.AppContainers.Models.PatchDetailsOldLayer PatchDetailsOldLayer(string name = null, string frameworkAndVersion = null, string osAndVersion = null) { throw null; } + public static Azure.ResourceManager.AppContainers.Models.PatchProperties PatchProperties(Azure.Core.ResourceIdentifier targetEnvironmentId = null, Azure.Core.ResourceIdentifier targetContainerAppId = null, Azure.Core.ResourceIdentifier targetRevisionId = null, Azure.ResourceManager.AppContainers.Models.PatchApplyStatus? patchApplyStatus = default(Azure.ResourceManager.AppContainers.Models.PatchApplyStatus?), System.DateTimeOffset? createdOn = default(System.DateTimeOffset?), System.DateTimeOffset? lastModifiedOn = default(System.DateTimeOffset?), System.Collections.Generic.IEnumerable patchDetails = null) { throw null; } + public static Azure.ResourceManager.AppContainers.Models.ReplicaExecutionStatus ReplicaExecutionStatus(string name = null, System.Collections.Generic.IEnumerable containers = null) { throw null; } public static Azure.ResourceManager.AppContainers.SessionPoolData SessionPoolData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IDictionary tags = null, Azure.Core.AzureLocation location = default(Azure.Core.AzureLocation), Azure.ResourceManager.Models.ManagedServiceIdentity identity = null, Azure.Core.ResourceIdentifier environmentId = null, Azure.ResourceManager.AppContainers.Models.ContainerType? containerType = default(Azure.ResourceManager.AppContainers.Models.ContainerType?), Azure.ResourceManager.AppContainers.Models.PoolManagementType? poolManagementType = default(Azure.ResourceManager.AppContainers.Models.PoolManagementType?), int? nodeCount = default(int?), Azure.ResourceManager.AppContainers.Models.SessionPoolScaleConfiguration scaleConfiguration = null, System.Collections.Generic.IEnumerable secrets = null, Azure.ResourceManager.AppContainers.Models.SessionPoolLifecycleConfiguration dynamicPoolLifecycleConfiguration = null, Azure.ResourceManager.AppContainers.Models.CustomContainerTemplate customContainerTemplate = null, Azure.ResourceManager.AppContainers.Models.SessionNetworkStatus? sessionNetworkStatus = default(Azure.ResourceManager.AppContainers.Models.SessionNetworkStatus?), System.Uri poolManagementEndpoint = null, Azure.ResourceManager.AppContainers.Models.SessionPoolProvisioningState? provisioningState = default(Azure.ResourceManager.AppContainers.Models.SessionPoolProvisioningState?), System.Collections.Generic.IEnumerable managedIdentitySettings = null) { throw null; } public static Azure.ResourceManager.AppContainers.Models.SpringBootAdminComponent SpringBootAdminComponent(Azure.ResourceManager.AppContainers.Models.JavaComponentProvisioningState? provisioningState = default(Azure.ResourceManager.AppContainers.Models.JavaComponentProvisioningState?), System.Collections.Generic.IEnumerable configurations = null, Azure.ResourceManager.AppContainers.Models.JavaComponentPropertiesScale scale = null, System.Collections.Generic.IEnumerable serviceBinds = null, string ingressFqdn = null) { throw null; } public static Azure.ResourceManager.AppContainers.Models.SpringCloudConfigComponent SpringCloudConfigComponent(Azure.ResourceManager.AppContainers.Models.JavaComponentProvisioningState? provisioningState = default(Azure.ResourceManager.AppContainers.Models.JavaComponentProvisioningState?), System.Collections.Generic.IEnumerable configurations = null, Azure.ResourceManager.AppContainers.Models.JavaComponentPropertiesScale scale = null, System.Collections.Generic.IEnumerable serviceBinds = null) { throw null; } public static Azure.ResourceManager.AppContainers.Models.SpringCloudEurekaComponent SpringCloudEurekaComponent(Azure.ResourceManager.AppContainers.Models.JavaComponentProvisioningState? provisioningState = default(Azure.ResourceManager.AppContainers.Models.JavaComponentProvisioningState?), System.Collections.Generic.IEnumerable configurations = null, Azure.ResourceManager.AppContainers.Models.JavaComponentPropertiesScale scale = null, System.Collections.Generic.IEnumerable serviceBinds = null, string ingressFqdn = null) { throw null; } + public static Azure.ResourceManager.AppContainers.Models.SpringCloudGatewayComponent SpringCloudGatewayComponent(Azure.ResourceManager.AppContainers.Models.JavaComponentProvisioningState? provisioningState = default(Azure.ResourceManager.AppContainers.Models.JavaComponentProvisioningState?), System.Collections.Generic.IEnumerable configurations = null, Azure.ResourceManager.AppContainers.Models.JavaComponentPropertiesScale scale = null, System.Collections.Generic.IEnumerable serviceBinds = null, string ingressFqdn = null, System.Collections.Generic.IEnumerable springCloudGatewayRoutes = null) { throw null; } + public static Azure.ResourceManager.AppContainers.WorkflowEnvelopeData WorkflowEnvelopeData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, string kind = null, Azure.Core.AzureLocation? location = default(Azure.Core.AzureLocation?), Azure.ResourceManager.AppContainers.Models.ContainerAppWorkflowEnvelopeProperties properties = null) { throw null; } } - [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] - public readonly partial struct ContainerAppAccessMode : System.IEquatable + public partial class BuilderResourcePatch : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { - private readonly object _dummy; - private readonly int _dummyPrimitive; - public ContainerAppAccessMode(string value) { throw null; } + public BuilderResourcePatch() { } + public Azure.Core.ResourceIdentifier EnvironmentId { get { throw null; } set { } } + public Azure.ResourceManager.Models.ManagedServiceIdentity Identity { get { throw null; } set { } } + public System.Collections.Generic.IDictionary Tags { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.Models.BuilderResourcePatch System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.Models.BuilderResourcePatch System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class CircuitBreakerPolicy : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public CircuitBreakerPolicy() { } + public int? ConsecutiveErrors { get { throw null; } set { } } + public int? IntervalInSeconds { get { throw null; } set { } } + public int? MaxEjectionPercent { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.Models.CircuitBreakerPolicy System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.Models.CircuitBreakerPolicy System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct ConnectedEnvironmentDaprComponentProvisioningState : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public ConnectedEnvironmentDaprComponentProvisioningState(string value) { throw null; } + public static Azure.ResourceManager.AppContainers.Models.ConnectedEnvironmentDaprComponentProvisioningState Canceled { get { throw null; } } + public static Azure.ResourceManager.AppContainers.Models.ConnectedEnvironmentDaprComponentProvisioningState Deleting { get { throw null; } } + public static Azure.ResourceManager.AppContainers.Models.ConnectedEnvironmentDaprComponentProvisioningState Failed { get { throw null; } } + public static Azure.ResourceManager.AppContainers.Models.ConnectedEnvironmentDaprComponentProvisioningState InProgress { get { throw null; } } + public static Azure.ResourceManager.AppContainers.Models.ConnectedEnvironmentDaprComponentProvisioningState Succeeded { get { throw null; } } + public bool Equals(Azure.ResourceManager.AppContainers.Models.ConnectedEnvironmentDaprComponentProvisioningState other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.AppContainers.Models.ConnectedEnvironmentDaprComponentProvisioningState left, Azure.ResourceManager.AppContainers.Models.ConnectedEnvironmentDaprComponentProvisioningState right) { throw null; } + public static implicit operator Azure.ResourceManager.AppContainers.Models.ConnectedEnvironmentDaprComponentProvisioningState (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.AppContainers.Models.ConnectedEnvironmentDaprComponentProvisioningState left, Azure.ResourceManager.AppContainers.Models.ConnectedEnvironmentDaprComponentProvisioningState right) { throw null; } + public override string ToString() { throw null; } + } + public partial class ConnectedEnvironmentStorageProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ConnectedEnvironmentStorageProperties() { } + public Azure.ResourceManager.AppContainers.Models.ContainerAppAzureFileProperties AzureFile { get { throw null; } set { } } + public string DeploymentErrors { get { throw null; } } + public Azure.ResourceManager.AppContainers.Models.ConnectedEnvironmentStorageProvisioningState? ProvisioningState { get { throw null; } } + public Azure.ResourceManager.AppContainers.Models.SmbStorage Smb { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.Models.ConnectedEnvironmentStorageProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.Models.ConnectedEnvironmentStorageProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct ConnectedEnvironmentStorageProvisioningState : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public ConnectedEnvironmentStorageProvisioningState(string value) { throw null; } + public static Azure.ResourceManager.AppContainers.Models.ConnectedEnvironmentStorageProvisioningState Canceled { get { throw null; } } + public static Azure.ResourceManager.AppContainers.Models.ConnectedEnvironmentStorageProvisioningState Deleting { get { throw null; } } + public static Azure.ResourceManager.AppContainers.Models.ConnectedEnvironmentStorageProvisioningState Failed { get { throw null; } } + public static Azure.ResourceManager.AppContainers.Models.ConnectedEnvironmentStorageProvisioningState InProgress { get { throw null; } } + public static Azure.ResourceManager.AppContainers.Models.ConnectedEnvironmentStorageProvisioningState Succeeded { get { throw null; } } + public bool Equals(Azure.ResourceManager.AppContainers.Models.ConnectedEnvironmentStorageProvisioningState other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.AppContainers.Models.ConnectedEnvironmentStorageProvisioningState left, Azure.ResourceManager.AppContainers.Models.ConnectedEnvironmentStorageProvisioningState right) { throw null; } + public static implicit operator Azure.ResourceManager.AppContainers.Models.ConnectedEnvironmentStorageProvisioningState (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.AppContainers.Models.ConnectedEnvironmentStorageProvisioningState left, Azure.ResourceManager.AppContainers.Models.ConnectedEnvironmentStorageProvisioningState right) { throw null; } + public override string ToString() { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct ContainerAppAccessMode : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public ContainerAppAccessMode(string value) { throw null; } public static Azure.ResourceManager.AppContainers.Models.ContainerAppAccessMode ReadOnly { get { throw null; } } public static Azure.ResourceManager.AppContainers.Models.ContainerAppAccessMode ReadWrite { get { throw null; } } public bool Equals(Azure.ResourceManager.AppContainers.Models.ContainerAppAccessMode other) { throw null; } @@ -1505,6 +2541,7 @@ public static partial class ArmAppContainersModelFactory private readonly object _dummy; private readonly int _dummyPrimitive; public ContainerAppActiveRevisionsMode(string value) { throw null; } + public static Azure.ResourceManager.AppContainers.Models.ContainerAppActiveRevisionsMode Labels { get { throw null; } } public static Azure.ResourceManager.AppContainers.Models.ContainerAppActiveRevisionsMode Multiple { get { throw null; } } public static Azure.ResourceManager.AppContainers.Models.ContainerAppActiveRevisionsMode Single { get { throw null; } } public bool Equals(Azure.ResourceManager.AppContainers.Models.ContainerAppActiveRevisionsMode other) { throw null; } @@ -1687,6 +2724,7 @@ public partial class ContainerAppAzureFileProperties : System.ClientModel.Primit public ContainerAppAzureFileProperties() { } public Azure.ResourceManager.AppContainers.Models.ContainerAppAccessMode? AccessMode { get { throw null; } set { } } public string AccountKey { get { throw null; } set { } } + public Azure.ResourceManager.AppContainers.Models.SecretKeyVaultProperties AccountKeyVaultProperties { get { throw null; } set { } } public string AccountName { get { throw null; } set { } } public string ShareName { get { throw null; } set { } } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } @@ -1715,6 +2753,7 @@ public ContainerAppBaseContainer() { } public System.Collections.Generic.IList Command { get { throw null; } } public System.Collections.Generic.IList Env { get { throw null; } } public string Image { get { throw null; } set { } } + public Azure.ResourceManager.AppContainers.Models.ImageType? ImageType { get { throw null; } set { } } public string Name { get { throw null; } set { } } public Azure.ResourceManager.AppContainers.Models.AppContainerResources Resources { get { throw null; } set { } } public System.Collections.Generic.IList VolumeMounts { get { throw null; } } @@ -1727,9 +2766,9 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer } public partial class ContainerAppBillingMeter : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { - public ContainerAppBillingMeter() { } - public Azure.Core.AzureLocation? Location { get { throw null; } set { } } - public Azure.ResourceManager.AppContainers.Models.ContainerAppBillingMeterProperties Properties { get { throw null; } set { } } + internal ContainerAppBillingMeter() { } + public Azure.Core.AzureLocation? Location { get { throw null; } } + public Azure.ResourceManager.AppContainers.Models.ContainerAppBillingMeterProperties Properties { get { throw null; } } protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.AppContainers.Models.ContainerAppBillingMeter System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } @@ -1759,12 +2798,12 @@ protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter write } public partial class ContainerAppBillingMeterProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { - public ContainerAppBillingMeterProperties() { } + internal ContainerAppBillingMeterProperties() { } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] - public Azure.ResourceManager.AppContainers.Models.ContainerAppBillingMeterCategory? Category { get { throw null; } set { } } - public string DisplayName { get { throw null; } set { } } - public string MeterType { get { throw null; } set { } } - public string WorkloadProfileCategory { get { throw null; } set { } } + public Azure.ResourceManager.AppContainers.Models.ContainerAppBillingMeterCategory? Category { get { throw null; } } + public string DisplayName { get { throw null; } } + public string MeterType { get { throw null; } } + public string WorkloadProfileCategory { get { throw null; } } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.AppContainers.Models.ContainerAppBillingMeterProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } @@ -1772,6 +2811,112 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } + public partial class ContainerAppBlobStorageTokenStore : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ContainerAppBlobStorageTokenStore() { } + public System.Uri BlobContainerUri { get { throw null; } set { } } + public string ClientId { get { throw null; } set { } } + public string ManagedIdentityResourceId { get { throw null; } set { } } + public string SasUrlSettingName { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.Models.ContainerAppBlobStorageTokenStore System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.Models.ContainerAppBlobStorageTokenStore System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ContainerAppBuildConfiguration : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ContainerAppBuildConfiguration() { } + public string BaseOS { get { throw null; } set { } } + public System.Collections.Generic.IList EnvironmentVariables { get { throw null; } } + public string Platform { get { throw null; } set { } } + public string PlatformVersion { get { throw null; } set { } } + public System.Collections.Generic.IList PreBuildSteps { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.Models.ContainerAppBuildConfiguration System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.Models.ContainerAppBuildConfiguration System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct ContainerAppBuilderProvisioningState : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public ContainerAppBuilderProvisioningState(string value) { throw null; } + public static Azure.ResourceManager.AppContainers.Models.ContainerAppBuilderProvisioningState Canceled { get { throw null; } } + public static Azure.ResourceManager.AppContainers.Models.ContainerAppBuilderProvisioningState Creating { get { throw null; } } + public static Azure.ResourceManager.AppContainers.Models.ContainerAppBuilderProvisioningState Deleting { get { throw null; } } + public static Azure.ResourceManager.AppContainers.Models.ContainerAppBuilderProvisioningState Failed { get { throw null; } } + public static Azure.ResourceManager.AppContainers.Models.ContainerAppBuilderProvisioningState Succeeded { get { throw null; } } + public static Azure.ResourceManager.AppContainers.Models.ContainerAppBuilderProvisioningState Updating { get { throw null; } } + public bool Equals(Azure.ResourceManager.AppContainers.Models.ContainerAppBuilderProvisioningState other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.AppContainers.Models.ContainerAppBuilderProvisioningState left, Azure.ResourceManager.AppContainers.Models.ContainerAppBuilderProvisioningState right) { throw null; } + public static implicit operator Azure.ResourceManager.AppContainers.Models.ContainerAppBuilderProvisioningState (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.AppContainers.Models.ContainerAppBuilderProvisioningState left, Azure.ResourceManager.AppContainers.Models.ContainerAppBuilderProvisioningState right) { throw null; } + public override string ToString() { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct ContainerAppBuildProvisioningState : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public ContainerAppBuildProvisioningState(string value) { throw null; } + public static Azure.ResourceManager.AppContainers.Models.ContainerAppBuildProvisioningState Canceled { get { throw null; } } + public static Azure.ResourceManager.AppContainers.Models.ContainerAppBuildProvisioningState Creating { get { throw null; } } + public static Azure.ResourceManager.AppContainers.Models.ContainerAppBuildProvisioningState Deleting { get { throw null; } } + public static Azure.ResourceManager.AppContainers.Models.ContainerAppBuildProvisioningState Failed { get { throw null; } } + public static Azure.ResourceManager.AppContainers.Models.ContainerAppBuildProvisioningState Succeeded { get { throw null; } } + public static Azure.ResourceManager.AppContainers.Models.ContainerAppBuildProvisioningState Updating { get { throw null; } } + public bool Equals(Azure.ResourceManager.AppContainers.Models.ContainerAppBuildProvisioningState other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.AppContainers.Models.ContainerAppBuildProvisioningState left, Azure.ResourceManager.AppContainers.Models.ContainerAppBuildProvisioningState right) { throw null; } + public static implicit operator Azure.ResourceManager.AppContainers.Models.ContainerAppBuildProvisioningState (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.AppContainers.Models.ContainerAppBuildProvisioningState left, Azure.ResourceManager.AppContainers.Models.ContainerAppBuildProvisioningState right) { throw null; } + public override string ToString() { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct ContainerAppBuildStatus : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public ContainerAppBuildStatus(string value) { throw null; } + public static Azure.ResourceManager.AppContainers.Models.ContainerAppBuildStatus Canceled { get { throw null; } } + public static Azure.ResourceManager.AppContainers.Models.ContainerAppBuildStatus Failed { get { throw null; } } + public static Azure.ResourceManager.AppContainers.Models.ContainerAppBuildStatus InProgress { get { throw null; } } + public static Azure.ResourceManager.AppContainers.Models.ContainerAppBuildStatus NotStarted { get { throw null; } } + public static Azure.ResourceManager.AppContainers.Models.ContainerAppBuildStatus Succeeded { get { throw null; } } + public bool Equals(Azure.ResourceManager.AppContainers.Models.ContainerAppBuildStatus other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.AppContainers.Models.ContainerAppBuildStatus left, Azure.ResourceManager.AppContainers.Models.ContainerAppBuildStatus right) { throw null; } + public static implicit operator Azure.ResourceManager.AppContainers.Models.ContainerAppBuildStatus (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.AppContainers.Models.ContainerAppBuildStatus left, Azure.ResourceManager.AppContainers.Models.ContainerAppBuildStatus right) { throw null; } + public override string ToString() { throw null; } + } + public partial class ContainerAppBuildToken : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal ContainerAppBuildToken() { } + public System.DateTimeOffset? Expires { get { throw null; } } + public string Token { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.Models.ContainerAppBuildToken System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.Models.ContainerAppBuildToken System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } public partial class ContainerAppCertificateKeyVaultProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public ContainerAppCertificateKeyVaultProperties() { } @@ -1799,6 +2944,8 @@ public partial class ContainerAppCertificateProperties : System.ClientModel.Prim { public ContainerAppCertificateProperties() { } public Azure.ResourceManager.AppContainers.Models.ContainerAppCertificateKeyVaultProperties CertificateKeyVaultProperties { get { throw null; } set { } } + public Azure.ResourceManager.AppContainers.Models.ContainerAppCertificateType? CertificateType { get { throw null; } set { } } + public string DeploymentErrors { get { throw null; } } public System.DateTimeOffset? ExpireOn { get { throw null; } } public System.DateTimeOffset? IssueOn { get { throw null; } } public string Issuer { get { throw null; } } @@ -1825,6 +2972,7 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer public ContainerAppCertificateProvisioningState(string value) { throw null; } public static Azure.ResourceManager.AppContainers.Models.ContainerAppCertificateProvisioningState Canceled { get { throw null; } } public static Azure.ResourceManager.AppContainers.Models.ContainerAppCertificateProvisioningState DeleteFailed { get { throw null; } } + public static Azure.ResourceManager.AppContainers.Models.ContainerAppCertificateProvisioningState Deleting { get { throw null; } } public static Azure.ResourceManager.AppContainers.Models.ContainerAppCertificateProvisioningState Failed { get { throw null; } } public static Azure.ResourceManager.AppContainers.Models.ContainerAppCertificateProvisioningState Pending { get { throw null; } } public static Azure.ResourceManager.AppContainers.Models.ContainerAppCertificateProvisioningState Succeeded { get { throw null; } } @@ -1838,6 +2986,24 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer public static bool operator !=(Azure.ResourceManager.AppContainers.Models.ContainerAppCertificateProvisioningState left, Azure.ResourceManager.AppContainers.Models.ContainerAppCertificateProvisioningState right) { throw null; } public override string ToString() { throw null; } } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct ContainerAppCertificateType : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public ContainerAppCertificateType(string value) { throw null; } + public static Azure.ResourceManager.AppContainers.Models.ContainerAppCertificateType ImagePullTrustedCA { get { throw null; } } + public static Azure.ResourceManager.AppContainers.Models.ContainerAppCertificateType ServerSSLCertificate { get { throw null; } } + public bool Equals(Azure.ResourceManager.AppContainers.Models.ContainerAppCertificateType other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.AppContainers.Models.ContainerAppCertificateType left, Azure.ResourceManager.AppContainers.Models.ContainerAppCertificateType right) { throw null; } + public static implicit operator Azure.ResourceManager.AppContainers.Models.ContainerAppCertificateType (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.AppContainers.Models.ContainerAppCertificateType left, Azure.ResourceManager.AppContainers.Models.ContainerAppCertificateType right) { throw null; } + public override string ToString() { throw null; } + } public partial class ContainerAppClientRegistration : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public ContainerAppClientRegistration() { } @@ -1855,13 +3021,15 @@ public partial class ContainerAppConfiguration : System.ClientModel.Primitives.I public ContainerAppConfiguration() { } public Azure.ResourceManager.AppContainers.Models.ContainerAppActiveRevisionsMode? ActiveRevisionsMode { get { throw null; } set { } } public Azure.ResourceManager.AppContainers.Models.ContainerAppDaprConfiguration Dapr { get { throw null; } set { } } - public bool? EnableMetrics { get { throw null; } set { } } public System.Collections.Generic.IList IdentitySettings { get { throw null; } } public Azure.ResourceManager.AppContainers.Models.ContainerAppIngressConfiguration Ingress { get { throw null; } set { } } public int? MaxInactiveRevisions { get { throw null; } set { } } public System.Collections.Generic.IList Registries { get { throw null; } } + public int? RevisionTransitionThreshold { get { throw null; } set { } } + public Azure.ResourceManager.AppContainers.Models.ContainerAppRuntime Runtime { get { throw null; } set { } } public System.Collections.Generic.IList Secrets { get { throw null; } } public string ServiceType { get { throw null; } set { } } + public string TargetLabel { get { throw null; } set { } } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.AppContainers.Models.ContainerAppConfiguration System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } @@ -1869,6 +3037,16 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } + public partial class ContainerAppConnectedEnvironmentPatch : Azure.ResourceManager.AppContainers.Models.ContainerAppResourceTags, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ContainerAppConnectedEnvironmentPatch() { } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.Models.ContainerAppConnectedEnvironmentPatch System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.Models.ContainerAppConnectedEnvironmentPatch System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] public readonly partial struct ContainerAppConnectedEnvironmentProvisioningState : System.IEquatable { @@ -1904,6 +3082,18 @@ protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter write string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } + public partial class ContainerAppContainerRegistry : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ContainerAppContainerRegistry(string containerRegistryServer, Azure.Core.ResourceIdentifier identityResourceId) { } + public string ContainerRegistryServer { get { throw null; } set { } } + public Azure.Core.ResourceIdentifier IdentityResourceId { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.Models.ContainerAppContainerRegistry System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.Models.ContainerAppContainerRegistry System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] public readonly partial struct ContainerAppContainerRunningState : System.IEquatable { @@ -1991,6 +3181,7 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer private readonly object _dummy; private readonly int _dummyPrimitive; public ContainerAppCustomDomainBindingType(string value) { throw null; } + public static Azure.ResourceManager.AppContainers.Models.ContainerAppCustomDomainBindingType Auto { get { throw null; } } public static Azure.ResourceManager.AppContainers.Models.ContainerAppCustomDomainBindingType Disabled { get { throw null; } } public static Azure.ResourceManager.AppContainers.Models.ContainerAppCustomDomainBindingType SniEnabled { get { throw null; } } public bool Equals(Azure.ResourceManager.AppContainers.Models.ContainerAppCustomDomainBindingType other) { throw null; } @@ -2100,6 +3291,7 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer public partial class ContainerAppDaprConfiguration : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public ContainerAppDaprConfiguration() { } + public Azure.ResourceManager.AppContainers.Models.DaprAppHealth AppHealth { get { throw null; } set { } } public string AppId { get { throw null; } set { } } public int? AppPort { get { throw null; } set { } } public Azure.ResourceManager.AppContainers.Models.ContainerAppProtocol? AppProtocol { get { throw null; } set { } } @@ -2108,6 +3300,7 @@ public ContainerAppDaprConfiguration() { } public bool? IsApiLoggingEnabled { get { throw null; } set { } } public bool? IsEnabled { get { throw null; } set { } } public Azure.ResourceManager.AppContainers.Models.ContainerAppDaprLogLevel? LogLevel { get { throw null; } set { } } + public int? MaxConcurrency { get { throw null; } set { } } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.AppContainers.Models.ContainerAppDaprConfiguration System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } @@ -2425,7 +3618,9 @@ public partial class ContainerAppGitHubActionConfiguration : System.ClientModel. { public ContainerAppGitHubActionConfiguration() { } public Azure.ResourceManager.AppContainers.Models.ContainerAppCredentials AzureCredentials { get { throw null; } set { } } + public System.Collections.Generic.IList BuildEnvironmentVariables { get { throw null; } } public string ContextPath { get { throw null; } set { } } + public string DockerfilePath { get { throw null; } set { } } public string GitHubPersonalAccessToken { get { throw null; } set { } } public string Image { get { throw null; } set { } } public string OS { get { throw null; } set { } } @@ -2634,6 +3829,7 @@ public ContainerAppIngressConfiguration() { } public System.Collections.Generic.IList IPSecurityRestrictions { get { throw null; } } public Azure.ResourceManager.AppContainers.Models.Affinity? StickySessionsAffinity { get { throw null; } set { } } public int? TargetPort { get { throw null; } set { } } + public Azure.ResourceManager.AppContainers.Models.IngressTargetPortHttpScheme? TargetPortHttpScheme { get { throw null; } set { } } public System.Collections.Generic.IList Traffic { get { throw null; } } public Azure.ResourceManager.AppContainers.Models.ContainerAppIngressTransportMethod? Transport { get { throw null; } set { } } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } @@ -2763,6 +3959,7 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer public partial class ContainerAppJobPatch : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public ContainerAppJobPatch() { } + public Azure.ResourceManager.AppContainers.Models.ContainerAppExtendedLocation ExtendedLocation { get { throw null; } set { } } public Azure.ResourceManager.Models.ManagedServiceIdentity Identity { get { throw null; } set { } } public Azure.ResourceManager.AppContainers.Models.ContainerAppJobPatchProperties Properties { get { throw null; } set { } } public System.Collections.Generic.IDictionary Tags { get { throw null; } } @@ -2809,6 +4006,25 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer public static bool operator !=(Azure.ResourceManager.AppContainers.Models.ContainerAppJobProvisioningState left, Azure.ResourceManager.AppContainers.Models.ContainerAppJobProvisioningState right) { throw null; } public override string ToString() { throw null; } } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct ContainerAppJobRunningState : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public ContainerAppJobRunningState(string value) { throw null; } + public static Azure.ResourceManager.AppContainers.Models.ContainerAppJobRunningState Progressing { get { throw null; } } + public static Azure.ResourceManager.AppContainers.Models.ContainerAppJobRunningState Ready { get { throw null; } } + public static Azure.ResourceManager.AppContainers.Models.ContainerAppJobRunningState Suspended { get { throw null; } } + public bool Equals(Azure.ResourceManager.AppContainers.Models.ContainerAppJobRunningState other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.AppContainers.Models.ContainerAppJobRunningState left, Azure.ResourceManager.AppContainers.Models.ContainerAppJobRunningState right) { throw null; } + public static implicit operator Azure.ResourceManager.AppContainers.Models.ContainerAppJobRunningState (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.AppContainers.Models.ContainerAppJobRunningState left, Azure.ResourceManager.AppContainers.Models.ContainerAppJobRunningState right) { throw null; } + public override string ToString() { throw null; } + } public partial class ContainerAppJobScale : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public ContainerAppJobScale() { } @@ -2886,6 +4102,7 @@ public partial class ContainerAppLogAnalyticsConfiguration : System.ClientModel. { public ContainerAppLogAnalyticsConfiguration() { } public string CustomerId { get { throw null; } set { } } + public bool? DynamicJsonColumns { get { throw null; } set { } } public string SharedKey { get { throw null; } set { } } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.AppContainers.Models.ContainerAppLogAnalyticsConfiguration System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -3234,6 +4451,7 @@ public partial class ContainerAppReplicaContainer : System.ClientModel.Primitive { public ContainerAppReplicaContainer() { } public string ContainerId { get { throw null; } set { } } + public string DebugEndpoint { get { throw null; } } public string ExecEndpoint { get { throw null; } } public bool? IsReady { get { throw null; } set { } } public bool? IsStarted { get { throw null; } set { } } @@ -3268,6 +4486,17 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer public static bool operator !=(Azure.ResourceManager.AppContainers.Models.ContainerAppReplicaRunningState left, Azure.ResourceManager.AppContainers.Models.ContainerAppReplicaRunningState right) { throw null; } public override string ToString() { throw null; } } + public partial class ContainerAppResourceTags : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ContainerAppResourceTags() { } + public System.Collections.Generic.IDictionary Tags { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.Models.ContainerAppResourceTags System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.Models.ContainerAppResourceTags System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] public readonly partial struct ContainerAppRevisionHealthState : System.IEquatable { @@ -3343,6 +4572,57 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer public static bool operator !=(Azure.ResourceManager.AppContainers.Models.ContainerAppRunningStatus left, Azure.ResourceManager.AppContainers.Models.ContainerAppRunningStatus right) { throw null; } public override string ToString() { throw null; } } + public partial class ContainerAppRuntime : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ContainerAppRuntime() { } + public bool? AutoConfigureDataProtection { get { throw null; } set { } } + public Azure.ResourceManager.AppContainers.Models.ContainerAppRuntimeJava Java { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.Models.ContainerAppRuntime System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.Models.ContainerAppRuntime System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ContainerAppRuntimeJava : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ContainerAppRuntimeJava() { } + public bool? EnableMetrics { get { throw null; } set { } } + public Azure.ResourceManager.AppContainers.Models.ContainerAppRuntimeJavaAgent JavaAgent { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.Models.ContainerAppRuntimeJava System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.Models.ContainerAppRuntimeJava System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ContainerAppRuntimeJavaAgent : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ContainerAppRuntimeJavaAgent() { } + public bool? IsEnabled { get { throw null; } set { } } + public System.Collections.Generic.IList LoggingLoggerSettings { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.Models.ContainerAppRuntimeJavaAgent System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.Models.ContainerAppRuntimeJavaAgent System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ContainerAppsBuildConfiguration : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal ContainerAppsBuildConfiguration() { } + public string BaseOS { get { throw null; } } + public System.Collections.Generic.IReadOnlyList EnvironmentVariables { get { throw null; } } + public string Platform { get { throw null; } } + public string PlatformVersion { get { throw null; } } + public System.Collections.Generic.IReadOnlyList PreBuildSteps { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.Models.ContainerAppsBuildConfiguration System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.Models.ContainerAppsBuildConfiguration System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } public partial class ContainerAppScale : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public ContainerAppScale() { } @@ -3402,6 +4682,8 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer public partial class ContainerAppServiceBind : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public ContainerAppServiceBind() { } + public string ClientType { get { throw null; } set { } } + public System.Collections.Generic.IDictionary CustomizedKeys { get { throw null; } } public string Name { get { throw null; } set { } } public Azure.Core.ResourceIdentifier ServiceId { get { throw null; } set { } } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } @@ -3411,6 +4693,18 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } + public partial class ContainerAppSimpleEnvironmentVariable : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ContainerAppSimpleEnvironmentVariable(string name, string value) { } + public string Name { get { throw null; } set { } } + public string Value { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.Models.ContainerAppSimpleEnvironmentVariable System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.Models.ContainerAppSimpleEnvironmentVariable System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] public readonly partial struct ContainerAppSourceControlOperationState : System.IEquatable { @@ -3441,6 +4735,7 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer public static Azure.ResourceManager.AppContainers.Models.ContainerAppStorageType EmptyDir { get { throw null; } } public static Azure.ResourceManager.AppContainers.Models.ContainerAppStorageType NfsAzureFile { get { throw null; } } public static Azure.ResourceManager.AppContainers.Models.ContainerAppStorageType Secret { get { throw null; } } + public static Azure.ResourceManager.AppContainers.Models.ContainerAppStorageType Smb { get { throw null; } } public bool Equals(Azure.ResourceManager.AppContainers.Models.ContainerAppStorageType other) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public override bool Equals(object obj) { throw null; } @@ -3493,10 +4788,22 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } + public partial class ContainerAppTimeoutPolicy : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ContainerAppTimeoutPolicy() { } + public int? ConnectionTimeoutInSeconds { get { throw null; } set { } } + public int? ResponseTimeoutInSeconds { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.Models.ContainerAppTimeoutPolicy System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.Models.ContainerAppTimeoutPolicy System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } public partial class ContainerAppTokenStore : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public ContainerAppTokenStore() { } - public string AzureBlobStorageSasUrlSettingName { get { throw null; } set { } } + public Azure.ResourceManager.AppContainers.Models.ContainerAppBlobStorageTokenStore AzureBlobStorage { get { throw null; } set { } } public bool? IsEnabled { get { throw null; } set { } } public double? TokenRefreshExtensionHours { get { throw null; } set { } } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } @@ -3629,10 +4936,88 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } + public enum ContainerAppWeekDay + { + Monday = 0, + Tuesday = 1, + Wednesday = 2, + Thursday = 3, + Friday = 4, + Saturday = 5, + Sunday = 6, + } + public partial class ContainerAppWorkflowArtifacts : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ContainerAppWorkflowArtifacts() { } + public System.BinaryData AppSettings { get { throw null; } set { } } + public System.BinaryData Files { get { throw null; } set { } } + public System.Collections.Generic.IList FilesToDelete { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.Models.ContainerAppWorkflowArtifacts System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.Models.ContainerAppWorkflowArtifacts System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ContainerAppWorkflowEnvelopeProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal ContainerAppWorkflowEnvelopeProperties() { } + public System.BinaryData Files { get { throw null; } } + public Azure.ResourceManager.AppContainers.Models.ContainerAppWorkflowState? FlowState { get { throw null; } } + public Azure.ResourceManager.AppContainers.Models.ContainerAppWorkflowHealth Health { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.Models.ContainerAppWorkflowEnvelopeProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.Models.ContainerAppWorkflowEnvelopeProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ContainerAppWorkflowHealth : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal ContainerAppWorkflowHealth() { } + public Azure.ResponseError Error { get { throw null; } } + public Azure.ResourceManager.AppContainers.Models.ContainerAppWorkflowHealthState State { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.Models.ContainerAppWorkflowHealth System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.Models.ContainerAppWorkflowHealth System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public enum ContainerAppWorkflowHealthState + { + Unknown = 0, + NotSpecified = 1, + Healthy = 2, + Unhealthy = 3, + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct ContainerAppWorkflowState : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public ContainerAppWorkflowState(string value) { throw null; } + public static Azure.ResourceManager.AppContainers.Models.ContainerAppWorkflowState Completed { get { throw null; } } + public static Azure.ResourceManager.AppContainers.Models.ContainerAppWorkflowState Deleted { get { throw null; } } + public static Azure.ResourceManager.AppContainers.Models.ContainerAppWorkflowState Disabled { get { throw null; } } + public static Azure.ResourceManager.AppContainers.Models.ContainerAppWorkflowState Enabled { get { throw null; } } + public static Azure.ResourceManager.AppContainers.Models.ContainerAppWorkflowState NotSpecified { get { throw null; } } + public static Azure.ResourceManager.AppContainers.Models.ContainerAppWorkflowState Suspended { get { throw null; } } + public bool Equals(Azure.ResourceManager.AppContainers.Models.ContainerAppWorkflowState other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.AppContainers.Models.ContainerAppWorkflowState left, Azure.ResourceManager.AppContainers.Models.ContainerAppWorkflowState right) { throw null; } + public static implicit operator Azure.ResourceManager.AppContainers.Models.ContainerAppWorkflowState (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.AppContainers.Models.ContainerAppWorkflowState left, Azure.ResourceManager.AppContainers.Models.ContainerAppWorkflowState right) { throw null; } + public override string ToString() { throw null; } + } public partial class ContainerAppWorkloadProfile : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public ContainerAppWorkloadProfile(string workloadProfileType, int minimumCount, int maximumCount) { } public ContainerAppWorkloadProfile(string name, string workloadProfileType) { } + public bool? EnableFips { get { throw null; } set { } } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public int MaximumCount { get { throw null; } set { } } public int? MaximumNodeCount { get { throw null; } set { } } @@ -3686,6 +5071,32 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } + public partial class ContainerExecutionStatus : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal ContainerExecutionStatus() { } + public string AdditionalInformation { get { throw null; } } + public int? Code { get { throw null; } } + public string Name { get { throw null; } } + public string Status { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.Models.ContainerExecutionStatus System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.Models.ContainerExecutionStatus System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ContainerRegistryWithCustomImage : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ContainerRegistryWithCustomImage(string server) { } + public string Image { get { throw null; } set { } } + public string Server { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.Models.ContainerRegistryWithCustomImage System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.Models.ContainerRegistryWithCustomImage System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] public readonly partial struct ContainerType : System.IEquatable { @@ -3717,6 +5128,250 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } + public partial class DaprAppHealth : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DaprAppHealth() { } + public bool? IsEnabled { get { throw null; } set { } } + public string Path { get { throw null; } set { } } + public int? ProbeIntervalSeconds { get { throw null; } set { } } + public int? ProbeTimeoutMilliseconds { get { throw null; } set { } } + public int? Threshold { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.Models.DaprAppHealth System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.Models.DaprAppHealth System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DaprComponentResiliencyPolicyCircuitBreakerPolicyConfiguration : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DaprComponentResiliencyPolicyCircuitBreakerPolicyConfiguration() { } + public int? ConsecutiveErrors { get { throw null; } set { } } + public int? IntervalInSeconds { get { throw null; } set { } } + public int? TimeoutInSeconds { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.Models.DaprComponentResiliencyPolicyCircuitBreakerPolicyConfiguration System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.Models.DaprComponentResiliencyPolicyCircuitBreakerPolicyConfiguration System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DaprComponentResiliencyPolicyConfiguration : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DaprComponentResiliencyPolicyConfiguration() { } + public Azure.ResourceManager.AppContainers.Models.DaprComponentResiliencyPolicyCircuitBreakerPolicyConfiguration CircuitBreakerPolicy { get { throw null; } set { } } + public Azure.ResourceManager.AppContainers.Models.DaprComponentResiliencyPolicyHttpRetryPolicyConfiguration HttpRetryPolicy { get { throw null; } set { } } + public int? ResponseTimeoutInSeconds { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.Models.DaprComponentResiliencyPolicyConfiguration System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.Models.DaprComponentResiliencyPolicyConfiguration System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DaprComponentResiliencyPolicyHttpRetryBackOffConfiguration : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DaprComponentResiliencyPolicyHttpRetryBackOffConfiguration() { } + public int? InitialDelayInMilliseconds { get { throw null; } set { } } + public int? MaxIntervalInMilliseconds { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.Models.DaprComponentResiliencyPolicyHttpRetryBackOffConfiguration System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.Models.DaprComponentResiliencyPolicyHttpRetryBackOffConfiguration System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DaprComponentResiliencyPolicyHttpRetryPolicyConfiguration : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DaprComponentResiliencyPolicyHttpRetryPolicyConfiguration() { } + public int? MaxRetries { get { throw null; } set { } } + public Azure.ResourceManager.AppContainers.Models.DaprComponentResiliencyPolicyHttpRetryBackOffConfiguration RetryBackOff { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.Models.DaprComponentResiliencyPolicyHttpRetryPolicyConfiguration System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.Models.DaprComponentResiliencyPolicyHttpRetryPolicyConfiguration System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DaprComponentServiceBinding : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DaprComponentServiceBinding() { } + public Azure.ResourceManager.AppContainers.Models.DaprServiceBindMetadata Metadata { get { throw null; } set { } } + public string Name { get { throw null; } set { } } + public string ServiceId { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.Models.DaprComponentServiceBinding System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.Models.DaprComponentServiceBinding System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DaprServiceBindMetadata : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DaprServiceBindMetadata() { } + public string Name { get { throw null; } set { } } + public string Value { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.Models.DaprServiceBindMetadata System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.Models.DaprServiceBindMetadata System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DaprSubscriptionBulkSubscribeConfig : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DaprSubscriptionBulkSubscribeConfig() { } + public bool? IsEnabled { get { throw null; } set { } } + public int? MaxAwaitDurationMs { get { throw null; } set { } } + public int? MaxMessagesCount { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.Models.DaprSubscriptionBulkSubscribeConfig System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.Models.DaprSubscriptionBulkSubscribeConfig System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DaprSubscriptionRouteRule : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DaprSubscriptionRouteRule() { } + public string Match { get { throw null; } set { } } + public string Path { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.Models.DaprSubscriptionRouteRule System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.Models.DaprSubscriptionRouteRule System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DaprSubscriptionRoutes : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DaprSubscriptionRoutes() { } + public string Default { get { throw null; } set { } } + public System.Collections.Generic.IList Rules { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.Models.DaprSubscriptionRoutes System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.Models.DaprSubscriptionRoutes System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DataDogConfiguration : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DataDogConfiguration() { } + public string Key { get { throw null; } set { } } + public string Site { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.Models.DataDogConfiguration System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.Models.DataDogConfiguration System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DestinationsConfiguration : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DestinationsConfiguration() { } + public Azure.ResourceManager.AppContainers.Models.DataDogConfiguration DataDogConfiguration { get { throw null; } set { } } + public System.Collections.Generic.IList OtlpConfigurations { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.Models.DestinationsConfiguration System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.Models.DestinationsConfiguration System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct DetectionStatus : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public DetectionStatus(string value) { throw null; } + public static Azure.ResourceManager.AppContainers.Models.DetectionStatus Failed { get { throw null; } } + public static Azure.ResourceManager.AppContainers.Models.DetectionStatus RegistryLoginFailed { get { throw null; } } + public static Azure.ResourceManager.AppContainers.Models.DetectionStatus Succeeded { get { throw null; } } + public bool Equals(Azure.ResourceManager.AppContainers.Models.DetectionStatus other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.AppContainers.Models.DetectionStatus left, Azure.ResourceManager.AppContainers.Models.DetectionStatus right) { throw null; } + public static implicit operator Azure.ResourceManager.AppContainers.Models.DetectionStatus (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.AppContainers.Models.DetectionStatus left, Azure.ResourceManager.AppContainers.Models.DetectionStatus right) { throw null; } + public override string ToString() { throw null; } + } + public partial class DiskEncryptionConfigurationKeyVaultConfiguration : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DiskEncryptionConfigurationKeyVaultConfiguration() { } + public Azure.Core.ResourceIdentifier AuthIdentity { get { throw null; } set { } } + public System.Uri KeyUri { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.Models.DiskEncryptionConfigurationKeyVaultConfiguration System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.Models.DiskEncryptionConfigurationKeyVaultConfiguration System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DotNetComponentConfigurationProperty : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DotNetComponentConfigurationProperty() { } + public string PropertyName { get { throw null; } set { } } + public string Value { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.Models.DotNetComponentConfigurationProperty System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.Models.DotNetComponentConfigurationProperty System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct DotNetComponentProvisioningState : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public DotNetComponentProvisioningState(string value) { throw null; } + public static Azure.ResourceManager.AppContainers.Models.DotNetComponentProvisioningState Canceled { get { throw null; } } + public static Azure.ResourceManager.AppContainers.Models.DotNetComponentProvisioningState Deleting { get { throw null; } } + public static Azure.ResourceManager.AppContainers.Models.DotNetComponentProvisioningState Failed { get { throw null; } } + public static Azure.ResourceManager.AppContainers.Models.DotNetComponentProvisioningState InProgress { get { throw null; } } + public static Azure.ResourceManager.AppContainers.Models.DotNetComponentProvisioningState Succeeded { get { throw null; } } + public bool Equals(Azure.ResourceManager.AppContainers.Models.DotNetComponentProvisioningState other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.AppContainers.Models.DotNetComponentProvisioningState left, Azure.ResourceManager.AppContainers.Models.DotNetComponentProvisioningState right) { throw null; } + public static implicit operator Azure.ResourceManager.AppContainers.Models.DotNetComponentProvisioningState (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.AppContainers.Models.DotNetComponentProvisioningState left, Azure.ResourceManager.AppContainers.Models.DotNetComponentProvisioningState right) { throw null; } + public override string ToString() { throw null; } + } + public partial class DotNetComponentServiceBind : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DotNetComponentServiceBind() { } + public string Name { get { throw null; } set { } } + public Azure.Core.ResourceIdentifier ServiceId { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.Models.DotNetComponentServiceBind System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.Models.DotNetComponentServiceBind System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct DotNetComponentType : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public DotNetComponentType(string value) { throw null; } + public static Azure.ResourceManager.AppContainers.Models.DotNetComponentType AspireDashboard { get { throw null; } } + public bool Equals(Azure.ResourceManager.AppContainers.Models.DotNetComponentType other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.AppContainers.Models.DotNetComponentType left, Azure.ResourceManager.AppContainers.Models.DotNetComponentType right) { throw null; } + public static implicit operator Azure.ResourceManager.AppContainers.Models.DotNetComponentType (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.AppContainers.Models.DotNetComponentType left, Azure.ResourceManager.AppContainers.Models.DotNetComponentType right) { throw null; } + public override string ToString() { throw null; } + } public partial class EncryptionSettings : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public EncryptionSettings() { } @@ -3742,6 +5397,222 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } + public partial class Header : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public Header() { } + public string Key { get { throw null; } set { } } + public string Value { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.Models.Header System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.Models.Header System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class HeaderMatch : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public HeaderMatch() { } + public string ExactMatch { get { throw null; } set { } } + public string Header { get { throw null; } set { } } + public string PrefixMatch { get { throw null; } set { } } + public string RegexMatch { get { throw null; } set { } } + public string SuffixMatch { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.Models.HeaderMatch System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.Models.HeaderMatch System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class HttpConnectionPool : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public HttpConnectionPool() { } + public int? Http1MaxPendingRequests { get { throw null; } set { } } + public int? Http2MaxRequests { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.Models.HttpConnectionPool System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.Models.HttpConnectionPool System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class HttpGet : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public HttpGet(System.Uri uri) { } + public string FileName { get { throw null; } set { } } + public System.Collections.Generic.IList Headers { get { throw null; } } + public System.Uri Uri { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.Models.HttpGet System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.Models.HttpGet System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class HttpRetryPolicy : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public HttpRetryPolicy() { } + public System.Collections.Generic.IList Errors { get { throw null; } } + public System.Collections.Generic.IList Headers { get { throw null; } } + public System.Collections.Generic.IList HttpStatusCodes { get { throw null; } } + public long? InitialDelayInMilliseconds { get { throw null; } set { } } + public long? MaxIntervalInMilliseconds { get { throw null; } set { } } + public int? MaxRetries { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.Models.HttpRetryPolicy System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.Models.HttpRetryPolicy System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class HttpRoute : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public HttpRoute() { } + public string ActionPrefixRewrite { get { throw null; } set { } } + public Azure.ResourceManager.AppContainers.Models.HttpRouteMatch Match { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.Models.HttpRoute System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.Models.HttpRoute System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class HttpRouteConfigProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public HttpRouteConfigProperties() { } + public System.Collections.Generic.IList CustomDomains { get { throw null; } } + public string Fqdn { get { throw null; } } + public System.Collections.Generic.IReadOnlyList ProvisioningErrors { get { throw null; } } + public Azure.ResourceManager.AppContainers.Models.HttpRouteProvisioningState? ProvisioningState { get { throw null; } } + public System.Collections.Generic.IList Rules { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.Models.HttpRouteConfigProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.Models.HttpRouteConfigProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class HttpRouteMatch : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public HttpRouteMatch() { } + public bool? CaseSensitive { get { throw null; } set { } } + public string Path { get { throw null; } set { } } + public string PathSeparatedPrefix { get { throw null; } set { } } + public string Prefix { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.Models.HttpRouteMatch System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.Models.HttpRouteMatch System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class HttpRouteProvisioningErrors : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal HttpRouteProvisioningErrors() { } + public string Message { get { throw null; } } + public System.DateTimeOffset? Timestamp { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.Models.HttpRouteProvisioningErrors System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.Models.HttpRouteProvisioningErrors System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct HttpRouteProvisioningState : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public HttpRouteProvisioningState(string value) { throw null; } + public static Azure.ResourceManager.AppContainers.Models.HttpRouteProvisioningState Canceled { get { throw null; } } + public static Azure.ResourceManager.AppContainers.Models.HttpRouteProvisioningState Deleting { get { throw null; } } + public static Azure.ResourceManager.AppContainers.Models.HttpRouteProvisioningState Failed { get { throw null; } } + public static Azure.ResourceManager.AppContainers.Models.HttpRouteProvisioningState Pending { get { throw null; } } + public static Azure.ResourceManager.AppContainers.Models.HttpRouteProvisioningState Succeeded { get { throw null; } } + public static Azure.ResourceManager.AppContainers.Models.HttpRouteProvisioningState Updating { get { throw null; } } + public static Azure.ResourceManager.AppContainers.Models.HttpRouteProvisioningState Waiting { get { throw null; } } + public bool Equals(Azure.ResourceManager.AppContainers.Models.HttpRouteProvisioningState other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.AppContainers.Models.HttpRouteProvisioningState left, Azure.ResourceManager.AppContainers.Models.HttpRouteProvisioningState right) { throw null; } + public static implicit operator Azure.ResourceManager.AppContainers.Models.HttpRouteProvisioningState (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.AppContainers.Models.HttpRouteProvisioningState left, Azure.ResourceManager.AppContainers.Models.HttpRouteProvisioningState right) { throw null; } + public override string ToString() { throw null; } + } + public partial class HttpRouteRule : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public HttpRouteRule() { } + public string Description { get { throw null; } set { } } + public System.Collections.Generic.IList Routes { get { throw null; } } + public System.Collections.Generic.IList Targets { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.Models.HttpRouteRule System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.Models.HttpRouteRule System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class HttpRouteTarget : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public HttpRouteTarget(string containerApp) { } + public string ContainerApp { get { throw null; } set { } } + public string Label { get { throw null; } set { } } + public string Revision { get { throw null; } set { } } + public int? Weight { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.Models.HttpRouteTarget System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.Models.HttpRouteTarget System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct ImageType : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public ImageType(string value) { throw null; } + public static Azure.ResourceManager.AppContainers.Models.ImageType CloudBuild { get { throw null; } } + public static Azure.ResourceManager.AppContainers.Models.ImageType ContainerImage { get { throw null; } } + public bool Equals(Azure.ResourceManager.AppContainers.Models.ImageType other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.AppContainers.Models.ImageType left, Azure.ResourceManager.AppContainers.Models.ImageType right) { throw null; } + public static implicit operator Azure.ResourceManager.AppContainers.Models.ImageType (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.AppContainers.Models.ImageType left, Azure.ResourceManager.AppContainers.Models.ImageType right) { throw null; } + public override string ToString() { throw null; } + } + public partial class IngressConfiguration : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public IngressConfiguration() { } + public int? HeaderCountLimit { get { throw null; } set { } } + public int? RequestIdleTimeout { get { throw null; } set { } } + public Azure.ResourceManager.AppContainers.Models.IngressConfigurationScale Scale { get { throw null; } set { } } + public int? TerminationGracePeriodSeconds { get { throw null; } set { } } + public string WorkloadProfileName { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.Models.IngressConfiguration System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.Models.IngressConfiguration System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class IngressConfigurationScale : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public IngressConfigurationScale() { } + public int? MaxReplicas { get { throw null; } set { } } + public int? MinReplicas { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.Models.IngressConfigurationScale System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.Models.IngressConfigurationScale System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } public partial class IngressPortMapping : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public IngressPortMapping(bool external, int targetPort) { } @@ -3755,6 +5626,24 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct IngressTargetPortHttpScheme : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public IngressTargetPortHttpScheme(string value) { throw null; } + public static Azure.ResourceManager.AppContainers.Models.IngressTargetPortHttpScheme Http { get { throw null; } } + public static Azure.ResourceManager.AppContainers.Models.IngressTargetPortHttpScheme Https { get { throw null; } } + public bool Equals(Azure.ResourceManager.AppContainers.Models.IngressTargetPortHttpScheme other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.AppContainers.Models.IngressTargetPortHttpScheme left, Azure.ResourceManager.AppContainers.Models.IngressTargetPortHttpScheme right) { throw null; } + public static implicit operator Azure.ResourceManager.AppContainers.Models.IngressTargetPortHttpScheme (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.AppContainers.Models.IngressTargetPortHttpScheme left, Azure.ResourceManager.AppContainers.Models.IngressTargetPortHttpScheme right) { throw null; } + public override string ToString() { throw null; } + } public partial class JavaComponentConfigurationProperty : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public JavaComponentConfigurationProperty() { } @@ -3890,6 +5779,91 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer public static bool operator !=(Azure.ResourceManager.AppContainers.Models.JobExecutionRunningState left, Azure.ResourceManager.AppContainers.Models.JobExecutionRunningState right) { throw null; } public override string ToString() { throw null; } } + public partial class LabelHistoryRecordItem : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal LabelHistoryRecordItem() { } + public string Revision { get { throw null; } } + public System.DateTimeOffset? Start { get { throw null; } } + public Azure.ResourceManager.AppContainers.Models.LabelHistoryRecordItemStatus? Status { get { throw null; } } + public System.DateTimeOffset? Stop { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.Models.LabelHistoryRecordItem System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.Models.LabelHistoryRecordItem System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct LabelHistoryRecordItemStatus : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public LabelHistoryRecordItemStatus(string value) { throw null; } + public static Azure.ResourceManager.AppContainers.Models.LabelHistoryRecordItemStatus Failed { get { throw null; } } + public static Azure.ResourceManager.AppContainers.Models.LabelHistoryRecordItemStatus Starting { get { throw null; } } + public static Azure.ResourceManager.AppContainers.Models.LabelHistoryRecordItemStatus Succeeded { get { throw null; } } + public bool Equals(Azure.ResourceManager.AppContainers.Models.LabelHistoryRecordItemStatus other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.AppContainers.Models.LabelHistoryRecordItemStatus left, Azure.ResourceManager.AppContainers.Models.LabelHistoryRecordItemStatus right) { throw null; } + public static implicit operator Azure.ResourceManager.AppContainers.Models.LabelHistoryRecordItemStatus (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.AppContainers.Models.LabelHistoryRecordItemStatus left, Azure.ResourceManager.AppContainers.Models.LabelHistoryRecordItemStatus right) { throw null; } + public override string ToString() { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct Level : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public Level(string value) { throw null; } + public static Azure.ResourceManager.AppContainers.Models.Level Debug { get { throw null; } } + public static Azure.ResourceManager.AppContainers.Models.Level Error { get { throw null; } } + public static Azure.ResourceManager.AppContainers.Models.Level Info { get { throw null; } } + public static Azure.ResourceManager.AppContainers.Models.Level Off { get { throw null; } } + public static Azure.ResourceManager.AppContainers.Models.Level Trace { get { throw null; } } + public static Azure.ResourceManager.AppContainers.Models.Level Warn { get { throw null; } } + public bool Equals(Azure.ResourceManager.AppContainers.Models.Level other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.AppContainers.Models.Level left, Azure.ResourceManager.AppContainers.Models.Level right) { throw null; } + public static implicit operator Azure.ResourceManager.AppContainers.Models.Level (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.AppContainers.Models.Level left, Azure.ResourceManager.AppContainers.Models.Level right) { throw null; } + public override string ToString() { throw null; } + } + public partial class LoggerSetting : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public LoggerSetting(string logger, Azure.ResourceManager.AppContainers.Models.Level level) { } + public Azure.ResourceManager.AppContainers.Models.Level Level { get { throw null; } set { } } + public string Logger { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.Models.LoggerSetting System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.Models.LoggerSetting System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct LogicAppsProxyMethod : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public LogicAppsProxyMethod(string value) { throw null; } + public static Azure.ResourceManager.AppContainers.Models.LogicAppsProxyMethod GET { get { throw null; } } + public static Azure.ResourceManager.AppContainers.Models.LogicAppsProxyMethod Post { get { throw null; } } + public bool Equals(Azure.ResourceManager.AppContainers.Models.LogicAppsProxyMethod other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.AppContainers.Models.LogicAppsProxyMethod left, Azure.ResourceManager.AppContainers.Models.LogicAppsProxyMethod right) { throw null; } + public static implicit operator Azure.ResourceManager.AppContainers.Models.LogicAppsProxyMethod (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.AppContainers.Models.LogicAppsProxyMethod left, Azure.ResourceManager.AppContainers.Models.LogicAppsProxyMethod right) { throw null; } + public override string ToString() { throw null; } + } [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] public readonly partial struct ManagedCertificateDomainControlValidation : System.IEquatable { @@ -3936,6 +5910,193 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } + public partial class MetricsConfiguration : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public MetricsConfiguration() { } + public System.Collections.Generic.IList Destinations { get { throw null; } } + public bool? IncludeKeda { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.Models.MetricsConfiguration System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.Models.MetricsConfiguration System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class NacosComponent : Azure.ResourceManager.AppContainers.Models.JavaComponentProperties, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public NacosComponent() { } + public string IngressFqdn { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.Models.NacosComponent System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.Models.NacosComponent System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class OpenTelemetryConfiguration : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public OpenTelemetryConfiguration() { } + public Azure.ResourceManager.AppContainers.Models.DestinationsConfiguration DestinationsConfiguration { get { throw null; } set { } } + public System.Collections.Generic.IList LogsDestinations { get { throw null; } } + public Azure.ResourceManager.AppContainers.Models.MetricsConfiguration MetricsConfiguration { get { throw null; } set { } } + public Azure.ResourceManager.AppContainers.Models.TracesConfiguration TracesConfiguration { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.Models.OpenTelemetryConfiguration System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.Models.OpenTelemetryConfiguration System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class OtlpConfiguration : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public OtlpConfiguration() { } + public string Endpoint { get { throw null; } set { } } + public System.Collections.Generic.IList Headers { get { throw null; } } + public bool? Insecure { get { throw null; } set { } } + public string Name { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.Models.OtlpConfiguration System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.Models.OtlpConfiguration System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct PatchApplyStatus : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public PatchApplyStatus(string value) { throw null; } + public static Azure.ResourceManager.AppContainers.Models.PatchApplyStatus Canceled { get { throw null; } } + public static Azure.ResourceManager.AppContainers.Models.PatchApplyStatus CreatingRevision { get { throw null; } } + public static Azure.ResourceManager.AppContainers.Models.PatchApplyStatus ImagePushPullFailed { get { throw null; } } + public static Azure.ResourceManager.AppContainers.Models.PatchApplyStatus ManuallySkipped { get { throw null; } } + public static Azure.ResourceManager.AppContainers.Models.PatchApplyStatus NotStarted { get { throw null; } } + public static Azure.ResourceManager.AppContainers.Models.PatchApplyStatus RebaseFailed { get { throw null; } } + public static Azure.ResourceManager.AppContainers.Models.PatchApplyStatus RebaseInProgress { get { throw null; } } + public static Azure.ResourceManager.AppContainers.Models.PatchApplyStatus RevisionCreationFailed { get { throw null; } } + public static Azure.ResourceManager.AppContainers.Models.PatchApplyStatus Succeeded { get { throw null; } } + public bool Equals(Azure.ResourceManager.AppContainers.Models.PatchApplyStatus other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.AppContainers.Models.PatchApplyStatus left, Azure.ResourceManager.AppContainers.Models.PatchApplyStatus right) { throw null; } + public static implicit operator Azure.ResourceManager.AppContainers.Models.PatchApplyStatus (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.AppContainers.Models.PatchApplyStatus left, Azure.ResourceManager.AppContainers.Models.PatchApplyStatus right) { throw null; } + public override string ToString() { throw null; } + } + public partial class PatchDetails : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal PatchDetails() { } + public Azure.ResourceManager.AppContainers.Models.DetectionStatus DetectionStatus { get { throw null; } } + public System.DateTimeOffset LastDetectionOn { get { throw null; } } + public string NewImageName { get { throw null; } } + public Azure.ResourceManager.AppContainers.Models.PatchDetailsNewLayer NewLayer { get { throw null; } } + public Azure.ResourceManager.AppContainers.Models.PatchDetailsOldLayer OldLayer { get { throw null; } } + public Azure.ResourceManager.AppContainers.Models.PatchType? PatchType { get { throw null; } } + public string TargetContainerName { get { throw null; } } + public string TargetImage { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.Models.PatchDetails System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.Models.PatchDetails System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class PatchDetailsNewLayer : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal PatchDetailsNewLayer() { } + public string FrameworkAndVersion { get { throw null; } } + public string Name { get { throw null; } } + public string OSAndVersion { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.Models.PatchDetailsNewLayer System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.Models.PatchDetailsNewLayer System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class PatchDetailsOldLayer : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal PatchDetailsOldLayer() { } + public string FrameworkAndVersion { get { throw null; } } + public string Name { get { throw null; } } + public string OSAndVersion { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.Models.PatchDetailsOldLayer System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.Models.PatchDetailsOldLayer System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct PatchingMode : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public PatchingMode(string value) { throw null; } + public static Azure.ResourceManager.AppContainers.Models.PatchingMode Automatic { get { throw null; } } + public static Azure.ResourceManager.AppContainers.Models.PatchingMode Disabled { get { throw null; } } + public static Azure.ResourceManager.AppContainers.Models.PatchingMode Manual { get { throw null; } } + public bool Equals(Azure.ResourceManager.AppContainers.Models.PatchingMode other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.AppContainers.Models.PatchingMode left, Azure.ResourceManager.AppContainers.Models.PatchingMode right) { throw null; } + public static implicit operator Azure.ResourceManager.AppContainers.Models.PatchingMode (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.AppContainers.Models.PatchingMode left, Azure.ResourceManager.AppContainers.Models.PatchingMode right) { throw null; } + public override string ToString() { throw null; } + } + public partial class PatchProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal PatchProperties() { } + public System.DateTimeOffset? CreatedOn { get { throw null; } } + public System.DateTimeOffset? LastModifiedOn { get { throw null; } } + public Azure.ResourceManager.AppContainers.Models.PatchApplyStatus? PatchApplyStatus { get { throw null; } } + public System.Collections.Generic.IReadOnlyList PatchDetails { get { throw null; } } + public Azure.Core.ResourceIdentifier TargetContainerAppId { get { throw null; } } + public Azure.Core.ResourceIdentifier TargetEnvironmentId { get { throw null; } } + public Azure.Core.ResourceIdentifier TargetRevisionId { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.Models.PatchProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.Models.PatchProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class PatchSkipConfig : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public PatchSkipConfig() { } + public bool? Skip { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.Models.PatchSkipConfig System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.Models.PatchSkipConfig System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct PatchType : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public PatchType(string value) { throw null; } + public static Azure.ResourceManager.AppContainers.Models.PatchType FrameworkAndOSSecurity { get { throw null; } } + public static Azure.ResourceManager.AppContainers.Models.PatchType FrameworkSecurity { get { throw null; } } + public static Azure.ResourceManager.AppContainers.Models.PatchType OSSecurity { get { throw null; } } + public static Azure.ResourceManager.AppContainers.Models.PatchType Other { get { throw null; } } + public bool Equals(Azure.ResourceManager.AppContainers.Models.PatchType other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.AppContainers.Models.PatchType left, Azure.ResourceManager.AppContainers.Models.PatchType right) { throw null; } + public static implicit operator Azure.ResourceManager.AppContainers.Models.PatchType (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.AppContainers.Models.PatchType left, Azure.ResourceManager.AppContainers.Models.PatchType right) { throw null; } + public override string ToString() { throw null; } + } [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] public readonly partial struct PoolManagementType : System.IEquatable { @@ -3954,6 +6115,49 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer public static bool operator !=(Azure.ResourceManager.AppContainers.Models.PoolManagementType left, Azure.ResourceManager.AppContainers.Models.PoolManagementType right) { throw null; } public override string ToString() { throw null; } } + public partial class PreBuildStep : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public PreBuildStep() { } + public string Description { get { throw null; } set { } } + public Azure.ResourceManager.AppContainers.Models.HttpGet HttpGet { get { throw null; } set { } } + public System.Collections.Generic.IList Scripts { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.Models.PreBuildStep System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.Models.PreBuildStep System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct PublicNetworkAccess : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public PublicNetworkAccess(string value) { throw null; } + public static Azure.ResourceManager.AppContainers.Models.PublicNetworkAccess Disabled { get { throw null; } } + public static Azure.ResourceManager.AppContainers.Models.PublicNetworkAccess Enabled { get { throw null; } } + public bool Equals(Azure.ResourceManager.AppContainers.Models.PublicNetworkAccess other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.AppContainers.Models.PublicNetworkAccess left, Azure.ResourceManager.AppContainers.Models.PublicNetworkAccess right) { throw null; } + public static implicit operator Azure.ResourceManager.AppContainers.Models.PublicNetworkAccess (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.AppContainers.Models.PublicNetworkAccess left, Azure.ResourceManager.AppContainers.Models.PublicNetworkAccess right) { throw null; } + public override string ToString() { throw null; } + } + public partial class ReplicaExecutionStatus : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal ReplicaExecutionStatus() { } + public System.Collections.Generic.IReadOnlyList Containers { get { throw null; } } + public string Name { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.Models.ReplicaExecutionStatus System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.Models.ReplicaExecutionStatus System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] public readonly partial struct RevisionRunningState : System.IEquatable { @@ -3976,6 +6180,46 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer public static bool operator !=(Azure.ResourceManager.AppContainers.Models.RevisionRunningState left, Azure.ResourceManager.AppContainers.Models.RevisionRunningState right) { throw null; } public override string ToString() { throw null; } } + public partial class ScgRoute : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ScgRoute(string id, System.Uri uri) { } + public System.Collections.Generic.IList Filters { get { throw null; } } + public string Id { get { throw null; } set { } } + public long? Order { get { throw null; } set { } } + public System.Collections.Generic.IList Predicates { get { throw null; } } + public System.Uri Uri { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.Models.ScgRoute System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.Models.ScgRoute System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ScheduledEntry : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ScheduledEntry(Azure.ResourceManager.AppContainers.Models.ContainerAppWeekDay weekDay, int startHourUtc, int durationHours) { } + public int DurationHours { get { throw null; } set { } } + public int StartHourUtc { get { throw null; } set { } } + public Azure.ResourceManager.AppContainers.Models.ContainerAppWeekDay WeekDay { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.Models.ScheduledEntry System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.Models.ScheduledEntry System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class SecretKeyVaultProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public SecretKeyVaultProperties() { } + public string Identity { get { throw null; } set { } } + public System.Uri KeyVaultUri { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.Models.SecretKeyVaultProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.Models.SecretKeyVaultProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } public partial class SecretVolumeItem : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public SecretVolumeItem() { } @@ -3996,6 +6240,7 @@ public SessionContainer() { } public System.Collections.Generic.IList Env { get { throw null; } } public string Image { get { throw null; } set { } } public string Name { get { throw null; } set { } } + public System.Collections.Generic.IList Probes { get { throw null; } } public Azure.ResourceManager.AppContainers.Models.SessionContainerResources Resources { get { throw null; } set { } } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.AppContainers.Models.SessionContainer System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -4139,6 +6384,82 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } + public partial class SessionProbe : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public SessionProbe() { } + public int? FailureThreshold { get { throw null; } set { } } + public Azure.ResourceManager.AppContainers.Models.SessionProbeHttpGet HttpGet { get { throw null; } set { } } + public int? InitialDelaySeconds { get { throw null; } set { } } + public int? PeriodSeconds { get { throw null; } set { } } + public Azure.ResourceManager.AppContainers.Models.SessionProbeType? ProbeType { get { throw null; } set { } } + public int? SuccessThreshold { get { throw null; } set { } } + public Azure.ResourceManager.AppContainers.Models.SessionProbeTcpSocket TcpSocket { get { throw null; } set { } } + public long? TerminationGracePeriodSeconds { get { throw null; } set { } } + public int? TimeoutSeconds { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.Models.SessionProbe System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.Models.SessionProbe System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class SessionProbeHttpGet : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public SessionProbeHttpGet(int port) { } + public string Host { get { throw null; } set { } } + public System.Collections.Generic.IList HttpHeaders { get { throw null; } } + public string Path { get { throw null; } set { } } + public int Port { get { throw null; } set { } } + public Azure.ResourceManager.AppContainers.Models.ContainerAppHttpScheme? Scheme { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.Models.SessionProbeHttpGet System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.Models.SessionProbeHttpGet System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class SessionProbeHttpGetHttpHeadersItem : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public SessionProbeHttpGetHttpHeadersItem(string name, string value) { } + public string Name { get { throw null; } set { } } + public string Value { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.Models.SessionProbeHttpGetHttpHeadersItem System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.Models.SessionProbeHttpGetHttpHeadersItem System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class SessionProbeTcpSocket : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public SessionProbeTcpSocket(int port) { } + public string Host { get { throw null; } set { } } + public int Port { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.Models.SessionProbeTcpSocket System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.Models.SessionProbeTcpSocket System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct SessionProbeType : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public SessionProbeType(string value) { throw null; } + public static Azure.ResourceManager.AppContainers.Models.SessionProbeType Liveness { get { throw null; } } + public static Azure.ResourceManager.AppContainers.Models.SessionProbeType Startup { get { throw null; } } + public bool Equals(Azure.ResourceManager.AppContainers.Models.SessionProbeType other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.AppContainers.Models.SessionProbeType left, Azure.ResourceManager.AppContainers.Models.SessionProbeType right) { throw null; } + public static implicit operator Azure.ResourceManager.AppContainers.Models.SessionProbeType (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.AppContainers.Models.SessionProbeType left, Azure.ResourceManager.AppContainers.Models.SessionProbeType right) { throw null; } + public override string ToString() { throw null; } + } public partial class SessionRegistryCredentials : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public SessionRegistryCredentials() { } @@ -4153,6 +6474,22 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } + public partial class SmbStorage : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public SmbStorage() { } + public Azure.ResourceManager.AppContainers.Models.ContainerAppAccessMode? AccessMode { get { throw null; } set { } } + public string Domain { get { throw null; } set { } } + public string Host { get { throw null; } set { } } + public string Password { get { throw null; } set { } } + public string ShareName { get { throw null; } set { } } + public string Username { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.Models.SmbStorage System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.Models.SmbStorage System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } public partial class SpringBootAdminComponent : Azure.ResourceManager.AppContainers.Models.JavaComponentProperties, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public SpringBootAdminComponent() { } @@ -4185,4 +6522,28 @@ protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter write string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } + public partial class SpringCloudGatewayComponent : Azure.ResourceManager.AppContainers.Models.JavaComponentProperties, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public SpringCloudGatewayComponent() { } + public string IngressFqdn { get { throw null; } } + public System.Collections.Generic.IList SpringCloudGatewayRoutes { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.Models.SpringCloudGatewayComponent System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.Models.SpringCloudGatewayComponent System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class TracesConfiguration : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public TracesConfiguration() { } + public System.Collections.Generic.IList Destinations { get { throw null; } } + public bool? IncludeDapr { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.Models.TracesConfiguration System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.Models.TracesConfiguration System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } } diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/api/Azure.ResourceManager.AppContainers.netstandard2.0.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/api/Azure.ResourceManager.AppContainers.netstandard2.0.cs index 7e9ebab3c1b5..50aca5d735fa 100644 --- a/sdk/containerapps/Azure.ResourceManager.AppContainers/api/Azure.ResourceManager.AppContainers.netstandard2.0.cs +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/api/Azure.ResourceManager.AppContainers.netstandard2.0.cs @@ -2,17 +2,26 @@ namespace Azure.ResourceManager.AppContainers { public static partial class AppContainersExtensions { + public static Azure.ResourceManager.AppContainers.AppContainersPrivateEndpointConnectionResource GetAppContainersPrivateEndpointConnectionResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.ResourceManager.AppContainers.AppResiliencyResource GetAppResiliencyResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } public static Azure.Pageable GetAvailableWorkloadProfiles(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, Azure.Core.AzureLocation location, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public static Azure.AsyncPageable GetAvailableWorkloadProfilesAsync(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, Azure.Core.AzureLocation location, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public static Azure.Pageable GetBillingMeters(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, Azure.Core.AzureLocation location, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public static Azure.AsyncPageable GetBillingMetersAsync(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, Azure.Core.AzureLocation location, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.ResourceManager.AppContainers.BuilderResource GetBuilderResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.Response GetBuilderResource(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string builderName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static System.Threading.Tasks.Task> GetBuilderResourceAsync(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string builderName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.ResourceManager.AppContainers.BuilderResourceCollection GetBuilderResources(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource) { throw null; } + public static Azure.Pageable GetBuilderResources(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.AsyncPageable GetBuilderResourcesAsync(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.ResourceManager.AppContainers.BuildResource GetBuildResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.ResourceManager.AppContainers.ConnectedEnvironmentDaprComponentResource GetConnectedEnvironmentDaprComponentResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } public static Azure.Response GetContainerApp(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string containerAppName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public static System.Threading.Tasks.Task> GetContainerAppAsync(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string containerAppName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public static Azure.ResourceManager.AppContainers.ContainerAppAuthConfigResource GetContainerAppAuthConfigResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } public static Azure.Response GetContainerAppConnectedEnvironment(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string connectedEnvironmentName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public static System.Threading.Tasks.Task> GetContainerAppConnectedEnvironmentAsync(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string connectedEnvironmentName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public static Azure.ResourceManager.AppContainers.ContainerAppConnectedEnvironmentCertificateResource GetContainerAppConnectedEnvironmentCertificateResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } - public static Azure.ResourceManager.AppContainers.ContainerAppConnectedEnvironmentDaprComponentResource GetContainerAppConnectedEnvironmentDaprComponentResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } public static Azure.ResourceManager.AppContainers.ContainerAppConnectedEnvironmentResource GetContainerAppConnectedEnvironmentResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } public static Azure.ResourceManager.AppContainers.ContainerAppConnectedEnvironmentCollection GetContainerAppConnectedEnvironments(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource) { throw null; } public static Azure.Pageable GetContainerAppConnectedEnvironments(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } @@ -48,10 +57,19 @@ public static partial class AppContainersExtensions public static Azure.ResourceManager.AppContainers.ContainerAppCollection GetContainerApps(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource) { throw null; } public static Azure.Pageable GetContainerApps(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public static Azure.AsyncPageable GetContainerAppsAsync(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.ResourceManager.AppContainers.ContainerAppsBuildResource GetContainerAppsBuildResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } public static Azure.ResourceManager.AppContainers.ContainerAppSourceControlResource GetContainerAppSourceControlResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.ResourceManager.AppContainers.ContainerAppsPatchResource GetContainerAppsPatchResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } public static Azure.Response GetCustomDomainVerificationId(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public static System.Threading.Tasks.Task> GetCustomDomainVerificationIdAsync(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.ResourceManager.AppContainers.DaprComponentResiliencyPolicyResource GetDaprComponentResiliencyPolicyResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.ResourceManager.AppContainers.DaprSubscriptionResource GetDaprSubscriptionResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.ResourceManager.AppContainers.DotNetComponentResource GetDotNetComponentResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.ResourceManager.AppContainers.HttpRouteConfigResource GetHttpRouteConfigResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } public static Azure.ResourceManager.AppContainers.JavaComponentResource GetJavaComponentResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.ResourceManager.AppContainers.LabelHistoryResource GetLabelHistoryResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.ResourceManager.AppContainers.LogicAppResource GetLogicAppResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.ResourceManager.AppContainers.MaintenanceConfigurationResource GetMaintenanceConfigurationResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } public static Azure.Response GetSessionPool(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string sessionPoolName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public static System.Threading.Tasks.Task> GetSessionPoolAsync(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string sessionPoolName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public static Azure.ResourceManager.AppContainers.SessionPoolResource GetSessionPoolResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } @@ -60,6 +78,109 @@ public static partial class AppContainersExtensions public static Azure.AsyncPageable GetSessionPoolsAsync(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public static Azure.Pageable GetUsages(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, Azure.Core.AzureLocation location, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public static Azure.AsyncPageable GetUsagesAsync(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, Azure.Core.AzureLocation location, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.ResourceManager.AppContainers.WorkflowEnvelopeResource GetWorkflowEnvelopeResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + } + public partial class AppContainersPrivateEndpointConnectionCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected AppContainersPrivateEndpointConnectionCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string privateEndpointConnectionName, Azure.ResourceManager.AppContainers.AppContainersPrivateEndpointConnectionData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string privateEndpointConnectionName, Azure.ResourceManager.AppContainers.AppContainersPrivateEndpointConnectionData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string privateEndpointConnectionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string privateEndpointConnectionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string privateEndpointConnectionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string privateEndpointConnectionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string privateEndpointConnectionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string privateEndpointConnectionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } + System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } + } + public partial class AppContainersPrivateEndpointConnectionData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public AppContainersPrivateEndpointConnectionData() { } + public Azure.ResourceManager.AppContainers.Models.AppContainersPrivateLinkServiceConnectionState ConnectionState { get { throw null; } set { } } + public System.Collections.Generic.IReadOnlyList GroupIds { get { throw null; } } + public Azure.Core.ResourceIdentifier PrivateEndpointId { get { throw null; } } + public Azure.ResourceManager.AppContainers.Models.AppContainersPrivateEndpointConnectionProvisioningState? ProvisioningState { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.AppContainersPrivateEndpointConnectionData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.AppContainersPrivateEndpointConnectionData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class AppContainersPrivateEndpointConnectionResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected AppContainersPrivateEndpointConnectionResource() { } + public virtual Azure.ResourceManager.AppContainers.AppContainersPrivateEndpointConnectionData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string environmentName, string privateEndpointConnectionName) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + Azure.ResourceManager.AppContainers.AppContainersPrivateEndpointConnectionData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.AppContainersPrivateEndpointConnectionData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.AppContainers.AppContainersPrivateEndpointConnectionData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.AppContainers.AppContainersPrivateEndpointConnectionData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public partial class AppResiliencyCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected AppResiliencyCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string name, Azure.ResourceManager.AppContainers.AppResiliencyData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string name, Azure.ResourceManager.AppContainers.AppResiliencyData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string name, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string name, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string name, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string name, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string name, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string name, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } + System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } + } + public partial class AppResiliencyData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public AppResiliencyData() { } + public Azure.ResourceManager.AppContainers.Models.CircuitBreakerPolicy CircuitBreakerPolicy { get { throw null; } set { } } + public Azure.ResourceManager.AppContainers.Models.HttpConnectionPool HttpConnectionPool { get { throw null; } set { } } + public Azure.ResourceManager.AppContainers.Models.HttpRetryPolicy HttpRetryPolicy { get { throw null; } set { } } + public int? MaxConnections { get { throw null; } set { } } + public int? TcpRetryMaxConnectAttempts { get { throw null; } set { } } + public Azure.ResourceManager.AppContainers.Models.ContainerAppTimeoutPolicy TimeoutPolicy { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.AppResiliencyData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.AppResiliencyData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class AppResiliencyResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected AppResiliencyResource() { } + public virtual Azure.ResourceManager.AppContainers.AppResiliencyData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string appName, string name) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + Azure.ResourceManager.AppContainers.AppResiliencyData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.AppResiliencyData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + public virtual Azure.Response Update(Azure.ResourceManager.AppContainers.AppResiliencyData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.ResourceManager.AppContainers.AppResiliencyData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } } public partial class AzureResourceManagerAppContainersContext : System.ClientModel.Primitives.ModelReaderWriterContext { @@ -67,6 +188,179 @@ internal AzureResourceManagerAppContainersContext() { } public static Azure.ResourceManager.AppContainers.AzureResourceManagerAppContainersContext Default { get { throw null; } } protected override bool TryGetTypeBuilderCore(System.Type type, out System.ClientModel.Primitives.ModelReaderWriterTypeBuilder builder) { throw null; } } + public partial class BuilderResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected BuilderResource() { } + public virtual Azure.ResourceManager.AppContainers.BuilderResourceData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public virtual Azure.Response AddTag(string key, string value, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> AddTagAsync(string key, string value, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string builderName) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response GetBuildResource(string buildName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetBuildResourceAsync(string buildName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.AppContainers.BuildResourceCollection GetBuildResources() { throw null; } + public virtual Azure.Response RemoveTag(string key, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> RemoveTagAsync(string key, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response SetTags(System.Collections.Generic.IDictionary tags, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> SetTagsAsync(System.Collections.Generic.IDictionary tags, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + Azure.ResourceManager.AppContainers.BuilderResourceData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.BuilderResourceData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.AppContainers.Models.BuilderResourcePatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.AppContainers.Models.BuilderResourcePatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public partial class BuilderResourceCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected BuilderResourceCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string builderName, Azure.ResourceManager.AppContainers.BuilderResourceData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string builderName, Azure.ResourceManager.AppContainers.BuilderResourceData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string builderName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string builderName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string builderName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string builderName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string builderName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string builderName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } + System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } + } + public partial class BuilderResourceData : Azure.ResourceManager.Models.TrackedResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public BuilderResourceData(Azure.Core.AzureLocation location) { } + public System.Collections.Generic.IList ContainerRegistries { get { throw null; } } + public Azure.Core.ResourceIdentifier EnvironmentId { get { throw null; } set { } } + public Azure.ResourceManager.Models.ManagedServiceIdentity Identity { get { throw null; } set { } } + public Azure.ResourceManager.AppContainers.Models.ContainerAppBuilderProvisioningState? ProvisioningState { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.BuilderResourceData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.BuilderResourceData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class BuildResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected BuildResource() { } + public virtual Azure.ResourceManager.AppContainers.BuildResourceData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string builderName, string buildName) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response GetBuildAuthToken(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetBuildAuthTokenAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + Azure.ResourceManager.AppContainers.BuildResourceData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.BuildResourceData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.AppContainers.BuildResourceData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.AppContainers.BuildResourceData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public partial class BuildResourceCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected BuildResourceCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string buildName, Azure.ResourceManager.AppContainers.BuildResourceData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string buildName, Azure.ResourceManager.AppContainers.BuildResourceData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string buildName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string buildName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string buildName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string buildName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string buildName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string buildName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } + System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } + } + public partial class BuildResourceData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public BuildResourceData() { } + public Azure.ResourceManager.AppContainers.Models.ContainerAppBuildStatus? BuildStatus { get { throw null; } } + public Azure.ResourceManager.AppContainers.Models.ContainerAppBuildConfiguration Configuration { get { throw null; } set { } } + public Azure.ResourceManager.AppContainers.Models.ContainerRegistryWithCustomImage DestinationContainerRegistry { get { throw null; } set { } } + public string LogStreamEndpoint { get { throw null; } } + public Azure.ResourceManager.AppContainers.Models.ContainerAppBuildProvisioningState? ProvisioningState { get { throw null; } } + public string TokenEndpoint { get { throw null; } } + public string UploadEndpoint { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.BuildResourceData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.BuildResourceData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ConnectedEnvironmentDaprComponentCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected ConnectedEnvironmentDaprComponentCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string componentName, Azure.ResourceManager.AppContainers.ConnectedEnvironmentDaprComponentData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string componentName, Azure.ResourceManager.AppContainers.ConnectedEnvironmentDaprComponentData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string componentName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string componentName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string componentName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string componentName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string componentName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string componentName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } + System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } + } + public partial class ConnectedEnvironmentDaprComponentData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ConnectedEnvironmentDaprComponentData() { } + public string ComponentType { get { throw null; } set { } } + public string DeploymentErrors { get { throw null; } } + public bool? IgnoreErrors { get { throw null; } set { } } + public string InitTimeout { get { throw null; } set { } } + public System.Collections.Generic.IList Metadata { get { throw null; } } + public Azure.ResourceManager.AppContainers.Models.ConnectedEnvironmentDaprComponentProvisioningState? ProvisioningState { get { throw null; } } + public System.Collections.Generic.IList Scopes { get { throw null; } } + public System.Collections.Generic.IList Secrets { get { throw null; } } + public string SecretStoreComponent { get { throw null; } set { } } + public System.Collections.Generic.IList ServiceComponentBind { get { throw null; } } + public string Version { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.ConnectedEnvironmentDaprComponentData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.ConnectedEnvironmentDaprComponentData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ConnectedEnvironmentDaprComponentResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected ConnectedEnvironmentDaprComponentResource() { } + public virtual Azure.ResourceManager.AppContainers.ConnectedEnvironmentDaprComponentData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string connectedEnvironmentName, string componentName) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetSecrets(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetSecretsAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + Azure.ResourceManager.AppContainers.ConnectedEnvironmentDaprComponentData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.ConnectedEnvironmentDaprComponentData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.AppContainers.ConnectedEnvironmentDaprComponentData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.AppContainers.ConnectedEnvironmentDaprComponentData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } public partial class ContainerAppAuthConfigCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable { protected ContainerAppAuthConfigCollection() { } @@ -186,8 +480,8 @@ protected ContainerAppConnectedEnvironmentCertificateResource() { } Azure.ResourceManager.AppContainers.ContainerAppCertificateData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - public virtual Azure.Response Update(Azure.ResourceManager.AppContainers.Models.ContainerAppCertificatePatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.ResourceManager.AppContainers.Models.ContainerAppCertificatePatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.AppContainers.Models.ContainerAppCertificatePatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.AppContainers.Models.ContainerAppCertificatePatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } } public partial class ContainerAppConnectedEnvironmentCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable { @@ -206,44 +500,6 @@ protected ContainerAppConnectedEnvironmentCollection() { } System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } } - public partial class ContainerAppConnectedEnvironmentDaprComponentCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable - { - protected ContainerAppConnectedEnvironmentDaprComponentCollection() { } - public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string componentName, Azure.ResourceManager.AppContainers.ContainerAppDaprComponentData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string componentName, Azure.ResourceManager.AppContainers.ContainerAppDaprComponentData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.Response Exists(string componentName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> ExistsAsync(string componentName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.Response Get(string componentName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.Pageable GetAll(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.AsyncPageable GetAllAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> GetAsync(string componentName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.NullableResponse GetIfExists(string componentName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string componentName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } - System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } - System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } - } - public partial class ContainerAppConnectedEnvironmentDaprComponentResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel - { - public static readonly Azure.Core.ResourceType ResourceType; - protected ContainerAppConnectedEnvironmentDaprComponentResource() { } - public virtual Azure.ResourceManager.AppContainers.ContainerAppDaprComponentData Data { get { throw null; } } - public virtual bool HasData { get { throw null; } } - public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string connectedEnvironmentName, string componentName) { throw null; } - public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.Pageable GetSecrets(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.AsyncPageable GetSecretsAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - Azure.ResourceManager.AppContainers.ContainerAppDaprComponentData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.ResourceManager.AppContainers.ContainerAppDaprComponentData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.AppContainers.ContainerAppDaprComponentData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.AppContainers.ContainerAppDaprComponentData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - } public partial class ContainerAppConnectedEnvironmentData : Azure.ResourceManager.Models.TrackedResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public ContainerAppConnectedEnvironmentData(Azure.Core.AzureLocation location) { } @@ -267,6 +523,8 @@ public partial class ContainerAppConnectedEnvironmentResource : Azure.ResourceMa protected ContainerAppConnectedEnvironmentResource() { } public virtual Azure.ResourceManager.AppContainers.ContainerAppConnectedEnvironmentData Data { get { throw null; } } public virtual bool HasData { get { throw null; } } + public virtual Azure.Response AddTag(string key, string value, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> AddTagAsync(string key, string value, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Response CheckNameAvailability(Azure.ResourceManager.AppContainers.Models.ContainerAppNameAvailabilityContent content, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> CheckNameAvailabilityAsync(Azure.ResourceManager.AppContainers.Models.ContainerAppNameAvailabilityContent content, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string connectedEnvironmentName) { throw null; } @@ -274,22 +532,26 @@ protected ContainerAppConnectedEnvironmentResource() { } public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response GetConnectedEnvironmentDaprComponent(string componentName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetConnectedEnvironmentDaprComponentAsync(string componentName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.AppContainers.ConnectedEnvironmentDaprComponentCollection GetConnectedEnvironmentDaprComponents() { throw null; } public virtual Azure.Response GetContainerAppConnectedEnvironmentCertificate(string certificateName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> GetContainerAppConnectedEnvironmentCertificateAsync(string certificateName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.ResourceManager.AppContainers.ContainerAppConnectedEnvironmentCertificateCollection GetContainerAppConnectedEnvironmentCertificates() { throw null; } - public virtual Azure.Response GetContainerAppConnectedEnvironmentDaprComponent(string componentName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> GetContainerAppConnectedEnvironmentDaprComponentAsync(string componentName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.ResourceManager.AppContainers.ContainerAppConnectedEnvironmentDaprComponentCollection GetContainerAppConnectedEnvironmentDaprComponents() { throw null; } public virtual Azure.Response GetContainerAppConnectedEnvironmentStorage(string storageName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> GetContainerAppConnectedEnvironmentStorageAsync(string storageName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.ResourceManager.AppContainers.ContainerAppConnectedEnvironmentStorageCollection GetContainerAppConnectedEnvironmentStorages() { throw null; } + public virtual Azure.Response RemoveTag(string key, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> RemoveTagAsync(string key, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response SetTags(System.Collections.Generic.IDictionary tags, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> SetTagsAsync(System.Collections.Generic.IDictionary tags, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } Azure.ResourceManager.AppContainers.ContainerAppConnectedEnvironmentData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.AppContainers.ContainerAppConnectedEnvironmentData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - public virtual Azure.Response Update(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> UpdateAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Update(Azure.ResourceManager.AppContainers.Models.ContainerAppConnectedEnvironmentPatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.ResourceManager.AppContainers.Models.ContainerAppConnectedEnvironmentPatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } } public partial class ContainerAppConnectedEnvironmentStorageCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable { @@ -311,7 +573,7 @@ protected ContainerAppConnectedEnvironmentStorageCollection() { } public partial class ContainerAppConnectedEnvironmentStorageData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public ContainerAppConnectedEnvironmentStorageData() { } - public Azure.ResourceManager.AppContainers.Models.ContainerAppAzureFileProperties ConnectedEnvironmentStorageAzureFile { get { throw null; } set { } } + public Azure.ResourceManager.AppContainers.Models.ConnectedEnvironmentStorageProperties Properties { get { throw null; } set { } } protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.AppContainers.ContainerAppConnectedEnvironmentStorageData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } @@ -348,6 +610,7 @@ public ContainerAppDaprComponentData() { } public System.Collections.Generic.IList Scopes { get { throw null; } } public System.Collections.Generic.IList Secrets { get { throw null; } } public string SecretStoreComponent { get { throw null; } set { } } + public System.Collections.Generic.IList ServiceComponentBind { get { throw null; } } public string Version { get { throw null; } set { } } protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.AppContainers.ContainerAppDaprComponentData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -361,10 +624,12 @@ public partial class ContainerAppData : Azure.ResourceManager.Models.TrackedReso public ContainerAppData(Azure.Core.AzureLocation location) { } public Azure.ResourceManager.AppContainers.Models.ContainerAppConfiguration Configuration { get { throw null; } set { } } public string CustomDomainVerificationId { get { throw null; } } + public string DeploymentErrors { get { throw null; } } public Azure.Core.ResourceIdentifier EnvironmentId { get { throw null; } set { } } public System.Uri EventStreamEndpoint { get { throw null; } } public Azure.ResourceManager.AppContainers.Models.ContainerAppExtendedLocation ExtendedLocation { get { throw null; } set { } } public Azure.ResourceManager.Models.ManagedServiceIdentity Identity { get { throw null; } set { } } + public Azure.ResourceManager.AppContainers.Models.AppContainersKind? Kind { get { throw null; } set { } } public string LatestReadyRevisionName { get { throw null; } } public string LatestRevisionFqdn { get { throw null; } } public string LatestRevisionName { get { throw null; } } @@ -374,6 +639,7 @@ public ContainerAppData(Azure.Core.AzureLocation location) { } [System.ObsoleteAttribute("This property is obsolete and will be removed in a future release", false)] public System.Collections.Generic.IReadOnlyList OutboundIPAddresses { get { throw null; } } public System.Collections.Generic.IReadOnlyList OutboundIPAddressList { get { throw null; } } + public Azure.ResourceManager.AppContainers.Models.PatchingMode? PatchingMode { get { throw null; } set { } } public Azure.ResourceManager.AppContainers.Models.ContainerAppProvisioningState? ProvisioningState { get { throw null; } } public Azure.ResourceManager.AppContainers.Models.ContainerAppRunningStatus? RunningStatus { get { throw null; } } public Azure.ResourceManager.AppContainers.Models.ContainerAppTemplate Template { get { throw null; } set { } } @@ -496,9 +762,11 @@ public ContainerAppJobData(Azure.Core.AzureLocation location) { } public Azure.ResourceManager.AppContainers.Models.ContainerAppJobConfiguration Configuration { get { throw null; } set { } } public string EnvironmentId { get { throw null; } set { } } public string EventStreamEndpoint { get { throw null; } } + public Azure.ResourceManager.AppContainers.Models.ContainerAppExtendedLocation ExtendedLocation { get { throw null; } set { } } public Azure.ResourceManager.Models.ManagedServiceIdentity Identity { get { throw null; } set { } } public System.Collections.Generic.IReadOnlyList OutboundIPAddresses { get { throw null; } } public Azure.ResourceManager.AppContainers.Models.ContainerAppJobProvisioningState? ProvisioningState { get { throw null; } } + public Azure.ResourceManager.AppContainers.Models.ContainerAppJobRunningState? RunningState { get { throw null; } } public Azure.ResourceManager.AppContainers.Models.ContainerAppJobTemplate Template { get { throw null; } set { } } public string WorkloadProfileName { get { throw null; } set { } } protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } @@ -581,6 +849,7 @@ protected ContainerAppJobExecutionCollection() { } public partial class ContainerAppJobExecutionData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { internal ContainerAppJobExecutionData() { } + public System.Collections.Generic.IReadOnlyList DetailedStatusReplicas { get { throw null; } } public System.DateTimeOffset? EndOn { get { throw null; } } public System.DateTimeOffset? StartOn { get { throw null; } } public Azure.ResourceManager.AppContainers.Models.JobExecutionRunningState? Status { get { throw null; } } @@ -635,12 +904,16 @@ protected ContainerAppJobResource() { } public virtual Azure.AsyncPageable GetSecretsAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Response RemoveTag(string key, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> RemoveTagAsync(string key, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Resume(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ResumeAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Response SetTags(System.Collections.Generic.IDictionary tags, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> SetTagsAsync(System.Collections.Generic.IDictionary tags, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.ResourceManager.ArmOperation Start(Azure.WaitUntil waitUntil, Azure.ResourceManager.AppContainers.Models.ContainerAppJobExecutionTemplate template = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> StartAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.AppContainers.Models.ContainerAppJobExecutionTemplate template = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.ResourceManager.ArmOperation StopMultipleExecutions(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> StopMultipleExecutionsAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Suspend(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> SuspendAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } Azure.ResourceManager.AppContainers.ContainerAppJobData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.AppContainers.ContainerAppJobData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -789,6 +1062,9 @@ protected ContainerAppManagedEnvironmentDaprComponentResource() { } public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.AppContainers.DaprComponentResiliencyPolicyCollection GetDaprComponentResiliencyPolicies() { throw null; } + public virtual Azure.Response GetDaprComponentResiliencyPolicy(string name, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetDaprComponentResiliencyPolicyAsync(string name, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Pageable GetSecrets(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.AsyncPageable GetSecretsAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } Azure.ResourceManager.AppContainers.ContainerAppDaprComponentData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -802,22 +1078,30 @@ protected ContainerAppManagedEnvironmentDaprComponentResource() { } public partial class ContainerAppManagedEnvironmentData : Azure.ResourceManager.Models.TrackedResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public ContainerAppManagedEnvironmentData(Azure.Core.AzureLocation location) { } + public string AppInsightsConnectionString { get { throw null; } set { } } public Azure.ResourceManager.AppContainers.Models.ContainerAppLogsConfiguration AppLogsConfiguration { get { throw null; } set { } } + public System.Collections.Generic.IList AvailabilityZones { get { throw null; } } public Azure.ResourceManager.AppContainers.Models.ContainerAppCustomDomainConfiguration CustomDomainConfiguration { get { throw null; } set { } } public string DaprAIConnectionString { get { throw null; } set { } } public string DaprAIInstrumentationKey { get { throw null; } set { } } public string DaprVersion { get { throw null; } } public string DefaultDomain { get { throw null; } } public string DeploymentErrors { get { throw null; } } + public Azure.ResourceManager.AppContainers.Models.DiskEncryptionConfigurationKeyVaultConfiguration DiskEncryptionKeyVaultConfiguration { get { throw null; } set { } } public string EventStreamEndpoint { get { throw null; } } public Azure.ResourceManager.Models.ManagedServiceIdentity Identity { get { throw null; } set { } } public string InfrastructureResourceGroup { get { throw null; } set { } } + public Azure.ResourceManager.AppContainers.Models.IngressConfiguration IngressConfiguration { get { throw null; } set { } } public bool? IsEnabled { get { throw null; } set { } } public bool? IsMtlsEnabled { get { throw null; } set { } } public bool? IsZoneRedundant { get { throw null; } set { } } public string KedaVersion { get { throw null; } } public string Kind { get { throw null; } set { } } + public Azure.ResourceManager.AppContainers.Models.OpenTelemetryConfiguration OpenTelemetryConfiguration { get { throw null; } set { } } + public System.Collections.Generic.IReadOnlyList PrivateEndpointConnections { get { throw null; } } + public string PrivateLinkDefaultDomain { get { throw null; } } public Azure.ResourceManager.AppContainers.Models.ContainerAppEnvironmentProvisioningState? ProvisioningState { get { throw null; } } + public Azure.ResourceManager.AppContainers.Models.PublicNetworkAccess? PublicNetworkAccess { get { throw null; } set { } } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public Azure.ResourceManager.AppContainers.Models.AppContainersSkuName? SkuName { get { throw null; } set { } } public System.Net.IPAddress StaticIP { get { throw null; } } @@ -889,6 +1173,9 @@ protected ContainerAppManagedEnvironmentResource() { } public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response GetAppContainersPrivateEndpointConnection(string privateEndpointConnectionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAppContainersPrivateEndpointConnectionAsync(string privateEndpointConnectionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.AppContainers.AppContainersPrivateEndpointConnectionCollection GetAppContainersPrivateEndpointConnections() { throw null; } public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Response GetAuthToken(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> GetAuthTokenAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } @@ -908,9 +1195,23 @@ protected ContainerAppManagedEnvironmentResource() { } public virtual Azure.Response GetContainerAppManagedEnvironmentStorage(string storageName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> GetContainerAppManagedEnvironmentStorageAsync(string storageName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.ResourceManager.AppContainers.ContainerAppManagedEnvironmentStorageCollection GetContainerAppManagedEnvironmentStorages() { throw null; } + public virtual Azure.Response GetDaprSubscription(string name, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetDaprSubscriptionAsync(string name, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.AppContainers.DaprSubscriptionCollection GetDaprSubscriptions() { throw null; } + public virtual Azure.Response GetDotNetComponent(string name, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetDotNetComponentAsync(string name, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.AppContainers.DotNetComponentCollection GetDotNetComponents() { throw null; } + public virtual Azure.Response GetHttpRouteConfig(string httpRouteName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetHttpRouteConfigAsync(string httpRouteName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.AppContainers.HttpRouteConfigCollection GetHttpRouteConfigs() { throw null; } public virtual Azure.Response GetJavaComponent(string name, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> GetJavaComponentAsync(string name, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.ResourceManager.AppContainers.JavaComponentCollection GetJavaComponents() { throw null; } + public virtual Azure.Response GetMaintenanceConfigurationResource(string configName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetMaintenanceConfigurationResourceAsync(string configName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.AppContainers.MaintenanceConfigurationResourceCollection GetMaintenanceConfigurationResources() { throw null; } + public virtual Azure.Pageable GetManagedEnvironmentPrivateLinkResources(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetManagedEnvironmentPrivateLinkResourcesAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Pageable GetManagedEnvironmentUsages(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.AsyncPageable GetManagedEnvironmentUsagesAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Pageable GetWorkloadProfileStates(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } @@ -1033,6 +1334,9 @@ protected ContainerAppResource() { } public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.AppContainers.AppResiliencyCollection GetAppResiliencies() { throw null; } + public virtual Azure.Response GetAppResiliency(string name, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAppResiliencyAsync(string name, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Response GetAuthToken(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> GetAuthTokenAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } @@ -1049,11 +1353,23 @@ protected ContainerAppResource() { } public virtual Azure.Response GetContainerAppRevision(string revisionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> GetContainerAppRevisionAsync(string revisionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.ResourceManager.AppContainers.ContainerAppRevisionCollection GetContainerAppRevisions() { throw null; } + public virtual Azure.Response GetContainerAppsBuildResource(string buildName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetContainerAppsBuildResourceAsync(string buildName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.AppContainers.ContainerAppsBuildResourceCollection GetContainerAppsBuildResources() { throw null; } public virtual Azure.Response GetContainerAppSourceControl(string sourceControlName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> GetContainerAppSourceControlAsync(string sourceControlName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.ResourceManager.AppContainers.ContainerAppSourceControlCollection GetContainerAppSourceControls() { throw null; } + public virtual Azure.Response GetContainerAppsPatchResource(string patchName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetContainerAppsPatchResourceAsync(string patchName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.AppContainers.ContainerAppsPatchResourceCollection GetContainerAppsPatchResources() { throw null; } public virtual Azure.Response GetCustomHostNameAnalysis(string customHostname = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> GetCustomHostNameAnalysisAsync(string customHostname = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.AppContainers.LabelHistoryCollection GetLabelHistories() { throw null; } + public virtual Azure.Response GetLabelHistory(string labelName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetLabelHistoryAsync(string labelName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response GetLogicApp(string logicAppName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetLogicAppAsync(string logicAppName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.AppContainers.LogicAppCollection GetLogicApps() { throw null; } public virtual Azure.Pageable GetSecrets(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.AsyncPageable GetSecretsAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Response RemoveTag(string key, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } @@ -1094,6 +1410,7 @@ public ContainerAppRevisionData() { } public string Fqdn { get { throw null; } } public Azure.ResourceManager.AppContainers.Models.ContainerAppRevisionHealthState? HealthState { get { throw null; } } public bool? IsActive { get { throw null; } } + public System.Collections.Generic.IReadOnlyList Labels { get { throw null; } } public System.DateTimeOffset? LastActiveOn { get { throw null; } } public string ProvisioningError { get { throw null; } } public Azure.ResourceManager.AppContainers.Models.ContainerAppRevisionProvisioningState? ProvisioningState { get { throw null; } } @@ -1124,6 +1441,8 @@ protected ContainerAppRevisionResource() { } public virtual Azure.Response GetContainerAppReplica(string replicaName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> GetContainerAppReplicaAsync(string replicaName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.ResourceManager.AppContainers.ContainerAppReplicaCollection GetContainerAppReplicas() { throw null; } + public virtual Azure.Response InvokeFunctionsHostFunctionsExtension(string functionAppName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> InvokeFunctionsHostFunctionsExtensionAsync(string functionAppName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Response RestartRevision(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task RestartRevisionAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } Azure.ResourceManager.AppContainers.ContainerAppRevisionData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -1132,11 +1451,58 @@ protected ContainerAppRevisionResource() { } string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } + public partial class ContainerAppsBuildResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected ContainerAppsBuildResource() { } + public virtual Azure.ResourceManager.AppContainers.ContainerAppsBuildResourceData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string containerAppName, string buildName) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + Azure.ResourceManager.AppContainers.ContainerAppsBuildResourceData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.ContainerAppsBuildResourceData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ContainerAppsBuildResourceCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected ContainerAppsBuildResourceCollection() { } + public virtual Azure.Response Exists(string buildName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string buildName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string buildName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string buildName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string buildName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string buildName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } + System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } + } + public partial class ContainerAppsBuildResourceData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ContainerAppsBuildResourceData() { } + public Azure.ResourceManager.AppContainers.Models.ContainerAppBuildStatus? BuildStatus { get { throw null; } } + public Azure.ResourceManager.AppContainers.Models.ContainerAppsBuildConfiguration Configuration { get { throw null; } } + public Azure.ResourceManager.AppContainers.Models.ContainerRegistryWithCustomImage DestinationContainerRegistry { get { throw null; } } + public string LogStreamEndpoint { get { throw null; } } + public Azure.ResourceManager.AppContainers.Models.ContainerAppBuildProvisioningState? ProvisioningState { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.ContainerAppsBuildResourceData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.ContainerAppsBuildResourceData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } public partial class ContainerAppSourceControlCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable { protected ContainerAppSourceControlCollection() { } - public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string sourceControlName, Azure.ResourceManager.AppContainers.ContainerAppSourceControlData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string sourceControlName, Azure.ResourceManager.AppContainers.ContainerAppSourceControlData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string sourceControlName, Azure.ResourceManager.AppContainers.ContainerAppSourceControlData data, string xMsGitHubAuxiliary = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string sourceControlName, Azure.ResourceManager.AppContainers.ContainerAppSourceControlData data, string xMsGitHubAuxiliary = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Response Exists(string sourceControlName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> ExistsAsync(string sourceControlName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Response Get(string sourceControlName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } @@ -1170,8 +1536,8 @@ protected ContainerAppSourceControlResource() { } public virtual Azure.ResourceManager.AppContainers.ContainerAppSourceControlData Data { get { throw null; } } public virtual bool HasData { get { throw null; } } public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string containerAppName, string sourceControlName) { throw null; } - public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, string xMsGitHubAuxiliary = null, bool? ignoreWorkflowDeletionFailure = default(bool?), bool? deleteWorkflow = default(bool?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, string xMsGitHubAuxiliary = null, bool? ignoreWorkflowDeletionFailure = default(bool?), bool? deleteWorkflow = default(bool?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } Azure.ResourceManager.AppContainers.ContainerAppSourceControlData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -1179,8 +1545,253 @@ protected ContainerAppSourceControlResource() { } Azure.ResourceManager.AppContainers.ContainerAppSourceControlData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.AppContainers.ContainerAppSourceControlData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.AppContainers.ContainerAppSourceControlData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.AppContainers.ContainerAppSourceControlData data, string xMsGitHubAuxiliary = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.AppContainers.ContainerAppSourceControlData data, string xMsGitHubAuxiliary = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public partial class ContainerAppsPatchResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected ContainerAppsPatchResource() { } + public virtual Azure.ResourceManager.AppContainers.ContainerAppsPatchResourceData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public virtual Azure.ResourceManager.ArmOperation Apply(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ApplyAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string containerAppName, string patchName) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.ArmOperation SkipConfigure(Azure.WaitUntil waitUntil, Azure.ResourceManager.AppContainers.Models.PatchSkipConfig patchSkipConfig, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task SkipConfigureAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.AppContainers.Models.PatchSkipConfig patchSkipConfig, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + Azure.ResourceManager.AppContainers.ContainerAppsPatchResourceData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.ContainerAppsPatchResourceData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ContainerAppsPatchResourceCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected ContainerAppsPatchResourceCollection() { } + public virtual Azure.Response Exists(string patchName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string patchName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string patchName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(string filter = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(string filter = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string patchName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string patchName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string patchName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } + System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } + } + public partial class ContainerAppsPatchResourceData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ContainerAppsPatchResourceData() { } + public Azure.ResourceManager.AppContainers.Models.PatchProperties Properties { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.ContainerAppsPatchResourceData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.ContainerAppsPatchResourceData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DaprComponentResiliencyPolicyCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected DaprComponentResiliencyPolicyCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string name, Azure.ResourceManager.AppContainers.DaprComponentResiliencyPolicyData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string name, Azure.ResourceManager.AppContainers.DaprComponentResiliencyPolicyData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string name, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string name, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string name, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string name, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string name, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string name, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } + System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } + } + public partial class DaprComponentResiliencyPolicyData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DaprComponentResiliencyPolicyData() { } + public Azure.ResourceManager.AppContainers.Models.DaprComponentResiliencyPolicyConfiguration InboundPolicy { get { throw null; } set { } } + public Azure.ResourceManager.AppContainers.Models.DaprComponentResiliencyPolicyConfiguration OutboundPolicy { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.DaprComponentResiliencyPolicyData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.DaprComponentResiliencyPolicyData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DaprComponentResiliencyPolicyResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected DaprComponentResiliencyPolicyResource() { } + public virtual Azure.ResourceManager.AppContainers.DaprComponentResiliencyPolicyData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string environmentName, string componentName, string name) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + Azure.ResourceManager.AppContainers.DaprComponentResiliencyPolicyData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.DaprComponentResiliencyPolicyData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.AppContainers.DaprComponentResiliencyPolicyData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.AppContainers.DaprComponentResiliencyPolicyData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public partial class DaprSubscriptionCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected DaprSubscriptionCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string name, Azure.ResourceManager.AppContainers.DaprSubscriptionData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string name, Azure.ResourceManager.AppContainers.DaprSubscriptionData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string name, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string name, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string name, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string name, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string name, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string name, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } + System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } + } + public partial class DaprSubscriptionData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DaprSubscriptionData() { } + public Azure.ResourceManager.AppContainers.Models.DaprSubscriptionBulkSubscribeConfig BulkSubscribe { get { throw null; } set { } } + public string DeadLetterTopic { get { throw null; } set { } } + public System.Collections.Generic.IDictionary Metadata { get { throw null; } } + public string PubsubName { get { throw null; } set { } } + public Azure.ResourceManager.AppContainers.Models.DaprSubscriptionRoutes Routes { get { throw null; } set { } } + public System.Collections.Generic.IList Scopes { get { throw null; } } + public string Topic { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.DaprSubscriptionData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.DaprSubscriptionData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DaprSubscriptionResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected DaprSubscriptionResource() { } + public virtual Azure.ResourceManager.AppContainers.DaprSubscriptionData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string environmentName, string name) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + Azure.ResourceManager.AppContainers.DaprSubscriptionData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.DaprSubscriptionData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.AppContainers.DaprSubscriptionData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.AppContainers.DaprSubscriptionData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public partial class DotNetComponentCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected DotNetComponentCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string name, Azure.ResourceManager.AppContainers.DotNetComponentData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string name, Azure.ResourceManager.AppContainers.DotNetComponentData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string name, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string name, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string name, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string name, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string name, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string name, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } + System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } + } + public partial class DotNetComponentData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DotNetComponentData() { } + public Azure.ResourceManager.AppContainers.Models.DotNetComponentType? ComponentType { get { throw null; } set { } } + public System.Collections.Generic.IList Configurations { get { throw null; } } + public Azure.ResourceManager.AppContainers.Models.DotNetComponentProvisioningState? ProvisioningState { get { throw null; } } + public System.Collections.Generic.IList ServiceBinds { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.DotNetComponentData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.DotNetComponentData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DotNetComponentResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected DotNetComponentResource() { } + public virtual Azure.ResourceManager.AppContainers.DotNetComponentData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string environmentName, string name) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + Azure.ResourceManager.AppContainers.DotNetComponentData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.DotNetComponentData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.AppContainers.DotNetComponentData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.AppContainers.DotNetComponentData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public partial class HttpRouteConfigCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected HttpRouteConfigCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string httpRouteName, Azure.ResourceManager.AppContainers.HttpRouteConfigData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string httpRouteName, Azure.ResourceManager.AppContainers.HttpRouteConfigData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string httpRouteName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string httpRouteName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string httpRouteName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string httpRouteName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string httpRouteName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string httpRouteName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } + System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } + } + public partial class HttpRouteConfigData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public HttpRouteConfigData() { } + public Azure.ResourceManager.AppContainers.Models.HttpRouteConfigProperties Properties { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.HttpRouteConfigData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.HttpRouteConfigData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class HttpRouteConfigResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected HttpRouteConfigResource() { } + public virtual Azure.ResourceManager.AppContainers.HttpRouteConfigData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string environmentName, string httpRouteName) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + Azure.ResourceManager.AppContainers.HttpRouteConfigData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.HttpRouteConfigData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + public virtual Azure.Response Update(Azure.ResourceManager.AppContainers.HttpRouteConfigData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.ResourceManager.AppContainers.HttpRouteConfigData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } } public partial class JavaComponentCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable { @@ -1229,6 +1840,147 @@ protected JavaComponentResource() { } public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.AppContainers.JavaComponentData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.AppContainers.JavaComponentData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } } + public partial class LabelHistoryCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected LabelHistoryCollection() { } + public virtual Azure.Response Exists(string labelName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string labelName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string labelName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(string filter = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(string filter = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string labelName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string labelName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string labelName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } + System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } + } + public partial class LabelHistoryData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public LabelHistoryData() { } + public System.Collections.Generic.IReadOnlyList LabelHistoryRecords { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.LabelHistoryData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.LabelHistoryData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class LabelHistoryResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected LabelHistoryResource() { } + public virtual Azure.ResourceManager.AppContainers.LabelHistoryData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string containerAppName, string labelName) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + Azure.ResourceManager.AppContainers.LabelHistoryData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.LabelHistoryData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class LogicAppCollection : Azure.ResourceManager.ArmCollection + { + protected LogicAppCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string logicAppName, Azure.ResourceManager.AppContainers.LogicAppData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string logicAppName, Azure.ResourceManager.AppContainers.LogicAppData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string logicAppName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string logicAppName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string logicAppName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string logicAppName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string logicAppName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string logicAppName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public partial class LogicAppData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public LogicAppData() { } + public System.BinaryData Properties { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.LogicAppData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.LogicAppData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class LogicAppResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected LogicAppResource() { } + public virtual Azure.ResourceManager.AppContainers.LogicAppData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string containerAppName, string logicAppName) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response DeployWorkflowArtifacts(Azure.ResourceManager.AppContainers.Models.ContainerAppWorkflowArtifacts workflowArtifacts = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task DeployWorkflowArtifactsAsync(Azure.ResourceManager.AppContainers.Models.ContainerAppWorkflowArtifacts workflowArtifacts = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response GetWorkflowEnvelope(string workflowName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetWorkflowEnvelopeAsync(string workflowName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.AppContainers.WorkflowEnvelopeCollection GetWorkflowEnvelopes() { throw null; } + public virtual Azure.Response GetWorkflowsConnections(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetWorkflowsConnectionsAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Invoke(string xMsLogicAppsProxyPath, Azure.ResourceManager.AppContainers.Models.LogicAppsProxyMethod xMsLogicAppsProxyMethod, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> InvokeAsync(string xMsLogicAppsProxyPath, Azure.ResourceManager.AppContainers.Models.LogicAppsProxyMethod xMsLogicAppsProxyMethod, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + Azure.ResourceManager.AppContainers.LogicAppData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.LogicAppData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.AppContainers.LogicAppData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.AppContainers.LogicAppData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public partial class MaintenanceConfigurationResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected MaintenanceConfigurationResource() { } + public virtual Azure.ResourceManager.AppContainers.MaintenanceConfigurationResourceData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string environmentName, string configName) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + Azure.ResourceManager.AppContainers.MaintenanceConfigurationResourceData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.MaintenanceConfigurationResourceData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.AppContainers.MaintenanceConfigurationResourceData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.AppContainers.MaintenanceConfigurationResourceData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public partial class MaintenanceConfigurationResourceCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected MaintenanceConfigurationResourceCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string configName, Azure.ResourceManager.AppContainers.MaintenanceConfigurationResourceData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string configName, Azure.ResourceManager.AppContainers.MaintenanceConfigurationResourceData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string configName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string configName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string configName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string configName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string configName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string configName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } + System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } + } + public partial class MaintenanceConfigurationResourceData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public MaintenanceConfigurationResourceData() { } + public System.Collections.Generic.IList ScheduledEntries { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.MaintenanceConfigurationResourceData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.MaintenanceConfigurationResourceData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } public partial class SessionPoolCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable { protected SessionPoolCollection() { } @@ -1294,15 +2046,62 @@ protected SessionPoolResource() { } public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.AppContainers.Models.SessionPoolPatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.AppContainers.Models.SessionPoolPatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } } + public partial class WorkflowEnvelopeCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected WorkflowEnvelopeCollection() { } + public virtual Azure.Response Exists(string workflowName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string workflowName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string workflowName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string workflowName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string workflowName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string workflowName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } + System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } + } + public partial class WorkflowEnvelopeData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal WorkflowEnvelopeData() { } + public string Kind { get { throw null; } } + public Azure.Core.AzureLocation? Location { get { throw null; } } + public Azure.ResourceManager.AppContainers.Models.ContainerAppWorkflowEnvelopeProperties Properties { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.WorkflowEnvelopeData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.WorkflowEnvelopeData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class WorkflowEnvelopeResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected WorkflowEnvelopeResource() { } + public virtual Azure.ResourceManager.AppContainers.WorkflowEnvelopeData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string containerAppName, string logicAppName, string workflowName) { throw null; } + public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + Azure.ResourceManager.AppContainers.WorkflowEnvelopeData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.WorkflowEnvelopeData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } } namespace Azure.ResourceManager.AppContainers.Mocking { public partial class MockableAppContainersArmClient : Azure.ResourceManager.ArmResource { protected MockableAppContainersArmClient() { } + public virtual Azure.ResourceManager.AppContainers.AppContainersPrivateEndpointConnectionResource GetAppContainersPrivateEndpointConnectionResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.AppContainers.AppResiliencyResource GetAppResiliencyResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.AppContainers.BuilderResource GetBuilderResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.AppContainers.BuildResource GetBuildResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.AppContainers.ConnectedEnvironmentDaprComponentResource GetConnectedEnvironmentDaprComponentResource(Azure.Core.ResourceIdentifier id) { throw null; } public virtual Azure.ResourceManager.AppContainers.ContainerAppAuthConfigResource GetContainerAppAuthConfigResource(Azure.Core.ResourceIdentifier id) { throw null; } public virtual Azure.ResourceManager.AppContainers.ContainerAppConnectedEnvironmentCertificateResource GetContainerAppConnectedEnvironmentCertificateResource(Azure.Core.ResourceIdentifier id) { throw null; } - public virtual Azure.ResourceManager.AppContainers.ContainerAppConnectedEnvironmentDaprComponentResource GetContainerAppConnectedEnvironmentDaprComponentResource(Azure.Core.ResourceIdentifier id) { throw null; } public virtual Azure.ResourceManager.AppContainers.ContainerAppConnectedEnvironmentResource GetContainerAppConnectedEnvironmentResource(Azure.Core.ResourceIdentifier id) { throw null; } public virtual Azure.ResourceManager.AppContainers.ContainerAppConnectedEnvironmentStorageResource GetContainerAppConnectedEnvironmentStorageResource(Azure.Core.ResourceIdentifier id) { throw null; } public virtual Azure.ResourceManager.AppContainers.ContainerAppDetectorPropertyResource GetContainerAppDetectorPropertyResource(Azure.Core.ResourceIdentifier id) { throw null; } @@ -1322,13 +2121,26 @@ protected MockableAppContainersArmClient() { } public virtual Azure.ResourceManager.AppContainers.ContainerAppReplicaResource GetContainerAppReplicaResource(Azure.Core.ResourceIdentifier id) { throw null; } public virtual Azure.ResourceManager.AppContainers.ContainerAppResource GetContainerAppResource(Azure.Core.ResourceIdentifier id) { throw null; } public virtual Azure.ResourceManager.AppContainers.ContainerAppRevisionResource GetContainerAppRevisionResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.AppContainers.ContainerAppsBuildResource GetContainerAppsBuildResource(Azure.Core.ResourceIdentifier id) { throw null; } public virtual Azure.ResourceManager.AppContainers.ContainerAppSourceControlResource GetContainerAppSourceControlResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.AppContainers.ContainerAppsPatchResource GetContainerAppsPatchResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.AppContainers.DaprComponentResiliencyPolicyResource GetDaprComponentResiliencyPolicyResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.AppContainers.DaprSubscriptionResource GetDaprSubscriptionResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.AppContainers.DotNetComponentResource GetDotNetComponentResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.AppContainers.HttpRouteConfigResource GetHttpRouteConfigResource(Azure.Core.ResourceIdentifier id) { throw null; } public virtual Azure.ResourceManager.AppContainers.JavaComponentResource GetJavaComponentResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.AppContainers.LabelHistoryResource GetLabelHistoryResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.AppContainers.LogicAppResource GetLogicAppResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.AppContainers.MaintenanceConfigurationResource GetMaintenanceConfigurationResource(Azure.Core.ResourceIdentifier id) { throw null; } public virtual Azure.ResourceManager.AppContainers.SessionPoolResource GetSessionPoolResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.AppContainers.WorkflowEnvelopeResource GetWorkflowEnvelopeResource(Azure.Core.ResourceIdentifier id) { throw null; } } public partial class MockableAppContainersResourceGroupResource : Azure.ResourceManager.ArmResource { protected MockableAppContainersResourceGroupResource() { } + public virtual Azure.Response GetBuilderResource(string builderName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetBuilderResourceAsync(string builderName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.AppContainers.BuilderResourceCollection GetBuilderResources() { throw null; } public virtual Azure.Response GetContainerApp(string containerAppName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> GetContainerAppAsync(string containerAppName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Response GetContainerAppConnectedEnvironment(string connectedEnvironmentName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } @@ -1352,6 +2164,8 @@ protected MockableAppContainersSubscriptionResource() { } public virtual Azure.AsyncPageable GetAvailableWorkloadProfilesAsync(Azure.Core.AzureLocation location, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Pageable GetBillingMeters(Azure.Core.AzureLocation location, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.AsyncPageable GetBillingMetersAsync(Azure.Core.AzureLocation location, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetBuilderResources(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetBuilderResourcesAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Pageable GetContainerAppConnectedEnvironments(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.AsyncPageable GetContainerAppConnectedEnvironmentsAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Pageable GetContainerAppJobs(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } @@ -1393,6 +2207,7 @@ public partial class AppContainerResources : System.ClientModel.Primitives.IJson public AppContainerResources() { } public double? Cpu { get { throw null; } set { } } public string EphemeralStorage { get { throw null; } } + public double? Gpu { get { throw null; } set { } } public string Memory { get { throw null; } set { } } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.AppContainers.Models.AppContainerResources System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -1401,6 +2216,92 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct AppContainersKind : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public AppContainersKind(string value) { throw null; } + public static Azure.ResourceManager.AppContainers.Models.AppContainersKind Workflowapp { get { throw null; } } + public bool Equals(Azure.ResourceManager.AppContainers.Models.AppContainersKind other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.AppContainers.Models.AppContainersKind left, Azure.ResourceManager.AppContainers.Models.AppContainersKind right) { throw null; } + public static implicit operator Azure.ResourceManager.AppContainers.Models.AppContainersKind (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.AppContainers.Models.AppContainersKind left, Azure.ResourceManager.AppContainers.Models.AppContainersKind right) { throw null; } + public override string ToString() { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct AppContainersPrivateEndpointConnectionProvisioningState : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public AppContainersPrivateEndpointConnectionProvisioningState(string value) { throw null; } + public static Azure.ResourceManager.AppContainers.Models.AppContainersPrivateEndpointConnectionProvisioningState Canceled { get { throw null; } } + public static Azure.ResourceManager.AppContainers.Models.AppContainersPrivateEndpointConnectionProvisioningState Deleting { get { throw null; } } + public static Azure.ResourceManager.AppContainers.Models.AppContainersPrivateEndpointConnectionProvisioningState Failed { get { throw null; } } + public static Azure.ResourceManager.AppContainers.Models.AppContainersPrivateEndpointConnectionProvisioningState Pending { get { throw null; } } + public static Azure.ResourceManager.AppContainers.Models.AppContainersPrivateEndpointConnectionProvisioningState Succeeded { get { throw null; } } + public static Azure.ResourceManager.AppContainers.Models.AppContainersPrivateEndpointConnectionProvisioningState Updating { get { throw null; } } + public static Azure.ResourceManager.AppContainers.Models.AppContainersPrivateEndpointConnectionProvisioningState Waiting { get { throw null; } } + public bool Equals(Azure.ResourceManager.AppContainers.Models.AppContainersPrivateEndpointConnectionProvisioningState other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.AppContainers.Models.AppContainersPrivateEndpointConnectionProvisioningState left, Azure.ResourceManager.AppContainers.Models.AppContainersPrivateEndpointConnectionProvisioningState right) { throw null; } + public static implicit operator Azure.ResourceManager.AppContainers.Models.AppContainersPrivateEndpointConnectionProvisioningState (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.AppContainers.Models.AppContainersPrivateEndpointConnectionProvisioningState left, Azure.ResourceManager.AppContainers.Models.AppContainersPrivateEndpointConnectionProvisioningState right) { throw null; } + public override string ToString() { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct AppContainersPrivateEndpointServiceConnectionStatus : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public AppContainersPrivateEndpointServiceConnectionStatus(string value) { throw null; } + public static Azure.ResourceManager.AppContainers.Models.AppContainersPrivateEndpointServiceConnectionStatus Approved { get { throw null; } } + public static Azure.ResourceManager.AppContainers.Models.AppContainersPrivateEndpointServiceConnectionStatus Disconnected { get { throw null; } } + public static Azure.ResourceManager.AppContainers.Models.AppContainersPrivateEndpointServiceConnectionStatus Pending { get { throw null; } } + public static Azure.ResourceManager.AppContainers.Models.AppContainersPrivateEndpointServiceConnectionStatus Rejected { get { throw null; } } + public bool Equals(Azure.ResourceManager.AppContainers.Models.AppContainersPrivateEndpointServiceConnectionStatus other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.AppContainers.Models.AppContainersPrivateEndpointServiceConnectionStatus left, Azure.ResourceManager.AppContainers.Models.AppContainersPrivateEndpointServiceConnectionStatus right) { throw null; } + public static implicit operator Azure.ResourceManager.AppContainers.Models.AppContainersPrivateEndpointServiceConnectionStatus (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.AppContainers.Models.AppContainersPrivateEndpointServiceConnectionStatus left, Azure.ResourceManager.AppContainers.Models.AppContainersPrivateEndpointServiceConnectionStatus right) { throw null; } + public override string ToString() { throw null; } + } + public partial class AppContainersPrivateLinkResource : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public AppContainersPrivateLinkResource() { } + public string GroupId { get { throw null; } } + public System.Collections.Generic.IReadOnlyList RequiredMembers { get { throw null; } } + public System.Collections.Generic.IList RequiredZoneNames { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.Models.AppContainersPrivateLinkResource System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.Models.AppContainersPrivateLinkResource System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class AppContainersPrivateLinkServiceConnectionState : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public AppContainersPrivateLinkServiceConnectionState() { } + public string ActionsRequired { get { throw null; } set { } } + public string Description { get { throw null; } set { } } + public Azure.ResourceManager.AppContainers.Models.AppContainersPrivateEndpointServiceConnectionStatus? Status { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.Models.AppContainersPrivateLinkServiceConnectionState System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.Models.AppContainersPrivateLinkServiceConnectionState System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential, Size=1)] public readonly partial struct AppContainersSkuName : System.IEquatable @@ -1420,43 +2321,68 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer } public static partial class ArmAppContainersModelFactory { - public static Azure.ResourceManager.AppContainers.Models.AppContainerResources AppContainerResources(double? cpu = default(double?), string memory = null, string ephemeralStorage = null) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public static Azure.ResourceManager.AppContainers.Models.AppContainerResources AppContainerResources(double? cpu, string memory, string ephemeralStorage) { throw null; } + public static Azure.ResourceManager.AppContainers.Models.AppContainerResources AppContainerResources(double? cpu = default(double?), string memory = null, string ephemeralStorage = null, double? gpu = default(double?)) { throw null; } + public static Azure.ResourceManager.AppContainers.AppContainersPrivateEndpointConnectionData AppContainersPrivateEndpointConnectionData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IEnumerable groupIds = null, Azure.Core.ResourceIdentifier privateEndpointId = null, Azure.ResourceManager.AppContainers.Models.AppContainersPrivateLinkServiceConnectionState connectionState = null, Azure.ResourceManager.AppContainers.Models.AppContainersPrivateEndpointConnectionProvisioningState? provisioningState = default(Azure.ResourceManager.AppContainers.Models.AppContainersPrivateEndpointConnectionProvisioningState?)) { throw null; } + public static Azure.ResourceManager.AppContainers.Models.AppContainersPrivateLinkResource AppContainersPrivateLinkResource(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, string groupId = null, System.Collections.Generic.IEnumerable requiredMembers = null, System.Collections.Generic.IEnumerable requiredZoneNames = null) { throw null; } + public static Azure.ResourceManager.AppContainers.AppResiliencyData AppResiliencyData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.AppContainers.Models.ContainerAppTimeoutPolicy timeoutPolicy = null, Azure.ResourceManager.AppContainers.Models.HttpRetryPolicy httpRetryPolicy = null, int? tcpRetryMaxConnectAttempts = default(int?), Azure.ResourceManager.AppContainers.Models.CircuitBreakerPolicy circuitBreakerPolicy = null, Azure.ResourceManager.AppContainers.Models.HttpConnectionPool httpConnectionPool = null, int? maxConnections = default(int?)) { throw null; } + public static Azure.ResourceManager.AppContainers.BuilderResourceData BuilderResourceData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IDictionary tags = null, Azure.Core.AzureLocation location = default(Azure.Core.AzureLocation), Azure.ResourceManager.Models.ManagedServiceIdentity identity = null, Azure.ResourceManager.AppContainers.Models.ContainerAppBuilderProvisioningState? provisioningState = default(Azure.ResourceManager.AppContainers.Models.ContainerAppBuilderProvisioningState?), Azure.Core.ResourceIdentifier environmentId = null, System.Collections.Generic.IEnumerable containerRegistries = null) { throw null; } + public static Azure.ResourceManager.AppContainers.BuildResourceData BuildResourceData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.AppContainers.Models.ContainerAppBuildProvisioningState? provisioningState = default(Azure.ResourceManager.AppContainers.Models.ContainerAppBuildProvisioningState?), Azure.ResourceManager.AppContainers.Models.ContainerAppBuildStatus? buildStatus = default(Azure.ResourceManager.AppContainers.Models.ContainerAppBuildStatus?), Azure.ResourceManager.AppContainers.Models.ContainerRegistryWithCustomImage destinationContainerRegistry = null, Azure.ResourceManager.AppContainers.Models.ContainerAppBuildConfiguration configuration = null, string uploadEndpoint = null, string logStreamEndpoint = null, string tokenEndpoint = null) { throw null; } + public static Azure.ResourceManager.AppContainers.ConnectedEnvironmentDaprComponentData ConnectedEnvironmentDaprComponentData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, string componentType = null, string version = null, bool? ignoreErrors = default(bool?), string initTimeout = null, System.Collections.Generic.IEnumerable secrets = null, string secretStoreComponent = null, System.Collections.Generic.IEnumerable metadata = null, System.Collections.Generic.IEnumerable scopes = null, System.Collections.Generic.IEnumerable serviceComponentBind = null, Azure.ResourceManager.AppContainers.Models.ConnectedEnvironmentDaprComponentProvisioningState? provisioningState = default(Azure.ResourceManager.AppContainers.Models.ConnectedEnvironmentDaprComponentProvisioningState?), string deploymentErrors = null) { throw null; } + public static Azure.ResourceManager.AppContainers.Models.ConnectedEnvironmentStorageProperties ConnectedEnvironmentStorageProperties(Azure.ResourceManager.AppContainers.Models.ConnectedEnvironmentStorageProvisioningState? provisioningState = default(Azure.ResourceManager.AppContainers.Models.ConnectedEnvironmentStorageProvisioningState?), string deploymentErrors = null, Azure.ResourceManager.AppContainers.Models.ContainerAppAzureFileProperties azureFile = null, Azure.ResourceManager.AppContainers.Models.SmbStorage smb = null) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public static Azure.ResourceManager.AppContainers.ContainerAppAuthConfigData ContainerAppAuthConfigData(Azure.Core.ResourceIdentifier id, string name, Azure.Core.ResourceType resourceType, Azure.ResourceManager.Models.SystemData systemData, Azure.ResourceManager.AppContainers.Models.ContainerAppAuthPlatform platform, Azure.ResourceManager.AppContainers.Models.ContainerAppGlobalValidation globalValidation, Azure.ResourceManager.AppContainers.Models.ContainerAppIdentityProvidersConfiguration identityProviders, Azure.ResourceManager.AppContainers.Models.ContainerAppLogin login, Azure.ResourceManager.AppContainers.Models.ContainerAppHttpSettings httpSettings) { throw null; } public static Azure.ResourceManager.AppContainers.ContainerAppAuthConfigData ContainerAppAuthConfigData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.AppContainers.Models.ContainerAppAuthPlatform platform = null, Azure.ResourceManager.AppContainers.Models.ContainerAppGlobalValidation globalValidation = null, Azure.ResourceManager.AppContainers.Models.ContainerAppIdentityProvidersConfiguration identityProviders = null, Azure.ResourceManager.AppContainers.Models.ContainerAppLogin login = null, Azure.ResourceManager.AppContainers.Models.ContainerAppHttpSettings httpSettings = null, Azure.ResourceManager.AppContainers.Models.EncryptionSettings encryptionSettings = null) { throw null; } public static Azure.ResourceManager.AppContainers.Models.ContainerAppAuthToken ContainerAppAuthToken(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IDictionary tags = null, Azure.Core.AzureLocation location = default(Azure.Core.AzureLocation), string token = null, System.DateTimeOffset? expireOn = default(System.DateTimeOffset?)) { throw null; } public static Azure.ResourceManager.AppContainers.Models.ContainerAppAvailableWorkloadProfile ContainerAppAvailableWorkloadProfile(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.Core.AzureLocation? location = default(Azure.Core.AzureLocation?), Azure.ResourceManager.AppContainers.Models.ContainerAppAvailableWorkloadProfileProperties properties = null) { throw null; } public static Azure.ResourceManager.AppContainers.Models.ContainerAppBillingMeter ContainerAppBillingMeter(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.Core.AzureLocation? location = default(Azure.Core.AzureLocation?), Azure.ResourceManager.AppContainers.Models.ContainerAppBillingMeterProperties properties = null) { throw null; } + public static Azure.ResourceManager.AppContainers.Models.ContainerAppBillingMeterProperties ContainerAppBillingMeterProperties(string workloadProfileCategory = null, string meterType = null, string displayName = null) { throw null; } + public static Azure.ResourceManager.AppContainers.Models.ContainerAppBuildToken ContainerAppBuildToken(string token = null, System.DateTimeOffset? expires = default(System.DateTimeOffset?)) { throw null; } public static Azure.ResourceManager.AppContainers.ContainerAppCertificateData ContainerAppCertificateData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IDictionary tags = null, Azure.Core.AzureLocation location = default(Azure.Core.AzureLocation), Azure.ResourceManager.AppContainers.Models.ContainerAppCertificateProperties properties = null) { throw null; } - public static Azure.ResourceManager.AppContainers.Models.ContainerAppCertificateProperties ContainerAppCertificateProperties(Azure.ResourceManager.AppContainers.Models.ContainerAppCertificateProvisioningState? provisioningState = default(Azure.ResourceManager.AppContainers.Models.ContainerAppCertificateProvisioningState?), Azure.ResourceManager.AppContainers.Models.ContainerAppCertificateKeyVaultProperties certificateKeyVaultProperties = null, string password = null, string subjectName = null, System.Collections.Generic.IEnumerable subjectAlternativeNames = null, byte[] value = null, string issuer = null, System.DateTimeOffset? issueOn = default(System.DateTimeOffset?), System.DateTimeOffset? expireOn = default(System.DateTimeOffset?), string thumbprint = null, bool? isValid = default(bool?), string publicKeyHash = null) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public static Azure.ResourceManager.AppContainers.Models.ContainerAppCertificateProperties ContainerAppCertificateProperties(Azure.ResourceManager.AppContainers.Models.ContainerAppCertificateProvisioningState? provisioningState, Azure.ResourceManager.AppContainers.Models.ContainerAppCertificateKeyVaultProperties certificateKeyVaultProperties, string password, string subjectName, System.Collections.Generic.IEnumerable subjectAlternativeNames, byte[] value, string issuer, System.DateTimeOffset? issueOn, System.DateTimeOffset? expireOn, string thumbprint, bool? isValid, string publicKeyHash) { throw null; } + public static Azure.ResourceManager.AppContainers.Models.ContainerAppCertificateProperties ContainerAppCertificateProperties(Azure.ResourceManager.AppContainers.Models.ContainerAppCertificateProvisioningState? provisioningState = default(Azure.ResourceManager.AppContainers.Models.ContainerAppCertificateProvisioningState?), string deploymentErrors = null, Azure.ResourceManager.AppContainers.Models.ContainerAppCertificateKeyVaultProperties certificateKeyVaultProperties = null, string password = null, string subjectName = null, System.Collections.Generic.IEnumerable subjectAlternativeNames = null, byte[] value = null, string issuer = null, System.DateTimeOffset? issueOn = default(System.DateTimeOffset?), System.DateTimeOffset? expireOn = default(System.DateTimeOffset?), string thumbprint = null, bool? isValid = default(bool?), string publicKeyHash = null, Azure.ResourceManager.AppContainers.Models.ContainerAppCertificateType? certificateType = default(Azure.ResourceManager.AppContainers.Models.ContainerAppCertificateType?)) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public static Azure.ResourceManager.AppContainers.Models.ContainerAppCertificateProperties ContainerAppCertificateProperties(Azure.ResourceManager.AppContainers.Models.ContainerAppCertificateProvisioningState? provisioningState, string password, string subjectName, System.Collections.Generic.IEnumerable subjectAlternativeNames, byte[] value, string issuer, System.DateTimeOffset? issueOn, System.DateTimeOffset? expireOn, string thumbprint, bool? isValid, string publicKeyHash) { throw null; } public static Azure.ResourceManager.AppContainers.ContainerAppConnectedEnvironmentData ContainerAppConnectedEnvironmentData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IDictionary tags = null, Azure.Core.AzureLocation location = default(Azure.Core.AzureLocation), Azure.ResourceManager.AppContainers.Models.ContainerAppExtendedLocation extendedLocation = null, Azure.ResourceManager.AppContainers.Models.ContainerAppConnectedEnvironmentProvisioningState? provisioningState = default(Azure.ResourceManager.AppContainers.Models.ContainerAppConnectedEnvironmentProvisioningState?), string deploymentErrors = null, string defaultDomain = null, System.Net.IPAddress staticIP = null, string daprAIConnectionString = null, Azure.ResourceManager.AppContainers.Models.ContainerAppCustomDomainConfiguration customDomainConfiguration = null) { throw null; } - public static Azure.ResourceManager.AppContainers.ContainerAppConnectedEnvironmentStorageData ContainerAppConnectedEnvironmentStorageData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.AppContainers.Models.ContainerAppAzureFileProperties connectedEnvironmentStorageAzureFile = null) { throw null; } + public static Azure.ResourceManager.AppContainers.ContainerAppConnectedEnvironmentStorageData ContainerAppConnectedEnvironmentStorageData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.AppContainers.Models.ConnectedEnvironmentStorageProperties properties = null) { throw null; } public static Azure.ResourceManager.AppContainers.Models.ContainerAppCustomDomainConfiguration ContainerAppCustomDomainConfiguration(string customDomainVerificationId = null, string dnsSuffix = null, Azure.ResourceManager.AppContainers.Models.ContainerAppCertificateKeyVaultProperties certificateKeyVaultProperties = null, byte[] certificateValue = null, string certificatePassword = null, System.DateTimeOffset? expireOn = default(System.DateTimeOffset?), string thumbprint = null, string subjectName = null) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public static Azure.ResourceManager.AppContainers.Models.ContainerAppCustomDomainConfiguration ContainerAppCustomDomainConfiguration(string customDomainVerificationId, string dnsSuffix, byte[] certificateValue, string certificatePassword, System.DateTimeOffset? expireOn, string thumbprint, string subjectName) { throw null; } public static Azure.ResourceManager.AppContainers.Models.ContainerAppCustomDomainVerificationFailureInfo ContainerAppCustomDomainVerificationFailureInfo(string code = null, string message = null, string target = null, System.Collections.Generic.IEnumerable details = null) { throw null; } public static Azure.ResourceManager.AppContainers.Models.ContainerAppCustomDomainVerificationFailureInfoDetailsItem ContainerAppCustomDomainVerificationFailureInfoDetailsItem(string code = null, string message = null, string target = null) { throw null; } public static Azure.ResourceManager.AppContainers.Models.ContainerAppCustomHostnameAnalysisResult ContainerAppCustomHostnameAnalysisResult(string hostName = null, bool? isHostnameAlreadyVerified = default(bool?), Azure.ResourceManager.AppContainers.Models.ContainerAppDnsVerificationTestResult? customDomainVerificationTest = default(Azure.ResourceManager.AppContainers.Models.ContainerAppDnsVerificationTestResult?), Azure.ResourceManager.AppContainers.Models.ContainerAppCustomDomainVerificationFailureInfo customDomainVerificationFailureInfo = null, bool? hasConflictOnManagedEnvironment = default(bool?), bool? conflictWithEnvironmentCustomDomain = default(bool?), string conflictingContainerAppResourceId = null, System.Collections.Generic.IEnumerable cNameRecords = null, System.Collections.Generic.IEnumerable txtRecords = null, System.Collections.Generic.IEnumerable aRecords = null, System.Collections.Generic.IEnumerable alternateCNameRecords = null, System.Collections.Generic.IEnumerable alternateTxtRecords = null) { throw null; } - public static Azure.ResourceManager.AppContainers.ContainerAppDaprComponentData ContainerAppDaprComponentData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, string componentType = null, string version = null, bool? ignoreErrors = default(bool?), string initTimeout = null, System.Collections.Generic.IEnumerable secrets = null, string secretStoreComponent = null, System.Collections.Generic.IEnumerable metadata = null, System.Collections.Generic.IEnumerable scopes = null) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public static Azure.ResourceManager.AppContainers.ContainerAppDaprComponentData ContainerAppDaprComponentData(Azure.Core.ResourceIdentifier id, string name, Azure.Core.ResourceType resourceType, Azure.ResourceManager.Models.SystemData systemData, string componentType, string version, bool? ignoreErrors, string initTimeout, System.Collections.Generic.IEnumerable secrets, string secretStoreComponent, System.Collections.Generic.IEnumerable metadata, System.Collections.Generic.IEnumerable scopes) { throw null; } + public static Azure.ResourceManager.AppContainers.ContainerAppDaprComponentData ContainerAppDaprComponentData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, string componentType = null, string version = null, bool? ignoreErrors = default(bool?), string initTimeout = null, System.Collections.Generic.IEnumerable secrets = null, string secretStoreComponent = null, System.Collections.Generic.IEnumerable metadata = null, System.Collections.Generic.IEnumerable scopes = null, System.Collections.Generic.IEnumerable serviceComponentBind = null) { throw null; } public static Azure.ResourceManager.AppContainers.Models.ContainerAppDaprSecret ContainerAppDaprSecret(string name = null, string value = null) { throw null; } + public static Azure.ResourceManager.AppContainers.ContainerAppData ContainerAppData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IDictionary tags = null, Azure.Core.AzureLocation location = default(Azure.Core.AzureLocation), Azure.ResourceManager.AppContainers.Models.ContainerAppExtendedLocation extendedLocation = null, Azure.ResourceManager.Models.ManagedServiceIdentity identity = null, string managedBy = null, Azure.ResourceManager.AppContainers.Models.AppContainersKind? kind = default(Azure.ResourceManager.AppContainers.Models.AppContainersKind?), Azure.ResourceManager.AppContainers.Models.ContainerAppProvisioningState? provisioningState = default(Azure.ResourceManager.AppContainers.Models.ContainerAppProvisioningState?), Azure.ResourceManager.AppContainers.Models.ContainerAppRunningStatus? runningStatus = default(Azure.ResourceManager.AppContainers.Models.ContainerAppRunningStatus?), string deploymentErrors = null, Azure.Core.ResourceIdentifier managedEnvironmentId = null, Azure.Core.ResourceIdentifier environmentId = null, string workloadProfileName = null, Azure.ResourceManager.AppContainers.Models.PatchingMode? patchingMode = default(Azure.ResourceManager.AppContainers.Models.PatchingMode?), string latestRevisionName = null, string latestReadyRevisionName = null, string latestRevisionFqdn = null, string customDomainVerificationId = null, Azure.ResourceManager.AppContainers.Models.ContainerAppConfiguration configuration = null, Azure.ResourceManager.AppContainers.Models.ContainerAppTemplate template = null, System.Collections.Generic.IEnumerable outboundIPAddressList = null, System.Uri eventStreamEndpoint = null) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public static Azure.ResourceManager.AppContainers.ContainerAppData ContainerAppData(Azure.Core.ResourceIdentifier id, string name, Azure.Core.ResourceType resourceType, Azure.ResourceManager.Models.SystemData systemData, System.Collections.Generic.IDictionary tags, Azure.Core.AzureLocation location, Azure.ResourceManager.AppContainers.Models.ContainerAppExtendedLocation extendedLocation, Azure.ResourceManager.Models.ManagedServiceIdentity identity, string managedBy, Azure.ResourceManager.AppContainers.Models.ContainerAppProvisioningState? provisioningState, Azure.Core.ResourceIdentifier managedEnvironmentId, Azure.Core.ResourceIdentifier environmentId, string workloadProfileName, string latestRevisionName, string latestReadyRevisionName, string latestRevisionFqdn, string customDomainVerificationId, Azure.ResourceManager.AppContainers.Models.ContainerAppConfiguration configuration, Azure.ResourceManager.AppContainers.Models.ContainerAppTemplate template, System.Collections.Generic.IEnumerable outboundIPAddressList, System.Uri eventStreamEndpoint) { throw null; } - public static Azure.ResourceManager.AppContainers.ContainerAppData ContainerAppData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IDictionary tags = null, Azure.Core.AzureLocation location = default(Azure.Core.AzureLocation), Azure.ResourceManager.AppContainers.Models.ContainerAppExtendedLocation extendedLocation = null, Azure.ResourceManager.Models.ManagedServiceIdentity identity = null, string managedBy = null, Azure.ResourceManager.AppContainers.Models.ContainerAppProvisioningState? provisioningState = default(Azure.ResourceManager.AppContainers.Models.ContainerAppProvisioningState?), Azure.ResourceManager.AppContainers.Models.ContainerAppRunningStatus? runningStatus = default(Azure.ResourceManager.AppContainers.Models.ContainerAppRunningStatus?), Azure.Core.ResourceIdentifier managedEnvironmentId = null, Azure.Core.ResourceIdentifier environmentId = null, string workloadProfileName = null, string latestRevisionName = null, string latestReadyRevisionName = null, string latestRevisionFqdn = null, string customDomainVerificationId = null, Azure.ResourceManager.AppContainers.Models.ContainerAppConfiguration configuration = null, Azure.ResourceManager.AppContainers.Models.ContainerAppTemplate template = null, System.Collections.Generic.IEnumerable outboundIPAddressList = null, System.Uri eventStreamEndpoint = null) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public static Azure.ResourceManager.AppContainers.ContainerAppData ContainerAppData(Azure.Core.ResourceIdentifier id, string name, Azure.Core.ResourceType resourceType, Azure.ResourceManager.Models.SystemData systemData, System.Collections.Generic.IDictionary tags, Azure.Core.AzureLocation location, Azure.ResourceManager.AppContainers.Models.ContainerAppExtendedLocation extendedLocation, Azure.ResourceManager.Models.ManagedServiceIdentity identity, string managedBy, Azure.ResourceManager.AppContainers.Models.ContainerAppProvisioningState? provisioningState, Azure.ResourceManager.AppContainers.Models.ContainerAppRunningStatus? runningStatus, Azure.Core.ResourceIdentifier managedEnvironmentId, Azure.Core.ResourceIdentifier environmentId, string workloadProfileName, string latestRevisionName, string latestReadyRevisionName, string latestRevisionFqdn, string customDomainVerificationId, Azure.ResourceManager.AppContainers.Models.ContainerAppConfiguration configuration, Azure.ResourceManager.AppContainers.Models.ContainerAppTemplate template, System.Collections.Generic.IEnumerable outboundIPAddressList, System.Uri eventStreamEndpoint) { throw null; } public static Azure.ResourceManager.AppContainers.ContainerAppDiagnosticData ContainerAppDiagnosticData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.AppContainers.Models.ContainerAppDiagnosticsProperties properties = null) { throw null; } public static Azure.ResourceManager.AppContainers.Models.ContainerAppDiagnosticsMetadata ContainerAppDiagnosticsMetadata(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, string description = null, string author = null, string category = null, System.Collections.Generic.IEnumerable supportTopicList = null, System.Collections.Generic.IEnumerable analysisTypes = null, float? score = default(float?)) { throw null; } public static Azure.ResourceManager.AppContainers.Models.ContainerAppDiagnosticSupportTopic ContainerAppDiagnosticSupportTopic(string id = null, string pesId = null) { throw null; } public static Azure.ResourceManager.AppContainers.Models.ContainerAppEnvironmentAuthToken ContainerAppEnvironmentAuthToken(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IDictionary tags = null, Azure.Core.AzureLocation location = default(Azure.Core.AzureLocation), string token = null, System.DateTimeOffset? expireOn = default(System.DateTimeOffset?)) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public static Azure.ResourceManager.AppContainers.Models.ContainerAppIngressConfiguration ContainerAppIngressConfiguration(string fqdn, bool? external, int? targetPort, int? exposedPort, Azure.ResourceManager.AppContainers.Models.ContainerAppIngressTransportMethod? transport, System.Collections.Generic.IEnumerable traffic, System.Collections.Generic.IEnumerable customDomains, bool? allowInsecure, System.Collections.Generic.IEnumerable ipSecurityRestrictions, Azure.ResourceManager.AppContainers.Models.Affinity? stickySessionsAffinity, Azure.ResourceManager.AppContainers.Models.ContainerAppIngressClientCertificateMode? clientCertificateMode, Azure.ResourceManager.AppContainers.Models.ContainerAppCorsPolicy corsPolicy) { throw null; } - public static Azure.ResourceManager.AppContainers.Models.ContainerAppIngressConfiguration ContainerAppIngressConfiguration(string fqdn = null, bool? external = default(bool?), int? targetPort = default(int?), int? exposedPort = default(int?), Azure.ResourceManager.AppContainers.Models.ContainerAppIngressTransportMethod? transport = default(Azure.ResourceManager.AppContainers.Models.ContainerAppIngressTransportMethod?), System.Collections.Generic.IEnumerable traffic = null, System.Collections.Generic.IEnumerable customDomains = null, bool? allowInsecure = default(bool?), System.Collections.Generic.IEnumerable ipSecurityRestrictions = null, Azure.ResourceManager.AppContainers.Models.Affinity? stickySessionsAffinity = default(Azure.ResourceManager.AppContainers.Models.Affinity?), Azure.ResourceManager.AppContainers.Models.ContainerAppIngressClientCertificateMode? clientCertificateMode = default(Azure.ResourceManager.AppContainers.Models.ContainerAppIngressClientCertificateMode?), Azure.ResourceManager.AppContainers.Models.ContainerAppCorsPolicy corsPolicy = null, System.Collections.Generic.IEnumerable additionalPortMappings = null) { throw null; } - public static Azure.ResourceManager.AppContainers.ContainerAppJobData ContainerAppJobData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IDictionary tags = null, Azure.Core.AzureLocation location = default(Azure.Core.AzureLocation), Azure.ResourceManager.Models.ManagedServiceIdentity identity = null, Azure.ResourceManager.AppContainers.Models.ContainerAppJobProvisioningState? provisioningState = default(Azure.ResourceManager.AppContainers.Models.ContainerAppJobProvisioningState?), string environmentId = null, string workloadProfileName = null, Azure.ResourceManager.AppContainers.Models.ContainerAppJobConfiguration configuration = null, Azure.ResourceManager.AppContainers.Models.ContainerAppJobTemplate template = null, System.Collections.Generic.IEnumerable outboundIPAddresses = null, string eventStreamEndpoint = null) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public static Azure.ResourceManager.AppContainers.Models.ContainerAppIngressConfiguration ContainerAppIngressConfiguration(string fqdn, bool? external, int? targetPort, int? exposedPort, Azure.ResourceManager.AppContainers.Models.ContainerAppIngressTransportMethod? transport, System.Collections.Generic.IEnumerable traffic, System.Collections.Generic.IEnumerable customDomains, bool? allowInsecure, System.Collections.Generic.IEnumerable ipSecurityRestrictions, Azure.ResourceManager.AppContainers.Models.Affinity? stickySessionsAffinity, Azure.ResourceManager.AppContainers.Models.ContainerAppIngressClientCertificateMode? clientCertificateMode, Azure.ResourceManager.AppContainers.Models.ContainerAppCorsPolicy corsPolicy, System.Collections.Generic.IEnumerable additionalPortMappings) { throw null; } + public static Azure.ResourceManager.AppContainers.Models.ContainerAppIngressConfiguration ContainerAppIngressConfiguration(string fqdn = null, bool? external = default(bool?), int? targetPort = default(int?), int? exposedPort = default(int?), Azure.ResourceManager.AppContainers.Models.ContainerAppIngressTransportMethod? transport = default(Azure.ResourceManager.AppContainers.Models.ContainerAppIngressTransportMethod?), System.Collections.Generic.IEnumerable traffic = null, System.Collections.Generic.IEnumerable customDomains = null, bool? allowInsecure = default(bool?), System.Collections.Generic.IEnumerable ipSecurityRestrictions = null, Azure.ResourceManager.AppContainers.Models.Affinity? stickySessionsAffinity = default(Azure.ResourceManager.AppContainers.Models.Affinity?), Azure.ResourceManager.AppContainers.Models.ContainerAppIngressClientCertificateMode? clientCertificateMode = default(Azure.ResourceManager.AppContainers.Models.ContainerAppIngressClientCertificateMode?), Azure.ResourceManager.AppContainers.Models.ContainerAppCorsPolicy corsPolicy = null, System.Collections.Generic.IEnumerable additionalPortMappings = null, Azure.ResourceManager.AppContainers.Models.IngressTargetPortHttpScheme? targetPortHttpScheme = default(Azure.ResourceManager.AppContainers.Models.IngressTargetPortHttpScheme?)) { throw null; } + public static Azure.ResourceManager.AppContainers.ContainerAppJobData ContainerAppJobData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IDictionary tags = null, Azure.Core.AzureLocation location = default(Azure.Core.AzureLocation), Azure.ResourceManager.AppContainers.Models.ContainerAppExtendedLocation extendedLocation = null, Azure.ResourceManager.Models.ManagedServiceIdentity identity = null, Azure.ResourceManager.AppContainers.Models.ContainerAppJobProvisioningState? provisioningState = default(Azure.ResourceManager.AppContainers.Models.ContainerAppJobProvisioningState?), Azure.ResourceManager.AppContainers.Models.ContainerAppJobRunningState? runningState = default(Azure.ResourceManager.AppContainers.Models.ContainerAppJobRunningState?), string environmentId = null, string workloadProfileName = null, Azure.ResourceManager.AppContainers.Models.ContainerAppJobConfiguration configuration = null, Azure.ResourceManager.AppContainers.Models.ContainerAppJobTemplate template = null, System.Collections.Generic.IEnumerable outboundIPAddresses = null, string eventStreamEndpoint = null) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public static Azure.ResourceManager.AppContainers.ContainerAppJobData ContainerAppJobData(Azure.Core.ResourceIdentifier id, string name, Azure.Core.ResourceType resourceType, Azure.ResourceManager.Models.SystemData systemData, System.Collections.Generic.IDictionary tags, Azure.Core.AzureLocation location, Azure.ResourceManager.Models.ManagedServiceIdentity identity, Azure.ResourceManager.AppContainers.Models.ContainerAppJobProvisioningState? provisioningState, string environmentId, string workloadProfileName, Azure.ResourceManager.AppContainers.Models.ContainerAppJobConfiguration configuration, Azure.ResourceManager.AppContainers.Models.ContainerAppJobTemplate template, System.Collections.Generic.IEnumerable outboundIPAddresses, string eventStreamEndpoint) { throw null; } public static Azure.ResourceManager.AppContainers.Models.ContainerAppJobExecutionBase ContainerAppJobExecutionBase(string name = null, string id = null) { throw null; } - public static Azure.ResourceManager.AppContainers.ContainerAppJobExecutionData ContainerAppJobExecutionData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.AppContainers.Models.JobExecutionRunningState? status = default(Azure.ResourceManager.AppContainers.Models.JobExecutionRunningState?), System.DateTimeOffset? startOn = default(System.DateTimeOffset?), System.DateTimeOffset? endOn = default(System.DateTimeOffset?), Azure.ResourceManager.AppContainers.Models.ContainerAppJobExecutionTemplate template = null) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public static Azure.ResourceManager.AppContainers.ContainerAppJobExecutionData ContainerAppJobExecutionData(Azure.Core.ResourceIdentifier id, string name, Azure.Core.ResourceType resourceType, Azure.ResourceManager.Models.SystemData systemData, Azure.ResourceManager.AppContainers.Models.JobExecutionRunningState? status, System.DateTimeOffset? startOn, System.DateTimeOffset? endOn, Azure.ResourceManager.AppContainers.Models.ContainerAppJobExecutionTemplate template) { throw null; } + public static Azure.ResourceManager.AppContainers.ContainerAppJobExecutionData ContainerAppJobExecutionData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.AppContainers.Models.JobExecutionRunningState? status = default(Azure.ResourceManager.AppContainers.Models.JobExecutionRunningState?), System.DateTimeOffset? startOn = default(System.DateTimeOffset?), System.DateTimeOffset? endOn = default(System.DateTimeOffset?), Azure.ResourceManager.AppContainers.Models.ContainerAppJobExecutionTemplate template = null, System.Collections.Generic.IEnumerable detailedStatusReplicas = null) { throw null; } public static Azure.ResourceManager.AppContainers.Models.ContainerAppJobExecutions ContainerAppJobExecutions(System.Collections.Generic.IEnumerable value = null, string nextLink = null) { throw null; } public static Azure.ResourceManager.AppContainers.ContainerAppManagedCertificateData ContainerAppManagedCertificateData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IDictionary tags = null, Azure.Core.AzureLocation location = default(Azure.Core.AzureLocation), Azure.ResourceManager.AppContainers.Models.ManagedCertificateProperties properties = null) { throw null; } - public static Azure.ResourceManager.AppContainers.ContainerAppManagedEnvironmentData ContainerAppManagedEnvironmentData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IDictionary tags = null, Azure.Core.AzureLocation location = default(Azure.Core.AzureLocation), string kind = null, Azure.ResourceManager.Models.ManagedServiceIdentity identity = null, Azure.ResourceManager.AppContainers.Models.ContainerAppEnvironmentProvisioningState? provisioningState = default(Azure.ResourceManager.AppContainers.Models.ContainerAppEnvironmentProvisioningState?), string daprAIInstrumentationKey = null, string daprAIConnectionString = null, Azure.ResourceManager.AppContainers.Models.ContainerAppVnetConfiguration vnetConfiguration = null, string deploymentErrors = null, string defaultDomain = null, System.Net.IPAddress staticIP = null, Azure.ResourceManager.AppContainers.Models.ContainerAppLogsConfiguration appLogsConfiguration = null, bool? isZoneRedundant = default(bool?), Azure.ResourceManager.AppContainers.Models.ContainerAppCustomDomainConfiguration customDomainConfiguration = null, string eventStreamEndpoint = null, System.Collections.Generic.IEnumerable workloadProfiles = null, string kedaVersion = null, string daprVersion = null, string infrastructureResourceGroup = null, bool? isMtlsEnabled = default(bool?), bool? isEnabled = default(bool?)) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public static Azure.ResourceManager.AppContainers.ContainerAppManagedEnvironmentData ContainerAppManagedEnvironmentData(Azure.Core.ResourceIdentifier id, string name, Azure.Core.ResourceType resourceType, Azure.ResourceManager.Models.SystemData systemData, System.Collections.Generic.IDictionary tags, Azure.Core.AzureLocation location, string kind, Azure.ResourceManager.Models.ManagedServiceIdentity identity, Azure.ResourceManager.AppContainers.Models.ContainerAppEnvironmentProvisioningState? provisioningState, string daprAIInstrumentationKey, string daprAIConnectionString, Azure.ResourceManager.AppContainers.Models.ContainerAppVnetConfiguration vnetConfiguration, string deploymentErrors, string defaultDomain, System.Net.IPAddress staticIP, Azure.ResourceManager.AppContainers.Models.ContainerAppLogsConfiguration appLogsConfiguration, bool? isZoneRedundant, Azure.ResourceManager.AppContainers.Models.ContainerAppCustomDomainConfiguration customDomainConfiguration, string eventStreamEndpoint, System.Collections.Generic.IEnumerable workloadProfiles, string kedaVersion, string daprVersion, string infrastructureResourceGroup, bool? isMtlsEnabled, bool? isEnabled) { throw null; } + public static Azure.ResourceManager.AppContainers.ContainerAppManagedEnvironmentData ContainerAppManagedEnvironmentData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IDictionary tags = null, Azure.Core.AzureLocation location = default(Azure.Core.AzureLocation), string kind = null, Azure.ResourceManager.Models.ManagedServiceIdentity identity = null, Azure.ResourceManager.AppContainers.Models.ContainerAppEnvironmentProvisioningState? provisioningState = default(Azure.ResourceManager.AppContainers.Models.ContainerAppEnvironmentProvisioningState?), string daprAIInstrumentationKey = null, string daprAIConnectionString = null, Azure.ResourceManager.AppContainers.Models.ContainerAppVnetConfiguration vnetConfiguration = null, string deploymentErrors = null, string defaultDomain = null, string privateLinkDefaultDomain = null, System.Net.IPAddress staticIP = null, Azure.ResourceManager.AppContainers.Models.ContainerAppLogsConfiguration appLogsConfiguration = null, string appInsightsConnectionString = null, Azure.ResourceManager.AppContainers.Models.OpenTelemetryConfiguration openTelemetryConfiguration = null, bool? isZoneRedundant = default(bool?), System.Collections.Generic.IEnumerable availabilityZones = null, Azure.ResourceManager.AppContainers.Models.ContainerAppCustomDomainConfiguration customDomainConfiguration = null, string eventStreamEndpoint = null, System.Collections.Generic.IEnumerable workloadProfiles = null, string kedaVersion = null, string daprVersion = null, string infrastructureResourceGroup = null, bool? isMtlsEnabled = default(bool?), bool? isEnabled = default(bool?), Azure.ResourceManager.AppContainers.Models.IngressConfiguration ingressConfiguration = null, System.Collections.Generic.IEnumerable privateEndpointConnections = null, Azure.ResourceManager.AppContainers.Models.PublicNetworkAccess? publicNetworkAccess = default(Azure.ResourceManager.AppContainers.Models.PublicNetworkAccess?), Azure.ResourceManager.AppContainers.Models.DiskEncryptionConfigurationKeyVaultConfiguration diskEncryptionKeyVaultConfiguration = null) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public static Azure.ResourceManager.AppContainers.ContainerAppManagedEnvironmentData ContainerAppManagedEnvironmentData(Azure.Core.ResourceIdentifier id, string name, Azure.Core.ResourceType resourceType, Azure.ResourceManager.Models.SystemData systemData, System.Collections.Generic.IDictionary tags, Azure.Core.AzureLocation location, string kind, Azure.ResourceManager.AppContainers.Models.ContainerAppEnvironmentProvisioningState? provisioningState, string daprAIInstrumentationKey, string daprAIConnectionString, Azure.ResourceManager.AppContainers.Models.ContainerAppVnetConfiguration vnetConfiguration, string deploymentErrors, string defaultDomain, System.Net.IPAddress staticIP, Azure.ResourceManager.AppContainers.Models.ContainerAppLogsConfiguration appLogsConfiguration, bool? isZoneRedundant, Azure.ResourceManager.AppContainers.Models.ContainerAppCustomDomainConfiguration customDomainConfiguration, string eventStreamEndpoint, System.Collections.Generic.IEnumerable workloadProfiles, string kedaVersion, string daprVersion, string infrastructureResourceGroup, bool? isMtlsEnabled) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] @@ -1465,28 +2391,138 @@ public static partial class ArmAppContainersModelFactory public static Azure.ResourceManager.AppContainers.ContainerAppManagedEnvironmentStorageData ContainerAppManagedEnvironmentStorageData(Azure.Core.ResourceIdentifier id, string name, Azure.Core.ResourceType resourceType, Azure.ResourceManager.Models.SystemData systemData, Azure.ResourceManager.AppContainers.Models.ContainerAppAzureFileProperties managedEnvironmentStorageAzureFile = null) { throw null; } public static Azure.ResourceManager.AppContainers.ContainerAppManagedEnvironmentStorageData ContainerAppManagedEnvironmentStorageData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.AppContainers.Models.ManagedEnvironmentStorageProperties properties = null) { throw null; } public static Azure.ResourceManager.AppContainers.Models.ContainerAppNameAvailabilityResult ContainerAppNameAvailabilityResult(bool? isNameAvailable = default(bool?), Azure.ResourceManager.AppContainers.Models.ContainerAppNameUnavailableReason? reason = default(Azure.ResourceManager.AppContainers.Models.ContainerAppNameUnavailableReason?), string message = null) { throw null; } - public static Azure.ResourceManager.AppContainers.Models.ContainerAppReplicaContainer ContainerAppReplicaContainer(string name = null, string containerId = null, bool? isReady = default(bool?), bool? isStarted = default(bool?), int? restartCount = default(int?), Azure.ResourceManager.AppContainers.Models.ContainerAppContainerRunningState? runningState = default(Azure.ResourceManager.AppContainers.Models.ContainerAppContainerRunningState?), string runningStateDetails = null, string logStreamEndpoint = null, string execEndpoint = null) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public static Azure.ResourceManager.AppContainers.Models.ContainerAppReplicaContainer ContainerAppReplicaContainer(string name, string containerId, bool? isReady, bool? isStarted, int? restartCount, Azure.ResourceManager.AppContainers.Models.ContainerAppContainerRunningState? runningState, string runningStateDetails, string logStreamEndpoint, string execEndpoint) { throw null; } + public static Azure.ResourceManager.AppContainers.Models.ContainerAppReplicaContainer ContainerAppReplicaContainer(string name = null, string containerId = null, bool? isReady = default(bool?), bool? isStarted = default(bool?), int? restartCount = default(int?), Azure.ResourceManager.AppContainers.Models.ContainerAppContainerRunningState? runningState = default(Azure.ResourceManager.AppContainers.Models.ContainerAppContainerRunningState?), string runningStateDetails = null, string logStreamEndpoint = null, string execEndpoint = null, string debugEndpoint = null) { throw null; } public static Azure.ResourceManager.AppContainers.ContainerAppReplicaData ContainerAppReplicaData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.DateTimeOffset? createdOn = default(System.DateTimeOffset?), Azure.ResourceManager.AppContainers.Models.ContainerAppReplicaRunningState? runningState = default(Azure.ResourceManager.AppContainers.Models.ContainerAppReplicaRunningState?), string runningStateDetails = null, System.Collections.Generic.IEnumerable containers = null, System.Collections.Generic.IEnumerable initContainers = null) { throw null; } - public static Azure.ResourceManager.AppContainers.ContainerAppRevisionData ContainerAppRevisionData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.DateTimeOffset? createdOn = default(System.DateTimeOffset?), System.DateTimeOffset? lastActiveOn = default(System.DateTimeOffset?), string fqdn = null, Azure.ResourceManager.AppContainers.Models.ContainerAppTemplate template = null, bool? isActive = default(bool?), int? replicas = default(int?), int? trafficWeight = default(int?), string provisioningError = null, Azure.ResourceManager.AppContainers.Models.ContainerAppRevisionHealthState? healthState = default(Azure.ResourceManager.AppContainers.Models.ContainerAppRevisionHealthState?), Azure.ResourceManager.AppContainers.Models.ContainerAppRevisionProvisioningState? provisioningState = default(Azure.ResourceManager.AppContainers.Models.ContainerAppRevisionProvisioningState?), Azure.ResourceManager.AppContainers.Models.RevisionRunningState? runningState = default(Azure.ResourceManager.AppContainers.Models.RevisionRunningState?)) { throw null; } + public static Azure.ResourceManager.AppContainers.ContainerAppRevisionData ContainerAppRevisionData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.DateTimeOffset? createdOn = default(System.DateTimeOffset?), System.DateTimeOffset? lastActiveOn = default(System.DateTimeOffset?), string fqdn = null, Azure.ResourceManager.AppContainers.Models.ContainerAppTemplate template = null, bool? isActive = default(bool?), int? replicas = default(int?), int? trafficWeight = default(int?), System.Collections.Generic.IEnumerable labels = null, string provisioningError = null, Azure.ResourceManager.AppContainers.Models.ContainerAppRevisionHealthState? healthState = default(Azure.ResourceManager.AppContainers.Models.ContainerAppRevisionHealthState?), Azure.ResourceManager.AppContainers.Models.ContainerAppRevisionProvisioningState? provisioningState = default(Azure.ResourceManager.AppContainers.Models.ContainerAppRevisionProvisioningState?), Azure.ResourceManager.AppContainers.Models.RevisionRunningState? runningState = default(Azure.ResourceManager.AppContainers.Models.RevisionRunningState?)) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public static Azure.ResourceManager.AppContainers.ContainerAppRevisionData ContainerAppRevisionData(Azure.Core.ResourceIdentifier id, string name, Azure.Core.ResourceType resourceType, Azure.ResourceManager.Models.SystemData systemData, System.DateTimeOffset? createdOn, System.DateTimeOffset? lastActiveOn, string fqdn, Azure.ResourceManager.AppContainers.Models.ContainerAppTemplate template, bool? isActive, int? replicas, int? trafficWeight, string provisioningError, Azure.ResourceManager.AppContainers.Models.ContainerAppRevisionHealthState? healthState, Azure.ResourceManager.AppContainers.Models.ContainerAppRevisionProvisioningState? provisioningState, Azure.ResourceManager.AppContainers.Models.RevisionRunningState? runningState) { throw null; } + public static Azure.ResourceManager.AppContainers.Models.ContainerAppsBuildConfiguration ContainerAppsBuildConfiguration(string baseOS = null, string platform = null, string platformVersion = null, System.Collections.Generic.IEnumerable environmentVariables = null, System.Collections.Generic.IEnumerable preBuildSteps = null) { throw null; } + public static Azure.ResourceManager.AppContainers.ContainerAppsBuildResourceData ContainerAppsBuildResourceData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.AppContainers.Models.ContainerAppBuildProvisioningState? provisioningState = default(Azure.ResourceManager.AppContainers.Models.ContainerAppBuildProvisioningState?), Azure.ResourceManager.AppContainers.Models.ContainerAppBuildStatus? buildStatus = default(Azure.ResourceManager.AppContainers.Models.ContainerAppBuildStatus?), Azure.ResourceManager.AppContainers.Models.ContainerRegistryWithCustomImage destinationContainerRegistry = null, Azure.ResourceManager.AppContainers.Models.ContainerAppsBuildConfiguration configuration = null, string logStreamEndpoint = null) { throw null; } public static Azure.ResourceManager.AppContainers.Models.ContainerAppSecret ContainerAppSecret(string name = null, string value = null, string identity = null, System.Uri keyVaultUri = null) { throw null; } public static Azure.ResourceManager.AppContainers.ContainerAppSourceControlData ContainerAppSourceControlData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.AppContainers.Models.ContainerAppSourceControlOperationState? operationState = default(Azure.ResourceManager.AppContainers.Models.ContainerAppSourceControlOperationState?), System.Uri repoUri = null, string branch = null, Azure.ResourceManager.AppContainers.Models.ContainerAppGitHubActionConfiguration gitHubActionConfiguration = null) { throw null; } + public static Azure.ResourceManager.AppContainers.ContainerAppsPatchResourceData ContainerAppsPatchResourceData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.AppContainers.Models.PatchProperties properties = null) { throw null; } public static Azure.ResourceManager.AppContainers.Models.ContainerAppUsage ContainerAppUsage(Azure.ResourceManager.AppContainers.Models.ContainerAppUsageUnit unit = default(Azure.ResourceManager.AppContainers.Models.ContainerAppUsageUnit), float currentValue = 0f, float limit = 0f, Azure.ResourceManager.AppContainers.Models.ContainerAppUsageName name = null) { throw null; } public static Azure.ResourceManager.AppContainers.Models.ContainerAppUsageName ContainerAppUsageName(string value = null, string localizedValue = null) { throw null; } + public static Azure.ResourceManager.AppContainers.Models.ContainerAppWorkflowEnvelopeProperties ContainerAppWorkflowEnvelopeProperties(System.BinaryData files = null, Azure.ResourceManager.AppContainers.Models.ContainerAppWorkflowState? flowState = default(Azure.ResourceManager.AppContainers.Models.ContainerAppWorkflowState?), Azure.ResourceManager.AppContainers.Models.ContainerAppWorkflowHealth health = null) { throw null; } + public static Azure.ResourceManager.AppContainers.Models.ContainerAppWorkflowHealth ContainerAppWorkflowHealth(Azure.ResourceManager.AppContainers.Models.ContainerAppWorkflowHealthState state = Azure.ResourceManager.AppContainers.Models.ContainerAppWorkflowHealthState.Unknown, Azure.ResponseError error = null) { throw null; } public static Azure.ResourceManager.AppContainers.Models.ContainerAppWorkloadProfileState ContainerAppWorkloadProfileState(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.AppContainers.Models.ContainerAppWorkloadProfileStateProperties properties = null) { throw null; } + public static Azure.ResourceManager.AppContainers.Models.ContainerExecutionStatus ContainerExecutionStatus(string name = null, int? code = default(int?), string additionalInformation = null, string status = null) { throw null; } + public static Azure.ResourceManager.AppContainers.DaprComponentResiliencyPolicyData DaprComponentResiliencyPolicyData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.AppContainers.Models.DaprComponentResiliencyPolicyConfiguration inboundPolicy = null, Azure.ResourceManager.AppContainers.Models.DaprComponentResiliencyPolicyConfiguration outboundPolicy = null) { throw null; } + public static Azure.ResourceManager.AppContainers.DaprSubscriptionData DaprSubscriptionData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, string pubsubName = null, string topic = null, string deadLetterTopic = null, Azure.ResourceManager.AppContainers.Models.DaprSubscriptionRoutes routes = null, System.Collections.Generic.IEnumerable scopes = null, System.Collections.Generic.IDictionary metadata = null, Azure.ResourceManager.AppContainers.Models.DaprSubscriptionBulkSubscribeConfig bulkSubscribe = null) { throw null; } + public static Azure.ResourceManager.AppContainers.DotNetComponentData DotNetComponentData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.AppContainers.Models.DotNetComponentType? componentType = default(Azure.ResourceManager.AppContainers.Models.DotNetComponentType?), Azure.ResourceManager.AppContainers.Models.DotNetComponentProvisioningState? provisioningState = default(Azure.ResourceManager.AppContainers.Models.DotNetComponentProvisioningState?), System.Collections.Generic.IEnumerable configurations = null, System.Collections.Generic.IEnumerable serviceBinds = null) { throw null; } + public static Azure.ResourceManager.AppContainers.HttpRouteConfigData HttpRouteConfigData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.AppContainers.Models.HttpRouteConfigProperties properties = null) { throw null; } + public static Azure.ResourceManager.AppContainers.Models.HttpRouteConfigProperties HttpRouteConfigProperties(Azure.ResourceManager.AppContainers.Models.HttpRouteProvisioningState? provisioningState = default(Azure.ResourceManager.AppContainers.Models.HttpRouteProvisioningState?), System.Collections.Generic.IEnumerable provisioningErrors = null, string fqdn = null, System.Collections.Generic.IEnumerable customDomains = null, System.Collections.Generic.IEnumerable rules = null) { throw null; } + public static Azure.ResourceManager.AppContainers.Models.HttpRouteProvisioningErrors HttpRouteProvisioningErrors(System.DateTimeOffset? timestamp = default(System.DateTimeOffset?), string message = null) { throw null; } public static Azure.ResourceManager.AppContainers.JavaComponentData JavaComponentData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.AppContainers.Models.JavaComponentProperties properties = null) { throw null; } public static Azure.ResourceManager.AppContainers.Models.JavaComponentProperties JavaComponentProperties(string componentType = null, Azure.ResourceManager.AppContainers.Models.JavaComponentProvisioningState? provisioningState = default(Azure.ResourceManager.AppContainers.Models.JavaComponentProvisioningState?), System.Collections.Generic.IEnumerable configurations = null, Azure.ResourceManager.AppContainers.Models.JavaComponentPropertiesScale scale = null, System.Collections.Generic.IEnumerable serviceBinds = null) { throw null; } + public static Azure.ResourceManager.AppContainers.LabelHistoryData LabelHistoryData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IEnumerable labelHistoryRecords = null) { throw null; } + public static Azure.ResourceManager.AppContainers.Models.LabelHistoryRecordItem LabelHistoryRecordItem(string revision = null, System.DateTimeOffset? start = default(System.DateTimeOffset?), System.DateTimeOffset? stop = default(System.DateTimeOffset?), Azure.ResourceManager.AppContainers.Models.LabelHistoryRecordItemStatus? status = default(Azure.ResourceManager.AppContainers.Models.LabelHistoryRecordItemStatus?)) { throw null; } + public static Azure.ResourceManager.AppContainers.LogicAppData LogicAppData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.BinaryData properties = null) { throw null; } + public static Azure.ResourceManager.AppContainers.MaintenanceConfigurationResourceData MaintenanceConfigurationResourceData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IEnumerable scheduledEntries = null) { throw null; } public static Azure.ResourceManager.AppContainers.Models.ManagedCertificateProperties ManagedCertificateProperties(Azure.ResourceManager.AppContainers.Models.ContainerAppCertificateProvisioningState? provisioningState = default(Azure.ResourceManager.AppContainers.Models.ContainerAppCertificateProvisioningState?), string subjectName = null, string error = null, Azure.ResourceManager.AppContainers.Models.ManagedCertificateDomainControlValidation? domainControlValidation = default(Azure.ResourceManager.AppContainers.Models.ManagedCertificateDomainControlValidation?), string validationToken = null) { throw null; } + public static Azure.ResourceManager.AppContainers.Models.NacosComponent NacosComponent(Azure.ResourceManager.AppContainers.Models.JavaComponentProvisioningState? provisioningState = default(Azure.ResourceManager.AppContainers.Models.JavaComponentProvisioningState?), System.Collections.Generic.IEnumerable configurations = null, Azure.ResourceManager.AppContainers.Models.JavaComponentPropertiesScale scale = null, System.Collections.Generic.IEnumerable serviceBinds = null, string ingressFqdn = null) { throw null; } + public static Azure.ResourceManager.AppContainers.Models.PatchDetails PatchDetails(string targetContainerName = null, string targetImage = null, System.DateTimeOffset lastDetectionOn = default(System.DateTimeOffset), Azure.ResourceManager.AppContainers.Models.DetectionStatus detectionStatus = default(Azure.ResourceManager.AppContainers.Models.DetectionStatus), string newImageName = null, Azure.ResourceManager.AppContainers.Models.PatchDetailsNewLayer newLayer = null, Azure.ResourceManager.AppContainers.Models.PatchDetailsOldLayer oldLayer = null, Azure.ResourceManager.AppContainers.Models.PatchType? patchType = default(Azure.ResourceManager.AppContainers.Models.PatchType?)) { throw null; } + public static Azure.ResourceManager.AppContainers.Models.PatchDetailsNewLayer PatchDetailsNewLayer(string name = null, string frameworkAndVersion = null, string osAndVersion = null) { throw null; } + public static Azure.ResourceManager.AppContainers.Models.PatchDetailsOldLayer PatchDetailsOldLayer(string name = null, string frameworkAndVersion = null, string osAndVersion = null) { throw null; } + public static Azure.ResourceManager.AppContainers.Models.PatchProperties PatchProperties(Azure.Core.ResourceIdentifier targetEnvironmentId = null, Azure.Core.ResourceIdentifier targetContainerAppId = null, Azure.Core.ResourceIdentifier targetRevisionId = null, Azure.ResourceManager.AppContainers.Models.PatchApplyStatus? patchApplyStatus = default(Azure.ResourceManager.AppContainers.Models.PatchApplyStatus?), System.DateTimeOffset? createdOn = default(System.DateTimeOffset?), System.DateTimeOffset? lastModifiedOn = default(System.DateTimeOffset?), System.Collections.Generic.IEnumerable patchDetails = null) { throw null; } + public static Azure.ResourceManager.AppContainers.Models.ReplicaExecutionStatus ReplicaExecutionStatus(string name = null, System.Collections.Generic.IEnumerable containers = null) { throw null; } public static Azure.ResourceManager.AppContainers.SessionPoolData SessionPoolData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IDictionary tags = null, Azure.Core.AzureLocation location = default(Azure.Core.AzureLocation), Azure.ResourceManager.Models.ManagedServiceIdentity identity = null, Azure.Core.ResourceIdentifier environmentId = null, Azure.ResourceManager.AppContainers.Models.ContainerType? containerType = default(Azure.ResourceManager.AppContainers.Models.ContainerType?), Azure.ResourceManager.AppContainers.Models.PoolManagementType? poolManagementType = default(Azure.ResourceManager.AppContainers.Models.PoolManagementType?), int? nodeCount = default(int?), Azure.ResourceManager.AppContainers.Models.SessionPoolScaleConfiguration scaleConfiguration = null, System.Collections.Generic.IEnumerable secrets = null, Azure.ResourceManager.AppContainers.Models.SessionPoolLifecycleConfiguration dynamicPoolLifecycleConfiguration = null, Azure.ResourceManager.AppContainers.Models.CustomContainerTemplate customContainerTemplate = null, Azure.ResourceManager.AppContainers.Models.SessionNetworkStatus? sessionNetworkStatus = default(Azure.ResourceManager.AppContainers.Models.SessionNetworkStatus?), System.Uri poolManagementEndpoint = null, Azure.ResourceManager.AppContainers.Models.SessionPoolProvisioningState? provisioningState = default(Azure.ResourceManager.AppContainers.Models.SessionPoolProvisioningState?), System.Collections.Generic.IEnumerable managedIdentitySettings = null) { throw null; } public static Azure.ResourceManager.AppContainers.Models.SpringBootAdminComponent SpringBootAdminComponent(Azure.ResourceManager.AppContainers.Models.JavaComponentProvisioningState? provisioningState = default(Azure.ResourceManager.AppContainers.Models.JavaComponentProvisioningState?), System.Collections.Generic.IEnumerable configurations = null, Azure.ResourceManager.AppContainers.Models.JavaComponentPropertiesScale scale = null, System.Collections.Generic.IEnumerable serviceBinds = null, string ingressFqdn = null) { throw null; } public static Azure.ResourceManager.AppContainers.Models.SpringCloudConfigComponent SpringCloudConfigComponent(Azure.ResourceManager.AppContainers.Models.JavaComponentProvisioningState? provisioningState = default(Azure.ResourceManager.AppContainers.Models.JavaComponentProvisioningState?), System.Collections.Generic.IEnumerable configurations = null, Azure.ResourceManager.AppContainers.Models.JavaComponentPropertiesScale scale = null, System.Collections.Generic.IEnumerable serviceBinds = null) { throw null; } public static Azure.ResourceManager.AppContainers.Models.SpringCloudEurekaComponent SpringCloudEurekaComponent(Azure.ResourceManager.AppContainers.Models.JavaComponentProvisioningState? provisioningState = default(Azure.ResourceManager.AppContainers.Models.JavaComponentProvisioningState?), System.Collections.Generic.IEnumerable configurations = null, Azure.ResourceManager.AppContainers.Models.JavaComponentPropertiesScale scale = null, System.Collections.Generic.IEnumerable serviceBinds = null, string ingressFqdn = null) { throw null; } + public static Azure.ResourceManager.AppContainers.Models.SpringCloudGatewayComponent SpringCloudGatewayComponent(Azure.ResourceManager.AppContainers.Models.JavaComponentProvisioningState? provisioningState = default(Azure.ResourceManager.AppContainers.Models.JavaComponentProvisioningState?), System.Collections.Generic.IEnumerable configurations = null, Azure.ResourceManager.AppContainers.Models.JavaComponentPropertiesScale scale = null, System.Collections.Generic.IEnumerable serviceBinds = null, string ingressFqdn = null, System.Collections.Generic.IEnumerable springCloudGatewayRoutes = null) { throw null; } + public static Azure.ResourceManager.AppContainers.WorkflowEnvelopeData WorkflowEnvelopeData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, string kind = null, Azure.Core.AzureLocation? location = default(Azure.Core.AzureLocation?), Azure.ResourceManager.AppContainers.Models.ContainerAppWorkflowEnvelopeProperties properties = null) { throw null; } } - [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] - public readonly partial struct ContainerAppAccessMode : System.IEquatable + public partial class BuilderResourcePatch : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { - private readonly object _dummy; - private readonly int _dummyPrimitive; - public ContainerAppAccessMode(string value) { throw null; } + public BuilderResourcePatch() { } + public Azure.Core.ResourceIdentifier EnvironmentId { get { throw null; } set { } } + public Azure.ResourceManager.Models.ManagedServiceIdentity Identity { get { throw null; } set { } } + public System.Collections.Generic.IDictionary Tags { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.Models.BuilderResourcePatch System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.Models.BuilderResourcePatch System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class CircuitBreakerPolicy : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public CircuitBreakerPolicy() { } + public int? ConsecutiveErrors { get { throw null; } set { } } + public int? IntervalInSeconds { get { throw null; } set { } } + public int? MaxEjectionPercent { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.Models.CircuitBreakerPolicy System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.Models.CircuitBreakerPolicy System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct ConnectedEnvironmentDaprComponentProvisioningState : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public ConnectedEnvironmentDaprComponentProvisioningState(string value) { throw null; } + public static Azure.ResourceManager.AppContainers.Models.ConnectedEnvironmentDaprComponentProvisioningState Canceled { get { throw null; } } + public static Azure.ResourceManager.AppContainers.Models.ConnectedEnvironmentDaprComponentProvisioningState Deleting { get { throw null; } } + public static Azure.ResourceManager.AppContainers.Models.ConnectedEnvironmentDaprComponentProvisioningState Failed { get { throw null; } } + public static Azure.ResourceManager.AppContainers.Models.ConnectedEnvironmentDaprComponentProvisioningState InProgress { get { throw null; } } + public static Azure.ResourceManager.AppContainers.Models.ConnectedEnvironmentDaprComponentProvisioningState Succeeded { get { throw null; } } + public bool Equals(Azure.ResourceManager.AppContainers.Models.ConnectedEnvironmentDaprComponentProvisioningState other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.AppContainers.Models.ConnectedEnvironmentDaprComponentProvisioningState left, Azure.ResourceManager.AppContainers.Models.ConnectedEnvironmentDaprComponentProvisioningState right) { throw null; } + public static implicit operator Azure.ResourceManager.AppContainers.Models.ConnectedEnvironmentDaprComponentProvisioningState (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.AppContainers.Models.ConnectedEnvironmentDaprComponentProvisioningState left, Azure.ResourceManager.AppContainers.Models.ConnectedEnvironmentDaprComponentProvisioningState right) { throw null; } + public override string ToString() { throw null; } + } + public partial class ConnectedEnvironmentStorageProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ConnectedEnvironmentStorageProperties() { } + public Azure.ResourceManager.AppContainers.Models.ContainerAppAzureFileProperties AzureFile { get { throw null; } set { } } + public string DeploymentErrors { get { throw null; } } + public Azure.ResourceManager.AppContainers.Models.ConnectedEnvironmentStorageProvisioningState? ProvisioningState { get { throw null; } } + public Azure.ResourceManager.AppContainers.Models.SmbStorage Smb { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.Models.ConnectedEnvironmentStorageProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.Models.ConnectedEnvironmentStorageProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct ConnectedEnvironmentStorageProvisioningState : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public ConnectedEnvironmentStorageProvisioningState(string value) { throw null; } + public static Azure.ResourceManager.AppContainers.Models.ConnectedEnvironmentStorageProvisioningState Canceled { get { throw null; } } + public static Azure.ResourceManager.AppContainers.Models.ConnectedEnvironmentStorageProvisioningState Deleting { get { throw null; } } + public static Azure.ResourceManager.AppContainers.Models.ConnectedEnvironmentStorageProvisioningState Failed { get { throw null; } } + public static Azure.ResourceManager.AppContainers.Models.ConnectedEnvironmentStorageProvisioningState InProgress { get { throw null; } } + public static Azure.ResourceManager.AppContainers.Models.ConnectedEnvironmentStorageProvisioningState Succeeded { get { throw null; } } + public bool Equals(Azure.ResourceManager.AppContainers.Models.ConnectedEnvironmentStorageProvisioningState other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.AppContainers.Models.ConnectedEnvironmentStorageProvisioningState left, Azure.ResourceManager.AppContainers.Models.ConnectedEnvironmentStorageProvisioningState right) { throw null; } + public static implicit operator Azure.ResourceManager.AppContainers.Models.ConnectedEnvironmentStorageProvisioningState (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.AppContainers.Models.ConnectedEnvironmentStorageProvisioningState left, Azure.ResourceManager.AppContainers.Models.ConnectedEnvironmentStorageProvisioningState right) { throw null; } + public override string ToString() { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct ContainerAppAccessMode : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public ContainerAppAccessMode(string value) { throw null; } public static Azure.ResourceManager.AppContainers.Models.ContainerAppAccessMode ReadOnly { get { throw null; } } public static Azure.ResourceManager.AppContainers.Models.ContainerAppAccessMode ReadWrite { get { throw null; } } public bool Equals(Azure.ResourceManager.AppContainers.Models.ContainerAppAccessMode other) { throw null; } @@ -1505,6 +2541,7 @@ public static partial class ArmAppContainersModelFactory private readonly object _dummy; private readonly int _dummyPrimitive; public ContainerAppActiveRevisionsMode(string value) { throw null; } + public static Azure.ResourceManager.AppContainers.Models.ContainerAppActiveRevisionsMode Labels { get { throw null; } } public static Azure.ResourceManager.AppContainers.Models.ContainerAppActiveRevisionsMode Multiple { get { throw null; } } public static Azure.ResourceManager.AppContainers.Models.ContainerAppActiveRevisionsMode Single { get { throw null; } } public bool Equals(Azure.ResourceManager.AppContainers.Models.ContainerAppActiveRevisionsMode other) { throw null; } @@ -1687,6 +2724,7 @@ public partial class ContainerAppAzureFileProperties : System.ClientModel.Primit public ContainerAppAzureFileProperties() { } public Azure.ResourceManager.AppContainers.Models.ContainerAppAccessMode? AccessMode { get { throw null; } set { } } public string AccountKey { get { throw null; } set { } } + public Azure.ResourceManager.AppContainers.Models.SecretKeyVaultProperties AccountKeyVaultProperties { get { throw null; } set { } } public string AccountName { get { throw null; } set { } } public string ShareName { get { throw null; } set { } } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } @@ -1715,6 +2753,7 @@ public ContainerAppBaseContainer() { } public System.Collections.Generic.IList Command { get { throw null; } } public System.Collections.Generic.IList Env { get { throw null; } } public string Image { get { throw null; } set { } } + public Azure.ResourceManager.AppContainers.Models.ImageType? ImageType { get { throw null; } set { } } public string Name { get { throw null; } set { } } public Azure.ResourceManager.AppContainers.Models.AppContainerResources Resources { get { throw null; } set { } } public System.Collections.Generic.IList VolumeMounts { get { throw null; } } @@ -1727,9 +2766,9 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer } public partial class ContainerAppBillingMeter : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { - public ContainerAppBillingMeter() { } - public Azure.Core.AzureLocation? Location { get { throw null; } set { } } - public Azure.ResourceManager.AppContainers.Models.ContainerAppBillingMeterProperties Properties { get { throw null; } set { } } + internal ContainerAppBillingMeter() { } + public Azure.Core.AzureLocation? Location { get { throw null; } } + public Azure.ResourceManager.AppContainers.Models.ContainerAppBillingMeterProperties Properties { get { throw null; } } protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.AppContainers.Models.ContainerAppBillingMeter System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } @@ -1759,12 +2798,12 @@ protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter write } public partial class ContainerAppBillingMeterProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { - public ContainerAppBillingMeterProperties() { } + internal ContainerAppBillingMeterProperties() { } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] - public Azure.ResourceManager.AppContainers.Models.ContainerAppBillingMeterCategory? Category { get { throw null; } set { } } - public string DisplayName { get { throw null; } set { } } - public string MeterType { get { throw null; } set { } } - public string WorkloadProfileCategory { get { throw null; } set { } } + public Azure.ResourceManager.AppContainers.Models.ContainerAppBillingMeterCategory? Category { get { throw null; } } + public string DisplayName { get { throw null; } } + public string MeterType { get { throw null; } } + public string WorkloadProfileCategory { get { throw null; } } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.AppContainers.Models.ContainerAppBillingMeterProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } @@ -1772,6 +2811,112 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } + public partial class ContainerAppBlobStorageTokenStore : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ContainerAppBlobStorageTokenStore() { } + public System.Uri BlobContainerUri { get { throw null; } set { } } + public string ClientId { get { throw null; } set { } } + public string ManagedIdentityResourceId { get { throw null; } set { } } + public string SasUrlSettingName { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.Models.ContainerAppBlobStorageTokenStore System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.Models.ContainerAppBlobStorageTokenStore System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ContainerAppBuildConfiguration : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ContainerAppBuildConfiguration() { } + public string BaseOS { get { throw null; } set { } } + public System.Collections.Generic.IList EnvironmentVariables { get { throw null; } } + public string Platform { get { throw null; } set { } } + public string PlatformVersion { get { throw null; } set { } } + public System.Collections.Generic.IList PreBuildSteps { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.Models.ContainerAppBuildConfiguration System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.Models.ContainerAppBuildConfiguration System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct ContainerAppBuilderProvisioningState : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public ContainerAppBuilderProvisioningState(string value) { throw null; } + public static Azure.ResourceManager.AppContainers.Models.ContainerAppBuilderProvisioningState Canceled { get { throw null; } } + public static Azure.ResourceManager.AppContainers.Models.ContainerAppBuilderProvisioningState Creating { get { throw null; } } + public static Azure.ResourceManager.AppContainers.Models.ContainerAppBuilderProvisioningState Deleting { get { throw null; } } + public static Azure.ResourceManager.AppContainers.Models.ContainerAppBuilderProvisioningState Failed { get { throw null; } } + public static Azure.ResourceManager.AppContainers.Models.ContainerAppBuilderProvisioningState Succeeded { get { throw null; } } + public static Azure.ResourceManager.AppContainers.Models.ContainerAppBuilderProvisioningState Updating { get { throw null; } } + public bool Equals(Azure.ResourceManager.AppContainers.Models.ContainerAppBuilderProvisioningState other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.AppContainers.Models.ContainerAppBuilderProvisioningState left, Azure.ResourceManager.AppContainers.Models.ContainerAppBuilderProvisioningState right) { throw null; } + public static implicit operator Azure.ResourceManager.AppContainers.Models.ContainerAppBuilderProvisioningState (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.AppContainers.Models.ContainerAppBuilderProvisioningState left, Azure.ResourceManager.AppContainers.Models.ContainerAppBuilderProvisioningState right) { throw null; } + public override string ToString() { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct ContainerAppBuildProvisioningState : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public ContainerAppBuildProvisioningState(string value) { throw null; } + public static Azure.ResourceManager.AppContainers.Models.ContainerAppBuildProvisioningState Canceled { get { throw null; } } + public static Azure.ResourceManager.AppContainers.Models.ContainerAppBuildProvisioningState Creating { get { throw null; } } + public static Azure.ResourceManager.AppContainers.Models.ContainerAppBuildProvisioningState Deleting { get { throw null; } } + public static Azure.ResourceManager.AppContainers.Models.ContainerAppBuildProvisioningState Failed { get { throw null; } } + public static Azure.ResourceManager.AppContainers.Models.ContainerAppBuildProvisioningState Succeeded { get { throw null; } } + public static Azure.ResourceManager.AppContainers.Models.ContainerAppBuildProvisioningState Updating { get { throw null; } } + public bool Equals(Azure.ResourceManager.AppContainers.Models.ContainerAppBuildProvisioningState other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.AppContainers.Models.ContainerAppBuildProvisioningState left, Azure.ResourceManager.AppContainers.Models.ContainerAppBuildProvisioningState right) { throw null; } + public static implicit operator Azure.ResourceManager.AppContainers.Models.ContainerAppBuildProvisioningState (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.AppContainers.Models.ContainerAppBuildProvisioningState left, Azure.ResourceManager.AppContainers.Models.ContainerAppBuildProvisioningState right) { throw null; } + public override string ToString() { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct ContainerAppBuildStatus : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public ContainerAppBuildStatus(string value) { throw null; } + public static Azure.ResourceManager.AppContainers.Models.ContainerAppBuildStatus Canceled { get { throw null; } } + public static Azure.ResourceManager.AppContainers.Models.ContainerAppBuildStatus Failed { get { throw null; } } + public static Azure.ResourceManager.AppContainers.Models.ContainerAppBuildStatus InProgress { get { throw null; } } + public static Azure.ResourceManager.AppContainers.Models.ContainerAppBuildStatus NotStarted { get { throw null; } } + public static Azure.ResourceManager.AppContainers.Models.ContainerAppBuildStatus Succeeded { get { throw null; } } + public bool Equals(Azure.ResourceManager.AppContainers.Models.ContainerAppBuildStatus other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.AppContainers.Models.ContainerAppBuildStatus left, Azure.ResourceManager.AppContainers.Models.ContainerAppBuildStatus right) { throw null; } + public static implicit operator Azure.ResourceManager.AppContainers.Models.ContainerAppBuildStatus (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.AppContainers.Models.ContainerAppBuildStatus left, Azure.ResourceManager.AppContainers.Models.ContainerAppBuildStatus right) { throw null; } + public override string ToString() { throw null; } + } + public partial class ContainerAppBuildToken : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal ContainerAppBuildToken() { } + public System.DateTimeOffset? Expires { get { throw null; } } + public string Token { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.Models.ContainerAppBuildToken System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.Models.ContainerAppBuildToken System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } public partial class ContainerAppCertificateKeyVaultProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public ContainerAppCertificateKeyVaultProperties() { } @@ -1799,6 +2944,8 @@ public partial class ContainerAppCertificateProperties : System.ClientModel.Prim { public ContainerAppCertificateProperties() { } public Azure.ResourceManager.AppContainers.Models.ContainerAppCertificateKeyVaultProperties CertificateKeyVaultProperties { get { throw null; } set { } } + public Azure.ResourceManager.AppContainers.Models.ContainerAppCertificateType? CertificateType { get { throw null; } set { } } + public string DeploymentErrors { get { throw null; } } public System.DateTimeOffset? ExpireOn { get { throw null; } } public System.DateTimeOffset? IssueOn { get { throw null; } } public string Issuer { get { throw null; } } @@ -1825,6 +2972,7 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer public ContainerAppCertificateProvisioningState(string value) { throw null; } public static Azure.ResourceManager.AppContainers.Models.ContainerAppCertificateProvisioningState Canceled { get { throw null; } } public static Azure.ResourceManager.AppContainers.Models.ContainerAppCertificateProvisioningState DeleteFailed { get { throw null; } } + public static Azure.ResourceManager.AppContainers.Models.ContainerAppCertificateProvisioningState Deleting { get { throw null; } } public static Azure.ResourceManager.AppContainers.Models.ContainerAppCertificateProvisioningState Failed { get { throw null; } } public static Azure.ResourceManager.AppContainers.Models.ContainerAppCertificateProvisioningState Pending { get { throw null; } } public static Azure.ResourceManager.AppContainers.Models.ContainerAppCertificateProvisioningState Succeeded { get { throw null; } } @@ -1838,6 +2986,24 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer public static bool operator !=(Azure.ResourceManager.AppContainers.Models.ContainerAppCertificateProvisioningState left, Azure.ResourceManager.AppContainers.Models.ContainerAppCertificateProvisioningState right) { throw null; } public override string ToString() { throw null; } } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct ContainerAppCertificateType : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public ContainerAppCertificateType(string value) { throw null; } + public static Azure.ResourceManager.AppContainers.Models.ContainerAppCertificateType ImagePullTrustedCA { get { throw null; } } + public static Azure.ResourceManager.AppContainers.Models.ContainerAppCertificateType ServerSSLCertificate { get { throw null; } } + public bool Equals(Azure.ResourceManager.AppContainers.Models.ContainerAppCertificateType other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.AppContainers.Models.ContainerAppCertificateType left, Azure.ResourceManager.AppContainers.Models.ContainerAppCertificateType right) { throw null; } + public static implicit operator Azure.ResourceManager.AppContainers.Models.ContainerAppCertificateType (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.AppContainers.Models.ContainerAppCertificateType left, Azure.ResourceManager.AppContainers.Models.ContainerAppCertificateType right) { throw null; } + public override string ToString() { throw null; } + } public partial class ContainerAppClientRegistration : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public ContainerAppClientRegistration() { } @@ -1855,13 +3021,15 @@ public partial class ContainerAppConfiguration : System.ClientModel.Primitives.I public ContainerAppConfiguration() { } public Azure.ResourceManager.AppContainers.Models.ContainerAppActiveRevisionsMode? ActiveRevisionsMode { get { throw null; } set { } } public Azure.ResourceManager.AppContainers.Models.ContainerAppDaprConfiguration Dapr { get { throw null; } set { } } - public bool? EnableMetrics { get { throw null; } set { } } public System.Collections.Generic.IList IdentitySettings { get { throw null; } } public Azure.ResourceManager.AppContainers.Models.ContainerAppIngressConfiguration Ingress { get { throw null; } set { } } public int? MaxInactiveRevisions { get { throw null; } set { } } public System.Collections.Generic.IList Registries { get { throw null; } } + public int? RevisionTransitionThreshold { get { throw null; } set { } } + public Azure.ResourceManager.AppContainers.Models.ContainerAppRuntime Runtime { get { throw null; } set { } } public System.Collections.Generic.IList Secrets { get { throw null; } } public string ServiceType { get { throw null; } set { } } + public string TargetLabel { get { throw null; } set { } } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.AppContainers.Models.ContainerAppConfiguration System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } @@ -1869,6 +3037,16 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } + public partial class ContainerAppConnectedEnvironmentPatch : Azure.ResourceManager.AppContainers.Models.ContainerAppResourceTags, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ContainerAppConnectedEnvironmentPatch() { } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.Models.ContainerAppConnectedEnvironmentPatch System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.Models.ContainerAppConnectedEnvironmentPatch System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] public readonly partial struct ContainerAppConnectedEnvironmentProvisioningState : System.IEquatable { @@ -1904,6 +3082,18 @@ protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter write string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } + public partial class ContainerAppContainerRegistry : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ContainerAppContainerRegistry(string containerRegistryServer, Azure.Core.ResourceIdentifier identityResourceId) { } + public string ContainerRegistryServer { get { throw null; } set { } } + public Azure.Core.ResourceIdentifier IdentityResourceId { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.Models.ContainerAppContainerRegistry System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.Models.ContainerAppContainerRegistry System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] public readonly partial struct ContainerAppContainerRunningState : System.IEquatable { @@ -1991,6 +3181,7 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer private readonly object _dummy; private readonly int _dummyPrimitive; public ContainerAppCustomDomainBindingType(string value) { throw null; } + public static Azure.ResourceManager.AppContainers.Models.ContainerAppCustomDomainBindingType Auto { get { throw null; } } public static Azure.ResourceManager.AppContainers.Models.ContainerAppCustomDomainBindingType Disabled { get { throw null; } } public static Azure.ResourceManager.AppContainers.Models.ContainerAppCustomDomainBindingType SniEnabled { get { throw null; } } public bool Equals(Azure.ResourceManager.AppContainers.Models.ContainerAppCustomDomainBindingType other) { throw null; } @@ -2100,6 +3291,7 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer public partial class ContainerAppDaprConfiguration : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public ContainerAppDaprConfiguration() { } + public Azure.ResourceManager.AppContainers.Models.DaprAppHealth AppHealth { get { throw null; } set { } } public string AppId { get { throw null; } set { } } public int? AppPort { get { throw null; } set { } } public Azure.ResourceManager.AppContainers.Models.ContainerAppProtocol? AppProtocol { get { throw null; } set { } } @@ -2108,6 +3300,7 @@ public ContainerAppDaprConfiguration() { } public bool? IsApiLoggingEnabled { get { throw null; } set { } } public bool? IsEnabled { get { throw null; } set { } } public Azure.ResourceManager.AppContainers.Models.ContainerAppDaprLogLevel? LogLevel { get { throw null; } set { } } + public int? MaxConcurrency { get { throw null; } set { } } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.AppContainers.Models.ContainerAppDaprConfiguration System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } @@ -2425,7 +3618,9 @@ public partial class ContainerAppGitHubActionConfiguration : System.ClientModel. { public ContainerAppGitHubActionConfiguration() { } public Azure.ResourceManager.AppContainers.Models.ContainerAppCredentials AzureCredentials { get { throw null; } set { } } + public System.Collections.Generic.IList BuildEnvironmentVariables { get { throw null; } } public string ContextPath { get { throw null; } set { } } + public string DockerfilePath { get { throw null; } set { } } public string GitHubPersonalAccessToken { get { throw null; } set { } } public string Image { get { throw null; } set { } } public string OS { get { throw null; } set { } } @@ -2634,6 +3829,7 @@ public ContainerAppIngressConfiguration() { } public System.Collections.Generic.IList IPSecurityRestrictions { get { throw null; } } public Azure.ResourceManager.AppContainers.Models.Affinity? StickySessionsAffinity { get { throw null; } set { } } public int? TargetPort { get { throw null; } set { } } + public Azure.ResourceManager.AppContainers.Models.IngressTargetPortHttpScheme? TargetPortHttpScheme { get { throw null; } set { } } public System.Collections.Generic.IList Traffic { get { throw null; } } public Azure.ResourceManager.AppContainers.Models.ContainerAppIngressTransportMethod? Transport { get { throw null; } set { } } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } @@ -2763,6 +3959,7 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer public partial class ContainerAppJobPatch : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public ContainerAppJobPatch() { } + public Azure.ResourceManager.AppContainers.Models.ContainerAppExtendedLocation ExtendedLocation { get { throw null; } set { } } public Azure.ResourceManager.Models.ManagedServiceIdentity Identity { get { throw null; } set { } } public Azure.ResourceManager.AppContainers.Models.ContainerAppJobPatchProperties Properties { get { throw null; } set { } } public System.Collections.Generic.IDictionary Tags { get { throw null; } } @@ -2809,6 +4006,25 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer public static bool operator !=(Azure.ResourceManager.AppContainers.Models.ContainerAppJobProvisioningState left, Azure.ResourceManager.AppContainers.Models.ContainerAppJobProvisioningState right) { throw null; } public override string ToString() { throw null; } } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct ContainerAppJobRunningState : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public ContainerAppJobRunningState(string value) { throw null; } + public static Azure.ResourceManager.AppContainers.Models.ContainerAppJobRunningState Progressing { get { throw null; } } + public static Azure.ResourceManager.AppContainers.Models.ContainerAppJobRunningState Ready { get { throw null; } } + public static Azure.ResourceManager.AppContainers.Models.ContainerAppJobRunningState Suspended { get { throw null; } } + public bool Equals(Azure.ResourceManager.AppContainers.Models.ContainerAppJobRunningState other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.AppContainers.Models.ContainerAppJobRunningState left, Azure.ResourceManager.AppContainers.Models.ContainerAppJobRunningState right) { throw null; } + public static implicit operator Azure.ResourceManager.AppContainers.Models.ContainerAppJobRunningState (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.AppContainers.Models.ContainerAppJobRunningState left, Azure.ResourceManager.AppContainers.Models.ContainerAppJobRunningState right) { throw null; } + public override string ToString() { throw null; } + } public partial class ContainerAppJobScale : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public ContainerAppJobScale() { } @@ -2886,6 +4102,7 @@ public partial class ContainerAppLogAnalyticsConfiguration : System.ClientModel. { public ContainerAppLogAnalyticsConfiguration() { } public string CustomerId { get { throw null; } set { } } + public bool? DynamicJsonColumns { get { throw null; } set { } } public string SharedKey { get { throw null; } set { } } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.AppContainers.Models.ContainerAppLogAnalyticsConfiguration System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -3234,6 +4451,7 @@ public partial class ContainerAppReplicaContainer : System.ClientModel.Primitive { public ContainerAppReplicaContainer() { } public string ContainerId { get { throw null; } set { } } + public string DebugEndpoint { get { throw null; } } public string ExecEndpoint { get { throw null; } } public bool? IsReady { get { throw null; } set { } } public bool? IsStarted { get { throw null; } set { } } @@ -3268,6 +4486,17 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer public static bool operator !=(Azure.ResourceManager.AppContainers.Models.ContainerAppReplicaRunningState left, Azure.ResourceManager.AppContainers.Models.ContainerAppReplicaRunningState right) { throw null; } public override string ToString() { throw null; } } + public partial class ContainerAppResourceTags : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ContainerAppResourceTags() { } + public System.Collections.Generic.IDictionary Tags { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.Models.ContainerAppResourceTags System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.Models.ContainerAppResourceTags System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] public readonly partial struct ContainerAppRevisionHealthState : System.IEquatable { @@ -3343,6 +4572,57 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer public static bool operator !=(Azure.ResourceManager.AppContainers.Models.ContainerAppRunningStatus left, Azure.ResourceManager.AppContainers.Models.ContainerAppRunningStatus right) { throw null; } public override string ToString() { throw null; } } + public partial class ContainerAppRuntime : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ContainerAppRuntime() { } + public bool? AutoConfigureDataProtection { get { throw null; } set { } } + public Azure.ResourceManager.AppContainers.Models.ContainerAppRuntimeJava Java { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.Models.ContainerAppRuntime System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.Models.ContainerAppRuntime System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ContainerAppRuntimeJava : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ContainerAppRuntimeJava() { } + public bool? EnableMetrics { get { throw null; } set { } } + public Azure.ResourceManager.AppContainers.Models.ContainerAppRuntimeJavaAgent JavaAgent { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.Models.ContainerAppRuntimeJava System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.Models.ContainerAppRuntimeJava System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ContainerAppRuntimeJavaAgent : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ContainerAppRuntimeJavaAgent() { } + public bool? IsEnabled { get { throw null; } set { } } + public System.Collections.Generic.IList LoggingLoggerSettings { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.Models.ContainerAppRuntimeJavaAgent System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.Models.ContainerAppRuntimeJavaAgent System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ContainerAppsBuildConfiguration : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal ContainerAppsBuildConfiguration() { } + public string BaseOS { get { throw null; } } + public System.Collections.Generic.IReadOnlyList EnvironmentVariables { get { throw null; } } + public string Platform { get { throw null; } } + public string PlatformVersion { get { throw null; } } + public System.Collections.Generic.IReadOnlyList PreBuildSteps { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.Models.ContainerAppsBuildConfiguration System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.Models.ContainerAppsBuildConfiguration System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } public partial class ContainerAppScale : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public ContainerAppScale() { } @@ -3402,6 +4682,8 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer public partial class ContainerAppServiceBind : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public ContainerAppServiceBind() { } + public string ClientType { get { throw null; } set { } } + public System.Collections.Generic.IDictionary CustomizedKeys { get { throw null; } } public string Name { get { throw null; } set { } } public Azure.Core.ResourceIdentifier ServiceId { get { throw null; } set { } } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } @@ -3411,6 +4693,18 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } + public partial class ContainerAppSimpleEnvironmentVariable : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ContainerAppSimpleEnvironmentVariable(string name, string value) { } + public string Name { get { throw null; } set { } } + public string Value { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.Models.ContainerAppSimpleEnvironmentVariable System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.Models.ContainerAppSimpleEnvironmentVariable System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] public readonly partial struct ContainerAppSourceControlOperationState : System.IEquatable { @@ -3441,6 +4735,7 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer public static Azure.ResourceManager.AppContainers.Models.ContainerAppStorageType EmptyDir { get { throw null; } } public static Azure.ResourceManager.AppContainers.Models.ContainerAppStorageType NfsAzureFile { get { throw null; } } public static Azure.ResourceManager.AppContainers.Models.ContainerAppStorageType Secret { get { throw null; } } + public static Azure.ResourceManager.AppContainers.Models.ContainerAppStorageType Smb { get { throw null; } } public bool Equals(Azure.ResourceManager.AppContainers.Models.ContainerAppStorageType other) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public override bool Equals(object obj) { throw null; } @@ -3493,10 +4788,22 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } + public partial class ContainerAppTimeoutPolicy : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ContainerAppTimeoutPolicy() { } + public int? ConnectionTimeoutInSeconds { get { throw null; } set { } } + public int? ResponseTimeoutInSeconds { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.Models.ContainerAppTimeoutPolicy System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.Models.ContainerAppTimeoutPolicy System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } public partial class ContainerAppTokenStore : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public ContainerAppTokenStore() { } - public string AzureBlobStorageSasUrlSettingName { get { throw null; } set { } } + public Azure.ResourceManager.AppContainers.Models.ContainerAppBlobStorageTokenStore AzureBlobStorage { get { throw null; } set { } } public bool? IsEnabled { get { throw null; } set { } } public double? TokenRefreshExtensionHours { get { throw null; } set { } } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } @@ -3629,10 +4936,88 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } + public enum ContainerAppWeekDay + { + Monday = 0, + Tuesday = 1, + Wednesday = 2, + Thursday = 3, + Friday = 4, + Saturday = 5, + Sunday = 6, + } + public partial class ContainerAppWorkflowArtifacts : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ContainerAppWorkflowArtifacts() { } + public System.BinaryData AppSettings { get { throw null; } set { } } + public System.BinaryData Files { get { throw null; } set { } } + public System.Collections.Generic.IList FilesToDelete { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.Models.ContainerAppWorkflowArtifacts System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.Models.ContainerAppWorkflowArtifacts System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ContainerAppWorkflowEnvelopeProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal ContainerAppWorkflowEnvelopeProperties() { } + public System.BinaryData Files { get { throw null; } } + public Azure.ResourceManager.AppContainers.Models.ContainerAppWorkflowState? FlowState { get { throw null; } } + public Azure.ResourceManager.AppContainers.Models.ContainerAppWorkflowHealth Health { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.Models.ContainerAppWorkflowEnvelopeProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.Models.ContainerAppWorkflowEnvelopeProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ContainerAppWorkflowHealth : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal ContainerAppWorkflowHealth() { } + public Azure.ResponseError Error { get { throw null; } } + public Azure.ResourceManager.AppContainers.Models.ContainerAppWorkflowHealthState State { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.Models.ContainerAppWorkflowHealth System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.Models.ContainerAppWorkflowHealth System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public enum ContainerAppWorkflowHealthState + { + Unknown = 0, + NotSpecified = 1, + Healthy = 2, + Unhealthy = 3, + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct ContainerAppWorkflowState : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public ContainerAppWorkflowState(string value) { throw null; } + public static Azure.ResourceManager.AppContainers.Models.ContainerAppWorkflowState Completed { get { throw null; } } + public static Azure.ResourceManager.AppContainers.Models.ContainerAppWorkflowState Deleted { get { throw null; } } + public static Azure.ResourceManager.AppContainers.Models.ContainerAppWorkflowState Disabled { get { throw null; } } + public static Azure.ResourceManager.AppContainers.Models.ContainerAppWorkflowState Enabled { get { throw null; } } + public static Azure.ResourceManager.AppContainers.Models.ContainerAppWorkflowState NotSpecified { get { throw null; } } + public static Azure.ResourceManager.AppContainers.Models.ContainerAppWorkflowState Suspended { get { throw null; } } + public bool Equals(Azure.ResourceManager.AppContainers.Models.ContainerAppWorkflowState other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.AppContainers.Models.ContainerAppWorkflowState left, Azure.ResourceManager.AppContainers.Models.ContainerAppWorkflowState right) { throw null; } + public static implicit operator Azure.ResourceManager.AppContainers.Models.ContainerAppWorkflowState (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.AppContainers.Models.ContainerAppWorkflowState left, Azure.ResourceManager.AppContainers.Models.ContainerAppWorkflowState right) { throw null; } + public override string ToString() { throw null; } + } public partial class ContainerAppWorkloadProfile : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public ContainerAppWorkloadProfile(string workloadProfileType, int minimumCount, int maximumCount) { } public ContainerAppWorkloadProfile(string name, string workloadProfileType) { } + public bool? EnableFips { get { throw null; } set { } } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public int MaximumCount { get { throw null; } set { } } public int? MaximumNodeCount { get { throw null; } set { } } @@ -3686,6 +5071,32 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } + public partial class ContainerExecutionStatus : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal ContainerExecutionStatus() { } + public string AdditionalInformation { get { throw null; } } + public int? Code { get { throw null; } } + public string Name { get { throw null; } } + public string Status { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.Models.ContainerExecutionStatus System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.Models.ContainerExecutionStatus System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ContainerRegistryWithCustomImage : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ContainerRegistryWithCustomImage(string server) { } + public string Image { get { throw null; } set { } } + public string Server { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.Models.ContainerRegistryWithCustomImage System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.Models.ContainerRegistryWithCustomImage System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] public readonly partial struct ContainerType : System.IEquatable { @@ -3717,6 +5128,250 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } + public partial class DaprAppHealth : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DaprAppHealth() { } + public bool? IsEnabled { get { throw null; } set { } } + public string Path { get { throw null; } set { } } + public int? ProbeIntervalSeconds { get { throw null; } set { } } + public int? ProbeTimeoutMilliseconds { get { throw null; } set { } } + public int? Threshold { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.Models.DaprAppHealth System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.Models.DaprAppHealth System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DaprComponentResiliencyPolicyCircuitBreakerPolicyConfiguration : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DaprComponentResiliencyPolicyCircuitBreakerPolicyConfiguration() { } + public int? ConsecutiveErrors { get { throw null; } set { } } + public int? IntervalInSeconds { get { throw null; } set { } } + public int? TimeoutInSeconds { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.Models.DaprComponentResiliencyPolicyCircuitBreakerPolicyConfiguration System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.Models.DaprComponentResiliencyPolicyCircuitBreakerPolicyConfiguration System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DaprComponentResiliencyPolicyConfiguration : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DaprComponentResiliencyPolicyConfiguration() { } + public Azure.ResourceManager.AppContainers.Models.DaprComponentResiliencyPolicyCircuitBreakerPolicyConfiguration CircuitBreakerPolicy { get { throw null; } set { } } + public Azure.ResourceManager.AppContainers.Models.DaprComponentResiliencyPolicyHttpRetryPolicyConfiguration HttpRetryPolicy { get { throw null; } set { } } + public int? ResponseTimeoutInSeconds { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.Models.DaprComponentResiliencyPolicyConfiguration System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.Models.DaprComponentResiliencyPolicyConfiguration System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DaprComponentResiliencyPolicyHttpRetryBackOffConfiguration : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DaprComponentResiliencyPolicyHttpRetryBackOffConfiguration() { } + public int? InitialDelayInMilliseconds { get { throw null; } set { } } + public int? MaxIntervalInMilliseconds { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.Models.DaprComponentResiliencyPolicyHttpRetryBackOffConfiguration System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.Models.DaprComponentResiliencyPolicyHttpRetryBackOffConfiguration System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DaprComponentResiliencyPolicyHttpRetryPolicyConfiguration : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DaprComponentResiliencyPolicyHttpRetryPolicyConfiguration() { } + public int? MaxRetries { get { throw null; } set { } } + public Azure.ResourceManager.AppContainers.Models.DaprComponentResiliencyPolicyHttpRetryBackOffConfiguration RetryBackOff { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.Models.DaprComponentResiliencyPolicyHttpRetryPolicyConfiguration System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.Models.DaprComponentResiliencyPolicyHttpRetryPolicyConfiguration System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DaprComponentServiceBinding : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DaprComponentServiceBinding() { } + public Azure.ResourceManager.AppContainers.Models.DaprServiceBindMetadata Metadata { get { throw null; } set { } } + public string Name { get { throw null; } set { } } + public string ServiceId { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.Models.DaprComponentServiceBinding System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.Models.DaprComponentServiceBinding System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DaprServiceBindMetadata : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DaprServiceBindMetadata() { } + public string Name { get { throw null; } set { } } + public string Value { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.Models.DaprServiceBindMetadata System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.Models.DaprServiceBindMetadata System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DaprSubscriptionBulkSubscribeConfig : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DaprSubscriptionBulkSubscribeConfig() { } + public bool? IsEnabled { get { throw null; } set { } } + public int? MaxAwaitDurationMs { get { throw null; } set { } } + public int? MaxMessagesCount { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.Models.DaprSubscriptionBulkSubscribeConfig System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.Models.DaprSubscriptionBulkSubscribeConfig System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DaprSubscriptionRouteRule : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DaprSubscriptionRouteRule() { } + public string Match { get { throw null; } set { } } + public string Path { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.Models.DaprSubscriptionRouteRule System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.Models.DaprSubscriptionRouteRule System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DaprSubscriptionRoutes : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DaprSubscriptionRoutes() { } + public string Default { get { throw null; } set { } } + public System.Collections.Generic.IList Rules { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.Models.DaprSubscriptionRoutes System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.Models.DaprSubscriptionRoutes System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DataDogConfiguration : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DataDogConfiguration() { } + public string Key { get { throw null; } set { } } + public string Site { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.Models.DataDogConfiguration System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.Models.DataDogConfiguration System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DestinationsConfiguration : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DestinationsConfiguration() { } + public Azure.ResourceManager.AppContainers.Models.DataDogConfiguration DataDogConfiguration { get { throw null; } set { } } + public System.Collections.Generic.IList OtlpConfigurations { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.Models.DestinationsConfiguration System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.Models.DestinationsConfiguration System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct DetectionStatus : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public DetectionStatus(string value) { throw null; } + public static Azure.ResourceManager.AppContainers.Models.DetectionStatus Failed { get { throw null; } } + public static Azure.ResourceManager.AppContainers.Models.DetectionStatus RegistryLoginFailed { get { throw null; } } + public static Azure.ResourceManager.AppContainers.Models.DetectionStatus Succeeded { get { throw null; } } + public bool Equals(Azure.ResourceManager.AppContainers.Models.DetectionStatus other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.AppContainers.Models.DetectionStatus left, Azure.ResourceManager.AppContainers.Models.DetectionStatus right) { throw null; } + public static implicit operator Azure.ResourceManager.AppContainers.Models.DetectionStatus (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.AppContainers.Models.DetectionStatus left, Azure.ResourceManager.AppContainers.Models.DetectionStatus right) { throw null; } + public override string ToString() { throw null; } + } + public partial class DiskEncryptionConfigurationKeyVaultConfiguration : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DiskEncryptionConfigurationKeyVaultConfiguration() { } + public Azure.Core.ResourceIdentifier AuthIdentity { get { throw null; } set { } } + public System.Uri KeyUri { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.Models.DiskEncryptionConfigurationKeyVaultConfiguration System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.Models.DiskEncryptionConfigurationKeyVaultConfiguration System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DotNetComponentConfigurationProperty : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DotNetComponentConfigurationProperty() { } + public string PropertyName { get { throw null; } set { } } + public string Value { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.Models.DotNetComponentConfigurationProperty System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.Models.DotNetComponentConfigurationProperty System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct DotNetComponentProvisioningState : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public DotNetComponentProvisioningState(string value) { throw null; } + public static Azure.ResourceManager.AppContainers.Models.DotNetComponentProvisioningState Canceled { get { throw null; } } + public static Azure.ResourceManager.AppContainers.Models.DotNetComponentProvisioningState Deleting { get { throw null; } } + public static Azure.ResourceManager.AppContainers.Models.DotNetComponentProvisioningState Failed { get { throw null; } } + public static Azure.ResourceManager.AppContainers.Models.DotNetComponentProvisioningState InProgress { get { throw null; } } + public static Azure.ResourceManager.AppContainers.Models.DotNetComponentProvisioningState Succeeded { get { throw null; } } + public bool Equals(Azure.ResourceManager.AppContainers.Models.DotNetComponentProvisioningState other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.AppContainers.Models.DotNetComponentProvisioningState left, Azure.ResourceManager.AppContainers.Models.DotNetComponentProvisioningState right) { throw null; } + public static implicit operator Azure.ResourceManager.AppContainers.Models.DotNetComponentProvisioningState (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.AppContainers.Models.DotNetComponentProvisioningState left, Azure.ResourceManager.AppContainers.Models.DotNetComponentProvisioningState right) { throw null; } + public override string ToString() { throw null; } + } + public partial class DotNetComponentServiceBind : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DotNetComponentServiceBind() { } + public string Name { get { throw null; } set { } } + public Azure.Core.ResourceIdentifier ServiceId { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.Models.DotNetComponentServiceBind System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.Models.DotNetComponentServiceBind System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct DotNetComponentType : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public DotNetComponentType(string value) { throw null; } + public static Azure.ResourceManager.AppContainers.Models.DotNetComponentType AspireDashboard { get { throw null; } } + public bool Equals(Azure.ResourceManager.AppContainers.Models.DotNetComponentType other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.AppContainers.Models.DotNetComponentType left, Azure.ResourceManager.AppContainers.Models.DotNetComponentType right) { throw null; } + public static implicit operator Azure.ResourceManager.AppContainers.Models.DotNetComponentType (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.AppContainers.Models.DotNetComponentType left, Azure.ResourceManager.AppContainers.Models.DotNetComponentType right) { throw null; } + public override string ToString() { throw null; } + } public partial class EncryptionSettings : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public EncryptionSettings() { } @@ -3742,6 +5397,222 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } + public partial class Header : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public Header() { } + public string Key { get { throw null; } set { } } + public string Value { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.Models.Header System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.Models.Header System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class HeaderMatch : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public HeaderMatch() { } + public string ExactMatch { get { throw null; } set { } } + public string Header { get { throw null; } set { } } + public string PrefixMatch { get { throw null; } set { } } + public string RegexMatch { get { throw null; } set { } } + public string SuffixMatch { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.Models.HeaderMatch System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.Models.HeaderMatch System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class HttpConnectionPool : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public HttpConnectionPool() { } + public int? Http1MaxPendingRequests { get { throw null; } set { } } + public int? Http2MaxRequests { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.Models.HttpConnectionPool System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.Models.HttpConnectionPool System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class HttpGet : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public HttpGet(System.Uri uri) { } + public string FileName { get { throw null; } set { } } + public System.Collections.Generic.IList Headers { get { throw null; } } + public System.Uri Uri { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.Models.HttpGet System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.Models.HttpGet System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class HttpRetryPolicy : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public HttpRetryPolicy() { } + public System.Collections.Generic.IList Errors { get { throw null; } } + public System.Collections.Generic.IList Headers { get { throw null; } } + public System.Collections.Generic.IList HttpStatusCodes { get { throw null; } } + public long? InitialDelayInMilliseconds { get { throw null; } set { } } + public long? MaxIntervalInMilliseconds { get { throw null; } set { } } + public int? MaxRetries { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.Models.HttpRetryPolicy System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.Models.HttpRetryPolicy System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class HttpRoute : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public HttpRoute() { } + public string ActionPrefixRewrite { get { throw null; } set { } } + public Azure.ResourceManager.AppContainers.Models.HttpRouteMatch Match { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.Models.HttpRoute System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.Models.HttpRoute System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class HttpRouteConfigProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public HttpRouteConfigProperties() { } + public System.Collections.Generic.IList CustomDomains { get { throw null; } } + public string Fqdn { get { throw null; } } + public System.Collections.Generic.IReadOnlyList ProvisioningErrors { get { throw null; } } + public Azure.ResourceManager.AppContainers.Models.HttpRouteProvisioningState? ProvisioningState { get { throw null; } } + public System.Collections.Generic.IList Rules { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.Models.HttpRouteConfigProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.Models.HttpRouteConfigProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class HttpRouteMatch : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public HttpRouteMatch() { } + public bool? CaseSensitive { get { throw null; } set { } } + public string Path { get { throw null; } set { } } + public string PathSeparatedPrefix { get { throw null; } set { } } + public string Prefix { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.Models.HttpRouteMatch System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.Models.HttpRouteMatch System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class HttpRouteProvisioningErrors : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal HttpRouteProvisioningErrors() { } + public string Message { get { throw null; } } + public System.DateTimeOffset? Timestamp { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.Models.HttpRouteProvisioningErrors System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.Models.HttpRouteProvisioningErrors System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct HttpRouteProvisioningState : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public HttpRouteProvisioningState(string value) { throw null; } + public static Azure.ResourceManager.AppContainers.Models.HttpRouteProvisioningState Canceled { get { throw null; } } + public static Azure.ResourceManager.AppContainers.Models.HttpRouteProvisioningState Deleting { get { throw null; } } + public static Azure.ResourceManager.AppContainers.Models.HttpRouteProvisioningState Failed { get { throw null; } } + public static Azure.ResourceManager.AppContainers.Models.HttpRouteProvisioningState Pending { get { throw null; } } + public static Azure.ResourceManager.AppContainers.Models.HttpRouteProvisioningState Succeeded { get { throw null; } } + public static Azure.ResourceManager.AppContainers.Models.HttpRouteProvisioningState Updating { get { throw null; } } + public static Azure.ResourceManager.AppContainers.Models.HttpRouteProvisioningState Waiting { get { throw null; } } + public bool Equals(Azure.ResourceManager.AppContainers.Models.HttpRouteProvisioningState other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.AppContainers.Models.HttpRouteProvisioningState left, Azure.ResourceManager.AppContainers.Models.HttpRouteProvisioningState right) { throw null; } + public static implicit operator Azure.ResourceManager.AppContainers.Models.HttpRouteProvisioningState (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.AppContainers.Models.HttpRouteProvisioningState left, Azure.ResourceManager.AppContainers.Models.HttpRouteProvisioningState right) { throw null; } + public override string ToString() { throw null; } + } + public partial class HttpRouteRule : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public HttpRouteRule() { } + public string Description { get { throw null; } set { } } + public System.Collections.Generic.IList Routes { get { throw null; } } + public System.Collections.Generic.IList Targets { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.Models.HttpRouteRule System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.Models.HttpRouteRule System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class HttpRouteTarget : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public HttpRouteTarget(string containerApp) { } + public string ContainerApp { get { throw null; } set { } } + public string Label { get { throw null; } set { } } + public string Revision { get { throw null; } set { } } + public int? Weight { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.Models.HttpRouteTarget System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.Models.HttpRouteTarget System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct ImageType : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public ImageType(string value) { throw null; } + public static Azure.ResourceManager.AppContainers.Models.ImageType CloudBuild { get { throw null; } } + public static Azure.ResourceManager.AppContainers.Models.ImageType ContainerImage { get { throw null; } } + public bool Equals(Azure.ResourceManager.AppContainers.Models.ImageType other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.AppContainers.Models.ImageType left, Azure.ResourceManager.AppContainers.Models.ImageType right) { throw null; } + public static implicit operator Azure.ResourceManager.AppContainers.Models.ImageType (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.AppContainers.Models.ImageType left, Azure.ResourceManager.AppContainers.Models.ImageType right) { throw null; } + public override string ToString() { throw null; } + } + public partial class IngressConfiguration : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public IngressConfiguration() { } + public int? HeaderCountLimit { get { throw null; } set { } } + public int? RequestIdleTimeout { get { throw null; } set { } } + public Azure.ResourceManager.AppContainers.Models.IngressConfigurationScale Scale { get { throw null; } set { } } + public int? TerminationGracePeriodSeconds { get { throw null; } set { } } + public string WorkloadProfileName { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.Models.IngressConfiguration System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.Models.IngressConfiguration System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class IngressConfigurationScale : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public IngressConfigurationScale() { } + public int? MaxReplicas { get { throw null; } set { } } + public int? MinReplicas { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.Models.IngressConfigurationScale System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.Models.IngressConfigurationScale System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } public partial class IngressPortMapping : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public IngressPortMapping(bool external, int targetPort) { } @@ -3755,6 +5626,24 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct IngressTargetPortHttpScheme : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public IngressTargetPortHttpScheme(string value) { throw null; } + public static Azure.ResourceManager.AppContainers.Models.IngressTargetPortHttpScheme Http { get { throw null; } } + public static Azure.ResourceManager.AppContainers.Models.IngressTargetPortHttpScheme Https { get { throw null; } } + public bool Equals(Azure.ResourceManager.AppContainers.Models.IngressTargetPortHttpScheme other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.AppContainers.Models.IngressTargetPortHttpScheme left, Azure.ResourceManager.AppContainers.Models.IngressTargetPortHttpScheme right) { throw null; } + public static implicit operator Azure.ResourceManager.AppContainers.Models.IngressTargetPortHttpScheme (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.AppContainers.Models.IngressTargetPortHttpScheme left, Azure.ResourceManager.AppContainers.Models.IngressTargetPortHttpScheme right) { throw null; } + public override string ToString() { throw null; } + } public partial class JavaComponentConfigurationProperty : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public JavaComponentConfigurationProperty() { } @@ -3890,6 +5779,91 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer public static bool operator !=(Azure.ResourceManager.AppContainers.Models.JobExecutionRunningState left, Azure.ResourceManager.AppContainers.Models.JobExecutionRunningState right) { throw null; } public override string ToString() { throw null; } } + public partial class LabelHistoryRecordItem : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal LabelHistoryRecordItem() { } + public string Revision { get { throw null; } } + public System.DateTimeOffset? Start { get { throw null; } } + public Azure.ResourceManager.AppContainers.Models.LabelHistoryRecordItemStatus? Status { get { throw null; } } + public System.DateTimeOffset? Stop { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.Models.LabelHistoryRecordItem System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.Models.LabelHistoryRecordItem System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct LabelHistoryRecordItemStatus : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public LabelHistoryRecordItemStatus(string value) { throw null; } + public static Azure.ResourceManager.AppContainers.Models.LabelHistoryRecordItemStatus Failed { get { throw null; } } + public static Azure.ResourceManager.AppContainers.Models.LabelHistoryRecordItemStatus Starting { get { throw null; } } + public static Azure.ResourceManager.AppContainers.Models.LabelHistoryRecordItemStatus Succeeded { get { throw null; } } + public bool Equals(Azure.ResourceManager.AppContainers.Models.LabelHistoryRecordItemStatus other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.AppContainers.Models.LabelHistoryRecordItemStatus left, Azure.ResourceManager.AppContainers.Models.LabelHistoryRecordItemStatus right) { throw null; } + public static implicit operator Azure.ResourceManager.AppContainers.Models.LabelHistoryRecordItemStatus (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.AppContainers.Models.LabelHistoryRecordItemStatus left, Azure.ResourceManager.AppContainers.Models.LabelHistoryRecordItemStatus right) { throw null; } + public override string ToString() { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct Level : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public Level(string value) { throw null; } + public static Azure.ResourceManager.AppContainers.Models.Level Debug { get { throw null; } } + public static Azure.ResourceManager.AppContainers.Models.Level Error { get { throw null; } } + public static Azure.ResourceManager.AppContainers.Models.Level Info { get { throw null; } } + public static Azure.ResourceManager.AppContainers.Models.Level Off { get { throw null; } } + public static Azure.ResourceManager.AppContainers.Models.Level Trace { get { throw null; } } + public static Azure.ResourceManager.AppContainers.Models.Level Warn { get { throw null; } } + public bool Equals(Azure.ResourceManager.AppContainers.Models.Level other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.AppContainers.Models.Level left, Azure.ResourceManager.AppContainers.Models.Level right) { throw null; } + public static implicit operator Azure.ResourceManager.AppContainers.Models.Level (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.AppContainers.Models.Level left, Azure.ResourceManager.AppContainers.Models.Level right) { throw null; } + public override string ToString() { throw null; } + } + public partial class LoggerSetting : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public LoggerSetting(string logger, Azure.ResourceManager.AppContainers.Models.Level level) { } + public Azure.ResourceManager.AppContainers.Models.Level Level { get { throw null; } set { } } + public string Logger { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.Models.LoggerSetting System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.Models.LoggerSetting System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct LogicAppsProxyMethod : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public LogicAppsProxyMethod(string value) { throw null; } + public static Azure.ResourceManager.AppContainers.Models.LogicAppsProxyMethod GET { get { throw null; } } + public static Azure.ResourceManager.AppContainers.Models.LogicAppsProxyMethod Post { get { throw null; } } + public bool Equals(Azure.ResourceManager.AppContainers.Models.LogicAppsProxyMethod other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.AppContainers.Models.LogicAppsProxyMethod left, Azure.ResourceManager.AppContainers.Models.LogicAppsProxyMethod right) { throw null; } + public static implicit operator Azure.ResourceManager.AppContainers.Models.LogicAppsProxyMethod (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.AppContainers.Models.LogicAppsProxyMethod left, Azure.ResourceManager.AppContainers.Models.LogicAppsProxyMethod right) { throw null; } + public override string ToString() { throw null; } + } [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] public readonly partial struct ManagedCertificateDomainControlValidation : System.IEquatable { @@ -3936,6 +5910,193 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } + public partial class MetricsConfiguration : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public MetricsConfiguration() { } + public System.Collections.Generic.IList Destinations { get { throw null; } } + public bool? IncludeKeda { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.Models.MetricsConfiguration System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.Models.MetricsConfiguration System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class NacosComponent : Azure.ResourceManager.AppContainers.Models.JavaComponentProperties, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public NacosComponent() { } + public string IngressFqdn { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.Models.NacosComponent System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.Models.NacosComponent System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class OpenTelemetryConfiguration : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public OpenTelemetryConfiguration() { } + public Azure.ResourceManager.AppContainers.Models.DestinationsConfiguration DestinationsConfiguration { get { throw null; } set { } } + public System.Collections.Generic.IList LogsDestinations { get { throw null; } } + public Azure.ResourceManager.AppContainers.Models.MetricsConfiguration MetricsConfiguration { get { throw null; } set { } } + public Azure.ResourceManager.AppContainers.Models.TracesConfiguration TracesConfiguration { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.Models.OpenTelemetryConfiguration System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.Models.OpenTelemetryConfiguration System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class OtlpConfiguration : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public OtlpConfiguration() { } + public string Endpoint { get { throw null; } set { } } + public System.Collections.Generic.IList Headers { get { throw null; } } + public bool? Insecure { get { throw null; } set { } } + public string Name { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.Models.OtlpConfiguration System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.Models.OtlpConfiguration System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct PatchApplyStatus : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public PatchApplyStatus(string value) { throw null; } + public static Azure.ResourceManager.AppContainers.Models.PatchApplyStatus Canceled { get { throw null; } } + public static Azure.ResourceManager.AppContainers.Models.PatchApplyStatus CreatingRevision { get { throw null; } } + public static Azure.ResourceManager.AppContainers.Models.PatchApplyStatus ImagePushPullFailed { get { throw null; } } + public static Azure.ResourceManager.AppContainers.Models.PatchApplyStatus ManuallySkipped { get { throw null; } } + public static Azure.ResourceManager.AppContainers.Models.PatchApplyStatus NotStarted { get { throw null; } } + public static Azure.ResourceManager.AppContainers.Models.PatchApplyStatus RebaseFailed { get { throw null; } } + public static Azure.ResourceManager.AppContainers.Models.PatchApplyStatus RebaseInProgress { get { throw null; } } + public static Azure.ResourceManager.AppContainers.Models.PatchApplyStatus RevisionCreationFailed { get { throw null; } } + public static Azure.ResourceManager.AppContainers.Models.PatchApplyStatus Succeeded { get { throw null; } } + public bool Equals(Azure.ResourceManager.AppContainers.Models.PatchApplyStatus other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.AppContainers.Models.PatchApplyStatus left, Azure.ResourceManager.AppContainers.Models.PatchApplyStatus right) { throw null; } + public static implicit operator Azure.ResourceManager.AppContainers.Models.PatchApplyStatus (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.AppContainers.Models.PatchApplyStatus left, Azure.ResourceManager.AppContainers.Models.PatchApplyStatus right) { throw null; } + public override string ToString() { throw null; } + } + public partial class PatchDetails : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal PatchDetails() { } + public Azure.ResourceManager.AppContainers.Models.DetectionStatus DetectionStatus { get { throw null; } } + public System.DateTimeOffset LastDetectionOn { get { throw null; } } + public string NewImageName { get { throw null; } } + public Azure.ResourceManager.AppContainers.Models.PatchDetailsNewLayer NewLayer { get { throw null; } } + public Azure.ResourceManager.AppContainers.Models.PatchDetailsOldLayer OldLayer { get { throw null; } } + public Azure.ResourceManager.AppContainers.Models.PatchType? PatchType { get { throw null; } } + public string TargetContainerName { get { throw null; } } + public string TargetImage { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.Models.PatchDetails System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.Models.PatchDetails System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class PatchDetailsNewLayer : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal PatchDetailsNewLayer() { } + public string FrameworkAndVersion { get { throw null; } } + public string Name { get { throw null; } } + public string OSAndVersion { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.Models.PatchDetailsNewLayer System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.Models.PatchDetailsNewLayer System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class PatchDetailsOldLayer : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal PatchDetailsOldLayer() { } + public string FrameworkAndVersion { get { throw null; } } + public string Name { get { throw null; } } + public string OSAndVersion { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.Models.PatchDetailsOldLayer System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.Models.PatchDetailsOldLayer System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct PatchingMode : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public PatchingMode(string value) { throw null; } + public static Azure.ResourceManager.AppContainers.Models.PatchingMode Automatic { get { throw null; } } + public static Azure.ResourceManager.AppContainers.Models.PatchingMode Disabled { get { throw null; } } + public static Azure.ResourceManager.AppContainers.Models.PatchingMode Manual { get { throw null; } } + public bool Equals(Azure.ResourceManager.AppContainers.Models.PatchingMode other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.AppContainers.Models.PatchingMode left, Azure.ResourceManager.AppContainers.Models.PatchingMode right) { throw null; } + public static implicit operator Azure.ResourceManager.AppContainers.Models.PatchingMode (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.AppContainers.Models.PatchingMode left, Azure.ResourceManager.AppContainers.Models.PatchingMode right) { throw null; } + public override string ToString() { throw null; } + } + public partial class PatchProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal PatchProperties() { } + public System.DateTimeOffset? CreatedOn { get { throw null; } } + public System.DateTimeOffset? LastModifiedOn { get { throw null; } } + public Azure.ResourceManager.AppContainers.Models.PatchApplyStatus? PatchApplyStatus { get { throw null; } } + public System.Collections.Generic.IReadOnlyList PatchDetails { get { throw null; } } + public Azure.Core.ResourceIdentifier TargetContainerAppId { get { throw null; } } + public Azure.Core.ResourceIdentifier TargetEnvironmentId { get { throw null; } } + public Azure.Core.ResourceIdentifier TargetRevisionId { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.Models.PatchProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.Models.PatchProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class PatchSkipConfig : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public PatchSkipConfig() { } + public bool? Skip { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.Models.PatchSkipConfig System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.Models.PatchSkipConfig System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct PatchType : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public PatchType(string value) { throw null; } + public static Azure.ResourceManager.AppContainers.Models.PatchType FrameworkAndOSSecurity { get { throw null; } } + public static Azure.ResourceManager.AppContainers.Models.PatchType FrameworkSecurity { get { throw null; } } + public static Azure.ResourceManager.AppContainers.Models.PatchType OSSecurity { get { throw null; } } + public static Azure.ResourceManager.AppContainers.Models.PatchType Other { get { throw null; } } + public bool Equals(Azure.ResourceManager.AppContainers.Models.PatchType other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.AppContainers.Models.PatchType left, Azure.ResourceManager.AppContainers.Models.PatchType right) { throw null; } + public static implicit operator Azure.ResourceManager.AppContainers.Models.PatchType (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.AppContainers.Models.PatchType left, Azure.ResourceManager.AppContainers.Models.PatchType right) { throw null; } + public override string ToString() { throw null; } + } [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] public readonly partial struct PoolManagementType : System.IEquatable { @@ -3954,6 +6115,49 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer public static bool operator !=(Azure.ResourceManager.AppContainers.Models.PoolManagementType left, Azure.ResourceManager.AppContainers.Models.PoolManagementType right) { throw null; } public override string ToString() { throw null; } } + public partial class PreBuildStep : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public PreBuildStep() { } + public string Description { get { throw null; } set { } } + public Azure.ResourceManager.AppContainers.Models.HttpGet HttpGet { get { throw null; } set { } } + public System.Collections.Generic.IList Scripts { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.Models.PreBuildStep System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.Models.PreBuildStep System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct PublicNetworkAccess : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public PublicNetworkAccess(string value) { throw null; } + public static Azure.ResourceManager.AppContainers.Models.PublicNetworkAccess Disabled { get { throw null; } } + public static Azure.ResourceManager.AppContainers.Models.PublicNetworkAccess Enabled { get { throw null; } } + public bool Equals(Azure.ResourceManager.AppContainers.Models.PublicNetworkAccess other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.AppContainers.Models.PublicNetworkAccess left, Azure.ResourceManager.AppContainers.Models.PublicNetworkAccess right) { throw null; } + public static implicit operator Azure.ResourceManager.AppContainers.Models.PublicNetworkAccess (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.AppContainers.Models.PublicNetworkAccess left, Azure.ResourceManager.AppContainers.Models.PublicNetworkAccess right) { throw null; } + public override string ToString() { throw null; } + } + public partial class ReplicaExecutionStatus : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal ReplicaExecutionStatus() { } + public System.Collections.Generic.IReadOnlyList Containers { get { throw null; } } + public string Name { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.Models.ReplicaExecutionStatus System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.Models.ReplicaExecutionStatus System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] public readonly partial struct RevisionRunningState : System.IEquatable { @@ -3976,6 +6180,46 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer public static bool operator !=(Azure.ResourceManager.AppContainers.Models.RevisionRunningState left, Azure.ResourceManager.AppContainers.Models.RevisionRunningState right) { throw null; } public override string ToString() { throw null; } } + public partial class ScgRoute : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ScgRoute(string id, System.Uri uri) { } + public System.Collections.Generic.IList Filters { get { throw null; } } + public string Id { get { throw null; } set { } } + public long? Order { get { throw null; } set { } } + public System.Collections.Generic.IList Predicates { get { throw null; } } + public System.Uri Uri { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.Models.ScgRoute System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.Models.ScgRoute System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ScheduledEntry : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ScheduledEntry(Azure.ResourceManager.AppContainers.Models.ContainerAppWeekDay weekDay, int startHourUtc, int durationHours) { } + public int DurationHours { get { throw null; } set { } } + public int StartHourUtc { get { throw null; } set { } } + public Azure.ResourceManager.AppContainers.Models.ContainerAppWeekDay WeekDay { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.Models.ScheduledEntry System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.Models.ScheduledEntry System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class SecretKeyVaultProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public SecretKeyVaultProperties() { } + public string Identity { get { throw null; } set { } } + public System.Uri KeyVaultUri { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.Models.SecretKeyVaultProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.Models.SecretKeyVaultProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } public partial class SecretVolumeItem : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public SecretVolumeItem() { } @@ -3996,6 +6240,7 @@ public SessionContainer() { } public System.Collections.Generic.IList Env { get { throw null; } } public string Image { get { throw null; } set { } } public string Name { get { throw null; } set { } } + public System.Collections.Generic.IList Probes { get { throw null; } } public Azure.ResourceManager.AppContainers.Models.SessionContainerResources Resources { get { throw null; } set { } } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.AppContainers.Models.SessionContainer System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -4139,6 +6384,82 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } + public partial class SessionProbe : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public SessionProbe() { } + public int? FailureThreshold { get { throw null; } set { } } + public Azure.ResourceManager.AppContainers.Models.SessionProbeHttpGet HttpGet { get { throw null; } set { } } + public int? InitialDelaySeconds { get { throw null; } set { } } + public int? PeriodSeconds { get { throw null; } set { } } + public Azure.ResourceManager.AppContainers.Models.SessionProbeType? ProbeType { get { throw null; } set { } } + public int? SuccessThreshold { get { throw null; } set { } } + public Azure.ResourceManager.AppContainers.Models.SessionProbeTcpSocket TcpSocket { get { throw null; } set { } } + public long? TerminationGracePeriodSeconds { get { throw null; } set { } } + public int? TimeoutSeconds { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.Models.SessionProbe System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.Models.SessionProbe System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class SessionProbeHttpGet : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public SessionProbeHttpGet(int port) { } + public string Host { get { throw null; } set { } } + public System.Collections.Generic.IList HttpHeaders { get { throw null; } } + public string Path { get { throw null; } set { } } + public int Port { get { throw null; } set { } } + public Azure.ResourceManager.AppContainers.Models.ContainerAppHttpScheme? Scheme { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.Models.SessionProbeHttpGet System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.Models.SessionProbeHttpGet System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class SessionProbeHttpGetHttpHeadersItem : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public SessionProbeHttpGetHttpHeadersItem(string name, string value) { } + public string Name { get { throw null; } set { } } + public string Value { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.Models.SessionProbeHttpGetHttpHeadersItem System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.Models.SessionProbeHttpGetHttpHeadersItem System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class SessionProbeTcpSocket : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public SessionProbeTcpSocket(int port) { } + public string Host { get { throw null; } set { } } + public int Port { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.Models.SessionProbeTcpSocket System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.Models.SessionProbeTcpSocket System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct SessionProbeType : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public SessionProbeType(string value) { throw null; } + public static Azure.ResourceManager.AppContainers.Models.SessionProbeType Liveness { get { throw null; } } + public static Azure.ResourceManager.AppContainers.Models.SessionProbeType Startup { get { throw null; } } + public bool Equals(Azure.ResourceManager.AppContainers.Models.SessionProbeType other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.AppContainers.Models.SessionProbeType left, Azure.ResourceManager.AppContainers.Models.SessionProbeType right) { throw null; } + public static implicit operator Azure.ResourceManager.AppContainers.Models.SessionProbeType (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.AppContainers.Models.SessionProbeType left, Azure.ResourceManager.AppContainers.Models.SessionProbeType right) { throw null; } + public override string ToString() { throw null; } + } public partial class SessionRegistryCredentials : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public SessionRegistryCredentials() { } @@ -4153,6 +6474,22 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } + public partial class SmbStorage : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public SmbStorage() { } + public Azure.ResourceManager.AppContainers.Models.ContainerAppAccessMode? AccessMode { get { throw null; } set { } } + public string Domain { get { throw null; } set { } } + public string Host { get { throw null; } set { } } + public string Password { get { throw null; } set { } } + public string ShareName { get { throw null; } set { } } + public string Username { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.Models.SmbStorage System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.Models.SmbStorage System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } public partial class SpringBootAdminComponent : Azure.ResourceManager.AppContainers.Models.JavaComponentProperties, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public SpringBootAdminComponent() { } @@ -4185,4 +6522,28 @@ protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter write string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } + public partial class SpringCloudGatewayComponent : Azure.ResourceManager.AppContainers.Models.JavaComponentProperties, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public SpringCloudGatewayComponent() { } + public string IngressFqdn { get { throw null; } } + public System.Collections.Generic.IList SpringCloudGatewayRoutes { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.Models.SpringCloudGatewayComponent System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.Models.SpringCloudGatewayComponent System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class TracesConfiguration : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public TracesConfiguration() { } + public System.Collections.Generic.IList Destinations { get { throw null; } } + public bool? IncludeDapr { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.Models.TracesConfiguration System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.AppContainers.Models.TracesConfiguration System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } } diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Custom/ContainerAppBillingMeterProperties.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Custom/ContainerAppBillingMeterProperties.cs index cfe052725863..efbd95e3dbc5 100644 --- a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Custom/ContainerAppBillingMeterProperties.cs +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Custom/ContainerAppBillingMeterProperties.cs @@ -13,6 +13,6 @@ public partial class ContainerAppBillingMeterProperties { /// billing category for container app. [EditorBrowsable(EditorBrowsableState.Never)] - public Azure.ResourceManager.AppContainers.Models.ContainerAppBillingMeterCategory? Category { get => WorkloadProfileCategory; set => WorkloadProfileCategory = value?.ToString(); } + public Azure.ResourceManager.AppContainers.Models.ContainerAppBillingMeterCategory? Category { get => WorkloadProfileCategory; } } } diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/AppContainersPrivateEndpointConnectionCollection.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/AppContainersPrivateEndpointConnectionCollection.cs new file mode 100644 index 000000000000..b45ed3c0f822 --- /dev/null +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/AppContainersPrivateEndpointConnectionCollection.cs @@ -0,0 +1,493 @@ +// 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 Autorest.CSharp.Core; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.AppContainers +{ + /// + /// A class representing a collection of and their operations. + /// Each in the collection will belong to the same instance of . + /// To get an instance call the GetAppContainersPrivateEndpointConnections method from an instance of . + /// + public partial class AppContainersPrivateEndpointConnectionCollection : ArmCollection, IEnumerable, IAsyncEnumerable + { + private readonly ClientDiagnostics _appContainersPrivateEndpointConnectionManagedEnvironmentPrivateEndpointConnectionsClientDiagnostics; + private readonly ManagedEnvironmentPrivateEndpointConnectionsRestOperations _appContainersPrivateEndpointConnectionManagedEnvironmentPrivateEndpointConnectionsRestClient; + + /// Initializes a new instance of the class for mocking. + protected AppContainersPrivateEndpointConnectionCollection() + { + } + + /// 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 AppContainersPrivateEndpointConnectionCollection(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _appContainersPrivateEndpointConnectionManagedEnvironmentPrivateEndpointConnectionsClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.AppContainers", AppContainersPrivateEndpointConnectionResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(AppContainersPrivateEndpointConnectionResource.ResourceType, out string appContainersPrivateEndpointConnectionManagedEnvironmentPrivateEndpointConnectionsApiVersion); + _appContainersPrivateEndpointConnectionManagedEnvironmentPrivateEndpointConnectionsRestClient = new ManagedEnvironmentPrivateEndpointConnectionsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, appContainersPrivateEndpointConnectionManagedEnvironmentPrivateEndpointConnectionsApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != ContainerAppManagedEnvironmentResource.ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ContainerAppManagedEnvironmentResource.ResourceType), nameof(id)); + } + + /// + /// Update the state of a private endpoint connection for a given managed environment. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/privateEndpointConnections/{privateEndpointConnectionName} + /// + /// + /// Operation Id + /// ManagedEnvironmentPrivateEndpointConnections_CreateOrUpdate + /// + /// + /// Default Api Version + /// 2025-02-02-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// 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 name of the private endpoint connection associated with the Azure resource. + /// The resource of private endpoint and its properties. + /// 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 privateEndpointConnectionName, AppContainersPrivateEndpointConnectionData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(privateEndpointConnectionName, nameof(privateEndpointConnectionName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _appContainersPrivateEndpointConnectionManagedEnvironmentPrivateEndpointConnectionsClientDiagnostics.CreateScope("AppContainersPrivateEndpointConnectionCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = await _appContainersPrivateEndpointConnectionManagedEnvironmentPrivateEndpointConnectionsRestClient.CreateOrUpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, privateEndpointConnectionName, data, cancellationToken).ConfigureAwait(false); + var operation = new AppContainersArmOperation(new AppContainersPrivateEndpointConnectionOperationSource(Client), _appContainersPrivateEndpointConnectionManagedEnvironmentPrivateEndpointConnectionsClientDiagnostics, Pipeline, _appContainersPrivateEndpointConnectionManagedEnvironmentPrivateEndpointConnectionsRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, privateEndpointConnectionName, data).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Update the state of a private endpoint connection for a given managed environment. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/privateEndpointConnections/{privateEndpointConnectionName} + /// + /// + /// Operation Id + /// ManagedEnvironmentPrivateEndpointConnections_CreateOrUpdate + /// + /// + /// Default Api Version + /// 2025-02-02-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// 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 name of the private endpoint connection associated with the Azure resource. + /// The resource of private endpoint and its properties. + /// 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 privateEndpointConnectionName, AppContainersPrivateEndpointConnectionData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(privateEndpointConnectionName, nameof(privateEndpointConnectionName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _appContainersPrivateEndpointConnectionManagedEnvironmentPrivateEndpointConnectionsClientDiagnostics.CreateScope("AppContainersPrivateEndpointConnectionCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = _appContainersPrivateEndpointConnectionManagedEnvironmentPrivateEndpointConnectionsRestClient.CreateOrUpdate(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, privateEndpointConnectionName, data, cancellationToken); + var operation = new AppContainersArmOperation(new AppContainersPrivateEndpointConnectionOperationSource(Client), _appContainersPrivateEndpointConnectionManagedEnvironmentPrivateEndpointConnectionsClientDiagnostics, Pipeline, _appContainersPrivateEndpointConnectionManagedEnvironmentPrivateEndpointConnectionsRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, privateEndpointConnectionName, data).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a private endpoint connection for a given managed environment. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/privateEndpointConnections/{privateEndpointConnectionName} + /// + /// + /// Operation Id + /// ManagedEnvironmentPrivateEndpointConnections_Get + /// + /// + /// Default Api Version + /// 2025-02-02-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the private endpoint connection associated with the Azure resource. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetAsync(string privateEndpointConnectionName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(privateEndpointConnectionName, nameof(privateEndpointConnectionName)); + + using var scope = _appContainersPrivateEndpointConnectionManagedEnvironmentPrivateEndpointConnectionsClientDiagnostics.CreateScope("AppContainersPrivateEndpointConnectionCollection.Get"); + scope.Start(); + try + { + var response = await _appContainersPrivateEndpointConnectionManagedEnvironmentPrivateEndpointConnectionsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, privateEndpointConnectionName, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new AppContainersPrivateEndpointConnectionResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a private endpoint connection for a given managed environment. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/privateEndpointConnections/{privateEndpointConnectionName} + /// + /// + /// Operation Id + /// ManagedEnvironmentPrivateEndpointConnections_Get + /// + /// + /// Default Api Version + /// 2025-02-02-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the private endpoint connection associated with the Azure resource. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Get(string privateEndpointConnectionName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(privateEndpointConnectionName, nameof(privateEndpointConnectionName)); + + using var scope = _appContainersPrivateEndpointConnectionManagedEnvironmentPrivateEndpointConnectionsClientDiagnostics.CreateScope("AppContainersPrivateEndpointConnectionCollection.Get"); + scope.Start(); + try + { + var response = _appContainersPrivateEndpointConnectionManagedEnvironmentPrivateEndpointConnectionsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, privateEndpointConnectionName, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new AppContainersPrivateEndpointConnectionResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// List private endpoint connections for a given managed environment. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/privateEndpointConnections + /// + /// + /// Operation Id + /// ManagedEnvironmentPrivateEndpointConnections_List + /// + /// + /// Default Api Version + /// 2025-02-02-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// 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) => _appContainersPrivateEndpointConnectionManagedEnvironmentPrivateEndpointConnectionsRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _appContainersPrivateEndpointConnectionManagedEnvironmentPrivateEndpointConnectionsRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new AppContainersPrivateEndpointConnectionResource(Client, AppContainersPrivateEndpointConnectionData.DeserializeAppContainersPrivateEndpointConnectionData(e)), _appContainersPrivateEndpointConnectionManagedEnvironmentPrivateEndpointConnectionsClientDiagnostics, Pipeline, "AppContainersPrivateEndpointConnectionCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// List private endpoint connections for a given managed environment. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/privateEndpointConnections + /// + /// + /// Operation Id + /// ManagedEnvironmentPrivateEndpointConnections_List + /// + /// + /// Default Api Version + /// 2025-02-02-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// 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) => _appContainersPrivateEndpointConnectionManagedEnvironmentPrivateEndpointConnectionsRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _appContainersPrivateEndpointConnectionManagedEnvironmentPrivateEndpointConnectionsRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new AppContainersPrivateEndpointConnectionResource(Client, AppContainersPrivateEndpointConnectionData.DeserializeAppContainersPrivateEndpointConnectionData(e)), _appContainersPrivateEndpointConnectionManagedEnvironmentPrivateEndpointConnectionsClientDiagnostics, Pipeline, "AppContainersPrivateEndpointConnectionCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/privateEndpointConnections/{privateEndpointConnectionName} + /// + /// + /// Operation Id + /// ManagedEnvironmentPrivateEndpointConnections_Get + /// + /// + /// Default Api Version + /// 2025-02-02-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the private endpoint connection associated with the Azure resource. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> ExistsAsync(string privateEndpointConnectionName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(privateEndpointConnectionName, nameof(privateEndpointConnectionName)); + + using var scope = _appContainersPrivateEndpointConnectionManagedEnvironmentPrivateEndpointConnectionsClientDiagnostics.CreateScope("AppContainersPrivateEndpointConnectionCollection.Exists"); + scope.Start(); + try + { + var response = await _appContainersPrivateEndpointConnectionManagedEnvironmentPrivateEndpointConnectionsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, privateEndpointConnectionName, 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.App/managedEnvironments/{environmentName}/privateEndpointConnections/{privateEndpointConnectionName} + /// + /// + /// Operation Id + /// ManagedEnvironmentPrivateEndpointConnections_Get + /// + /// + /// Default Api Version + /// 2025-02-02-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the private endpoint connection associated with the Azure resource. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Exists(string privateEndpointConnectionName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(privateEndpointConnectionName, nameof(privateEndpointConnectionName)); + + using var scope = _appContainersPrivateEndpointConnectionManagedEnvironmentPrivateEndpointConnectionsClientDiagnostics.CreateScope("AppContainersPrivateEndpointConnectionCollection.Exists"); + scope.Start(); + try + { + var response = _appContainersPrivateEndpointConnectionManagedEnvironmentPrivateEndpointConnectionsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, privateEndpointConnectionName, cancellationToken: cancellationToken); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/privateEndpointConnections/{privateEndpointConnectionName} + /// + /// + /// Operation Id + /// ManagedEnvironmentPrivateEndpointConnections_Get + /// + /// + /// Default Api Version + /// 2025-02-02-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the private endpoint connection associated with the Azure resource. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetIfExistsAsync(string privateEndpointConnectionName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(privateEndpointConnectionName, nameof(privateEndpointConnectionName)); + + using var scope = _appContainersPrivateEndpointConnectionManagedEnvironmentPrivateEndpointConnectionsClientDiagnostics.CreateScope("AppContainersPrivateEndpointConnectionCollection.GetIfExists"); + scope.Start(); + try + { + var response = await _appContainersPrivateEndpointConnectionManagedEnvironmentPrivateEndpointConnectionsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, privateEndpointConnectionName, cancellationToken: cancellationToken).ConfigureAwait(false); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new AppContainersPrivateEndpointConnectionResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/privateEndpointConnections/{privateEndpointConnectionName} + /// + /// + /// Operation Id + /// ManagedEnvironmentPrivateEndpointConnections_Get + /// + /// + /// Default Api Version + /// 2025-02-02-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the private endpoint connection associated with the Azure resource. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual NullableResponse GetIfExists(string privateEndpointConnectionName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(privateEndpointConnectionName, nameof(privateEndpointConnectionName)); + + using var scope = _appContainersPrivateEndpointConnectionManagedEnvironmentPrivateEndpointConnectionsClientDiagnostics.CreateScope("AppContainersPrivateEndpointConnectionCollection.GetIfExists"); + scope.Start(); + try + { + var response = _appContainersPrivateEndpointConnectionManagedEnvironmentPrivateEndpointConnectionsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, privateEndpointConnectionName, cancellationToken: cancellationToken); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new AppContainersPrivateEndpointConnectionResource(Client, response.Value), 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/containerapps/Azure.ResourceManager.AppContainers/src/Generated/AppContainersPrivateEndpointConnectionData.Serialization.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/AppContainersPrivateEndpointConnectionData.Serialization.cs new file mode 100644 index 000000000000..41d867c9492e --- /dev/null +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/AppContainersPrivateEndpointConnectionData.Serialization.cs @@ -0,0 +1,390 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Text.Json; +using Azure.Core; +using Azure.ResourceManager.AppContainers.Models; +using Azure.ResourceManager.Models; +using Azure.ResourceManager.Resources.Models; + +namespace Azure.ResourceManager.AppContainers +{ + public partial class AppContainersPrivateEndpointConnectionData : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AppContainersPrivateEndpointConnectionData)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + writer.WritePropertyName("properties"u8); + writer.WriteStartObject(); + if (options.Format != "W" && Optional.IsCollectionDefined(GroupIds)) + { + writer.WritePropertyName("groupIds"u8); + writer.WriteStartArray(); + foreach (var item in GroupIds) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(PrivateEndpoint)) + { + writer.WritePropertyName("privateEndpoint"u8); + JsonSerializer.Serialize(writer, PrivateEndpoint); + } + if (Optional.IsDefined(ConnectionState)) + { + writer.WritePropertyName("privateLinkServiceConnectionState"u8); + writer.WriteObjectValue(ConnectionState, options); + } + if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) + { + writer.WritePropertyName("provisioningState"u8); + writer.WriteStringValue(ProvisioningState.Value.ToString()); + } + writer.WriteEndObject(); + } + + AppContainersPrivateEndpointConnectionData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AppContainersPrivateEndpointConnectionData)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAppContainersPrivateEndpointConnectionData(document.RootElement, options); + } + + internal static AppContainersPrivateEndpointConnectionData DeserializeAppContainersPrivateEndpointConnectionData(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ResourceIdentifier id = default; + string name = default; + ResourceType type = default; + SystemData systemData = default; + IReadOnlyList groupIds = default; + SubResource privateEndpoint = default; + AppContainersPrivateLinkServiceConnectionState privateLinkServiceConnectionState = default; + AppContainersPrivateEndpointConnectionProvisioningState? provisioningState = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + 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.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + systemData = JsonSerializer.Deserialize(property.Value.GetRawText()); + continue; + } + if (property.NameEquals("properties"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + foreach (var property0 in property.Value.EnumerateObject()) + { + if (property0.NameEquals("groupIds"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property0.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + groupIds = array; + continue; + } + if (property0.NameEquals("privateEndpoint"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + privateEndpoint = JsonSerializer.Deserialize(property0.Value.GetRawText()); + continue; + } + if (property0.NameEquals("privateLinkServiceConnectionState"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + privateLinkServiceConnectionState = AppContainersPrivateLinkServiceConnectionState.DeserializeAppContainersPrivateLinkServiceConnectionState(property0.Value, options); + continue; + } + if (property0.NameEquals("provisioningState"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + provisioningState = new AppContainersPrivateEndpointConnectionProvisioningState(property0.Value.GetString()); + continue; + } + } + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new AppContainersPrivateEndpointConnectionData( + id, + name, + type, + systemData, + groupIds ?? new ChangeTrackingList(), + privateEndpoint, + privateLinkServiceConnectionState, + provisioningState, + serializedAdditionalRawData); + } + + private BinaryData SerializeBicep(ModelReaderWriterOptions options) + { + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Name), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" name: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Name)) + { + builder.Append(" name: "); + if (Name.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{Name}'''"); + } + else + { + builder.AppendLine($"'{Name}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Id), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" id: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Id)) + { + builder.Append(" id: "); + builder.AppendLine($"'{Id.ToString()}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(SystemData), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" systemData: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(SystemData)) + { + builder.Append(" systemData: "); + builder.AppendLine($"'{SystemData.ToString()}'"); + } + } + + builder.Append(" properties:"); + builder.AppendLine(" {"); + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(GroupIds), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" groupIds: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsCollectionDefined(GroupIds)) + { + if (GroupIds.Any()) + { + builder.Append(" groupIds: "); + builder.AppendLine("["); + foreach (var item in GroupIds) + { + if (item == null) + { + builder.Append("null"); + continue; + } + if (item.Contains(Environment.NewLine)) + { + builder.AppendLine(" '''"); + builder.AppendLine($"{item}'''"); + } + else + { + builder.AppendLine($" '{item}'"); + } + } + builder.AppendLine(" ]"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue("PrivateEndpointId", out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" privateEndpoint: "); + builder.AppendLine("{"); + builder.AppendLine(" privateEndpoint: {"); + builder.Append(" id: "); + builder.AppendLine(propertyOverride); + builder.AppendLine(" }"); + builder.AppendLine(" }"); + } + else + { + if (Optional.IsDefined(PrivateEndpoint)) + { + builder.Append(" privateEndpoint: "); + BicepSerializationHelpers.AppendChildObject(builder, PrivateEndpoint, options, 4, false, " privateEndpoint: "); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(ConnectionState), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" privateLinkServiceConnectionState: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(ConnectionState)) + { + builder.Append(" privateLinkServiceConnectionState: "); + BicepSerializationHelpers.AppendChildObject(builder, ConnectionState, options, 4, false, " privateLinkServiceConnectionState: "); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(ProvisioningState), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" provisioningState: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(ProvisioningState)) + { + builder.Append(" provisioningState: "); + builder.AppendLine($"'{ProvisioningState.Value.ToString()}'"); + } + } + + builder.AppendLine(" }"); + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerAppContainersContext.Default); + case "bicep": + return SerializeBicep(options); + default: + throw new FormatException($"The model {nameof(AppContainersPrivateEndpointConnectionData)} does not support writing '{options.Format}' format."); + } + } + + AppContainersPrivateEndpointConnectionData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeAppContainersPrivateEndpointConnectionData(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(AppContainersPrivateEndpointConnectionData)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/AppContainersPrivateEndpointConnectionData.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/AppContainersPrivateEndpointConnectionData.cs new file mode 100644 index 000000000000..4bdd1bb312de --- /dev/null +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/AppContainersPrivateEndpointConnectionData.cs @@ -0,0 +1,99 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; +using Azure.ResourceManager.AppContainers.Models; +using Azure.ResourceManager.Models; +using Azure.ResourceManager.Resources.Models; + +namespace Azure.ResourceManager.AppContainers +{ + /// + /// A class representing the AppContainersPrivateEndpointConnection data model. + /// The Private Endpoint Connection resource. + /// + public partial class AppContainersPrivateEndpointConnectionData : ResourceData + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public AppContainersPrivateEndpointConnectionData() + { + GroupIds = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The group ids for the private endpoint resource. + /// The resource of private end point. + /// A collection of information about the state of the connection between service consumer and provider. + /// The provisioning state of the private endpoint connection resource. + /// Keeps track of any properties unknown to the library. + internal AppContainersPrivateEndpointConnectionData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IReadOnlyList groupIds, SubResource privateEndpoint, AppContainersPrivateLinkServiceConnectionState connectionState, AppContainersPrivateEndpointConnectionProvisioningState? provisioningState, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) + { + GroupIds = groupIds; + PrivateEndpoint = privateEndpoint; + ConnectionState = connectionState; + ProvisioningState = provisioningState; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The group ids for the private endpoint resource. + [WirePath("properties.groupIds")] + public IReadOnlyList GroupIds { get; } + /// The resource of private end point. + internal SubResource PrivateEndpoint { get; set; } + /// Gets Id. + [WirePath("properties.privateEndpoint.id")] + public ResourceIdentifier PrivateEndpointId + { + get => PrivateEndpoint is null ? default : PrivateEndpoint.Id; + } + + /// A collection of information about the state of the connection between service consumer and provider. + [WirePath("properties.privateLinkServiceConnectionState")] + public AppContainersPrivateLinkServiceConnectionState ConnectionState { get; set; } + /// The provisioning state of the private endpoint connection resource. + [WirePath("properties.provisioningState")] + public AppContainersPrivateEndpointConnectionProvisioningState? ProvisioningState { get; } + } +} diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/AppContainersPrivateEndpointConnectionResource.Serialization.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/AppContainersPrivateEndpointConnectionResource.Serialization.cs new file mode 100644 index 000000000000..8ae062302add --- /dev/null +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/AppContainersPrivateEndpointConnectionResource.Serialization.cs @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; + +namespace Azure.ResourceManager.AppContainers +{ + public partial class AppContainersPrivateEndpointConnectionResource : IJsonModel + { + private static AppContainersPrivateEndpointConnectionData s_dataDeserializationInstance; + private static AppContainersPrivateEndpointConnectionData DataDeserializationInstance => s_dataDeserializationInstance ??= new(); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); + + AppContainersPrivateEndpointConnectionData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)DataDeserializationInstance).Create(ref reader, options); + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options, AzureResourceManagerAppContainersContext.Default); + + AppContainersPrivateEndpointConnectionData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options, AzureResourceManagerAppContainersContext.Default); + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)DataDeserializationInstance).GetFormatFromOptions(options); + } +} diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/AppContainersPrivateEndpointConnectionResource.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/AppContainersPrivateEndpointConnectionResource.cs new file mode 100644 index 000000000000..a4a7d81fd838 --- /dev/null +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/AppContainersPrivateEndpointConnectionResource.cs @@ -0,0 +1,347 @@ +// 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.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.AppContainers +{ + /// + /// A Class representing an AppContainersPrivateEndpointConnection 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 GetAppContainersPrivateEndpointConnectionResource method. + /// Otherwise you can get one from its parent resource using the GetAppContainersPrivateEndpointConnection method. + /// + public partial class AppContainersPrivateEndpointConnectionResource : ArmResource + { + /// Generate the resource identifier of a instance. + /// The subscriptionId. + /// The resourceGroupName. + /// The environmentName. + /// The privateEndpointConnectionName. + public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string environmentName, string privateEndpointConnectionName) + { + var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/privateEndpointConnections/{privateEndpointConnectionName}"; + return new ResourceIdentifier(resourceId); + } + + private readonly ClientDiagnostics _appContainersPrivateEndpointConnectionManagedEnvironmentPrivateEndpointConnectionsClientDiagnostics; + private readonly ManagedEnvironmentPrivateEndpointConnectionsRestOperations _appContainersPrivateEndpointConnectionManagedEnvironmentPrivateEndpointConnectionsRestClient; + private readonly AppContainersPrivateEndpointConnectionData _data; + + /// Gets the resource type for the operations. + public static readonly ResourceType ResourceType = "Microsoft.App/managedEnvironments/privateEndpointConnections"; + + /// Initializes a new instance of the class for mocking. + protected AppContainersPrivateEndpointConnectionResource() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The resource that is the target of operations. + internal AppContainersPrivateEndpointConnectionResource(ArmClient client, AppContainersPrivateEndpointConnectionData 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 AppContainersPrivateEndpointConnectionResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _appContainersPrivateEndpointConnectionManagedEnvironmentPrivateEndpointConnectionsClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.AppContainers", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string appContainersPrivateEndpointConnectionManagedEnvironmentPrivateEndpointConnectionsApiVersion); + _appContainersPrivateEndpointConnectionManagedEnvironmentPrivateEndpointConnectionsRestClient = new ManagedEnvironmentPrivateEndpointConnectionsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, appContainersPrivateEndpointConnectionManagedEnvironmentPrivateEndpointConnectionsApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + /// 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 AppContainersPrivateEndpointConnectionData 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 a private endpoint connection for a given managed environment. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/privateEndpointConnections/{privateEndpointConnectionName} + /// + /// + /// Operation Id + /// ManagedEnvironmentPrivateEndpointConnections_Get + /// + /// + /// Default Api Version + /// 2025-02-02-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + { + using var scope = _appContainersPrivateEndpointConnectionManagedEnvironmentPrivateEndpointConnectionsClientDiagnostics.CreateScope("AppContainersPrivateEndpointConnectionResource.Get"); + scope.Start(); + try + { + var response = await _appContainersPrivateEndpointConnectionManagedEnvironmentPrivateEndpointConnectionsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new AppContainersPrivateEndpointConnectionResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a private endpoint connection for a given managed environment. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/privateEndpointConnections/{privateEndpointConnectionName} + /// + /// + /// Operation Id + /// ManagedEnvironmentPrivateEndpointConnections_Get + /// + /// + /// Default Api Version + /// 2025-02-02-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual Response Get(CancellationToken cancellationToken = default) + { + using var scope = _appContainersPrivateEndpointConnectionManagedEnvironmentPrivateEndpointConnectionsClientDiagnostics.CreateScope("AppContainersPrivateEndpointConnectionResource.Get"); + scope.Start(); + try + { + var response = _appContainersPrivateEndpointConnectionManagedEnvironmentPrivateEndpointConnectionsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new AppContainersPrivateEndpointConnectionResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Delete a private endpoint connection for a given managed environment. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/privateEndpointConnections/{privateEndpointConnectionName} + /// + /// + /// Operation Id + /// ManagedEnvironmentPrivateEndpointConnections_Delete + /// + /// + /// Default Api Version + /// 2025-02-02-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// 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 = _appContainersPrivateEndpointConnectionManagedEnvironmentPrivateEndpointConnectionsClientDiagnostics.CreateScope("AppContainersPrivateEndpointConnectionResource.Delete"); + scope.Start(); + try + { + var response = await _appContainersPrivateEndpointConnectionManagedEnvironmentPrivateEndpointConnectionsRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + var operation = new AppContainersArmOperation(_appContainersPrivateEndpointConnectionManagedEnvironmentPrivateEndpointConnectionsClientDiagnostics, Pipeline, _appContainersPrivateEndpointConnectionManagedEnvironmentPrivateEndpointConnectionsRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, 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; + } + } + + /// + /// Delete a private endpoint connection for a given managed environment. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/privateEndpointConnections/{privateEndpointConnectionName} + /// + /// + /// Operation Id + /// ManagedEnvironmentPrivateEndpointConnections_Delete + /// + /// + /// Default Api Version + /// 2025-02-02-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// 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 = _appContainersPrivateEndpointConnectionManagedEnvironmentPrivateEndpointConnectionsClientDiagnostics.CreateScope("AppContainersPrivateEndpointConnectionResource.Delete"); + scope.Start(); + try + { + var response = _appContainersPrivateEndpointConnectionManagedEnvironmentPrivateEndpointConnectionsRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + var operation = new AppContainersArmOperation(_appContainersPrivateEndpointConnectionManagedEnvironmentPrivateEndpointConnectionsClientDiagnostics, Pipeline, _appContainersPrivateEndpointConnectionManagedEnvironmentPrivateEndpointConnectionsRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletionResponse(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Update the state of a private endpoint connection for a given managed environment. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/privateEndpointConnections/{privateEndpointConnectionName} + /// + /// + /// Operation Id + /// ManagedEnvironmentPrivateEndpointConnections_CreateOrUpdate + /// + /// + /// Default Api Version + /// 2025-02-02-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// 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 resource of private endpoint and its properties. + /// The cancellation token to use. + /// is null. + public virtual async Task> UpdateAsync(WaitUntil waitUntil, AppContainersPrivateEndpointConnectionData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _appContainersPrivateEndpointConnectionManagedEnvironmentPrivateEndpointConnectionsClientDiagnostics.CreateScope("AppContainersPrivateEndpointConnectionResource.Update"); + scope.Start(); + try + { + var response = await _appContainersPrivateEndpointConnectionManagedEnvironmentPrivateEndpointConnectionsRestClient.CreateOrUpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, cancellationToken).ConfigureAwait(false); + var operation = new AppContainersArmOperation(new AppContainersPrivateEndpointConnectionOperationSource(Client), _appContainersPrivateEndpointConnectionManagedEnvironmentPrivateEndpointConnectionsClientDiagnostics, Pipeline, _appContainersPrivateEndpointConnectionManagedEnvironmentPrivateEndpointConnectionsRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, 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; + } + } + + /// + /// Update the state of a private endpoint connection for a given managed environment. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/privateEndpointConnections/{privateEndpointConnectionName} + /// + /// + /// Operation Id + /// ManagedEnvironmentPrivateEndpointConnections_CreateOrUpdate + /// + /// + /// Default Api Version + /// 2025-02-02-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// 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 resource of private endpoint and its properties. + /// The cancellation token to use. + /// is null. + public virtual ArmOperation Update(WaitUntil waitUntil, AppContainersPrivateEndpointConnectionData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _appContainersPrivateEndpointConnectionManagedEnvironmentPrivateEndpointConnectionsClientDiagnostics.CreateScope("AppContainersPrivateEndpointConnectionResource.Update"); + scope.Start(); + try + { + var response = _appContainersPrivateEndpointConnectionManagedEnvironmentPrivateEndpointConnectionsRestClient.CreateOrUpdate(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, cancellationToken); + var operation = new AppContainersArmOperation(new AppContainersPrivateEndpointConnectionOperationSource(Client), _appContainersPrivateEndpointConnectionManagedEnvironmentPrivateEndpointConnectionsClientDiagnostics, Pipeline, _appContainersPrivateEndpointConnectionManagedEnvironmentPrivateEndpointConnectionsRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/AppResiliencyCollection.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/AppResiliencyCollection.cs new file mode 100644 index 000000000000..46a892c982bd --- /dev/null +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/AppResiliencyCollection.cs @@ -0,0 +1,497 @@ +// 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 Autorest.CSharp.Core; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.AppContainers +{ + /// + /// A class representing a collection of and their operations. + /// Each in the collection will belong to the same instance of . + /// To get an instance call the GetAppResiliencies method from an instance of . + /// + public partial class AppResiliencyCollection : ArmCollection, IEnumerable, IAsyncEnumerable + { + private readonly ClientDiagnostics _appResiliencyClientDiagnostics; + private readonly AppResiliencyRestOperations _appResiliencyRestClient; + + /// Initializes a new instance of the class for mocking. + protected AppResiliencyCollection() + { + } + + /// 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 AppResiliencyCollection(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _appResiliencyClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.AppContainers", AppResiliencyResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(AppResiliencyResource.ResourceType, out string appResiliencyApiVersion); + _appResiliencyRestClient = new AppResiliencyRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, appResiliencyApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != ContainerAppResource.ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ContainerAppResource.ResourceType), nameof(id)); + } + + /// + /// Create or update container app resiliency policy. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{appName}/resiliencyPolicies/{name} + /// + /// + /// Operation Id + /// AppResiliency_CreateOrUpdate + /// + /// + /// Default Api Version + /// 2025-02-02-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// 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 resiliency policy. + /// The resiliency policy to create or update. + /// 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, AppResiliencyData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(name, nameof(name)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _appResiliencyClientDiagnostics.CreateScope("AppResiliencyCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = await _appResiliencyRestClient.CreateOrUpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, name, data, cancellationToken).ConfigureAwait(false); + var uri = _appResiliencyRestClient.CreateCreateOrUpdateRequestUri(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, name, data); + var rehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(RequestMethod.Put, uri.ToUri(), uri.ToString(), "None", null, OperationFinalStateVia.OriginalUri.ToString()); + var operation = new AppContainersArmOperation(Response.FromValue(new AppResiliencyResource(Client, response), response.GetRawResponse()), rehydrationToken); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Create or update container app resiliency policy. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{appName}/resiliencyPolicies/{name} + /// + /// + /// Operation Id + /// AppResiliency_CreateOrUpdate + /// + /// + /// Default Api Version + /// 2025-02-02-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// 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 resiliency policy. + /// The resiliency policy to create or update. + /// 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, AppResiliencyData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(name, nameof(name)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _appResiliencyClientDiagnostics.CreateScope("AppResiliencyCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = _appResiliencyRestClient.CreateOrUpdate(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, name, data, cancellationToken); + var uri = _appResiliencyRestClient.CreateCreateOrUpdateRequestUri(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, name, data); + var rehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(RequestMethod.Put, uri.ToUri(), uri.ToString(), "None", null, OperationFinalStateVia.OriginalUri.ToString()); + var operation = new AppContainersArmOperation(Response.FromValue(new AppResiliencyResource(Client, response), response.GetRawResponse()), rehydrationToken); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get container app resiliency policy. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{appName}/resiliencyPolicies/{name} + /// + /// + /// Operation Id + /// AppResiliency_Get + /// + /// + /// Default Api Version + /// 2025-02-02-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the resiliency policy. + /// 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 = _appResiliencyClientDiagnostics.CreateScope("AppResiliencyCollection.Get"); + scope.Start(); + try + { + var response = await _appResiliencyRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, name, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new AppResiliencyResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get container app resiliency policy. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{appName}/resiliencyPolicies/{name} + /// + /// + /// Operation Id + /// AppResiliency_Get + /// + /// + /// Default Api Version + /// 2025-02-02-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the resiliency policy. + /// 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 = _appResiliencyClientDiagnostics.CreateScope("AppResiliencyCollection.Get"); + scope.Start(); + try + { + var response = _appResiliencyRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, name, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new AppResiliencyResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// List container app resiliency policies. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{appName}/resiliencyPolicies + /// + /// + /// Operation Id + /// AppResiliency_List + /// + /// + /// Default Api Version + /// 2025-02-02-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// 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) => _appResiliencyRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _appResiliencyRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new AppResiliencyResource(Client, AppResiliencyData.DeserializeAppResiliencyData(e)), _appResiliencyClientDiagnostics, Pipeline, "AppResiliencyCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// List container app resiliency policies. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{appName}/resiliencyPolicies + /// + /// + /// Operation Id + /// AppResiliency_List + /// + /// + /// Default Api Version + /// 2025-02-02-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// 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) => _appResiliencyRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _appResiliencyRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new AppResiliencyResource(Client, AppResiliencyData.DeserializeAppResiliencyData(e)), _appResiliencyClientDiagnostics, Pipeline, "AppResiliencyCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{appName}/resiliencyPolicies/{name} + /// + /// + /// Operation Id + /// AppResiliency_Get + /// + /// + /// Default Api Version + /// 2025-02-02-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the resiliency policy. + /// 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 = _appResiliencyClientDiagnostics.CreateScope("AppResiliencyCollection.Exists"); + scope.Start(); + try + { + var response = await _appResiliencyRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, 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.App/containerApps/{appName}/resiliencyPolicies/{name} + /// + /// + /// Operation Id + /// AppResiliency_Get + /// + /// + /// Default Api Version + /// 2025-02-02-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the resiliency policy. + /// 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 = _appResiliencyClientDiagnostics.CreateScope("AppResiliencyCollection.Exists"); + scope.Start(); + try + { + var response = _appResiliencyRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, name, cancellationToken: cancellationToken); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{appName}/resiliencyPolicies/{name} + /// + /// + /// Operation Id + /// AppResiliency_Get + /// + /// + /// Default Api Version + /// 2025-02-02-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the resiliency policy. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetIfExistsAsync(string name, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(name, nameof(name)); + + using var scope = _appResiliencyClientDiagnostics.CreateScope("AppResiliencyCollection.GetIfExists"); + scope.Start(); + try + { + var response = await _appResiliencyRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, name, cancellationToken: cancellationToken).ConfigureAwait(false); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new AppResiliencyResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{appName}/resiliencyPolicies/{name} + /// + /// + /// Operation Id + /// AppResiliency_Get + /// + /// + /// Default Api Version + /// 2025-02-02-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the resiliency policy. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual NullableResponse GetIfExists(string name, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(name, nameof(name)); + + using var scope = _appResiliencyClientDiagnostics.CreateScope("AppResiliencyCollection.GetIfExists"); + scope.Start(); + try + { + var response = _appResiliencyRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, name, cancellationToken: cancellationToken); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new AppResiliencyResource(Client, response.Value), 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/containerapps/Azure.ResourceManager.AppContainers/src/Generated/AppResiliencyData.Serialization.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/AppResiliencyData.Serialization.cs new file mode 100644 index 000000000000..bca292701da7 --- /dev/null +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/AppResiliencyData.Serialization.cs @@ -0,0 +1,424 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text; +using System.Text.Json; +using Azure.Core; +using Azure.ResourceManager.AppContainers.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.AppContainers +{ + public partial class AppResiliencyData : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AppResiliencyData)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + writer.WritePropertyName("properties"u8); + writer.WriteStartObject(); + if (Optional.IsDefined(TimeoutPolicy)) + { + writer.WritePropertyName("timeoutPolicy"u8); + writer.WriteObjectValue(TimeoutPolicy, options); + } + if (Optional.IsDefined(HttpRetryPolicy)) + { + writer.WritePropertyName("httpRetryPolicy"u8); + writer.WriteObjectValue(HttpRetryPolicy, options); + } + if (Optional.IsDefined(TcpRetryPolicy)) + { + writer.WritePropertyName("tcpRetryPolicy"u8); + writer.WriteObjectValue(TcpRetryPolicy, options); + } + if (Optional.IsDefined(CircuitBreakerPolicy)) + { + writer.WritePropertyName("circuitBreakerPolicy"u8); + writer.WriteObjectValue(CircuitBreakerPolicy, options); + } + if (Optional.IsDefined(HttpConnectionPool)) + { + writer.WritePropertyName("httpConnectionPool"u8); + writer.WriteObjectValue(HttpConnectionPool, options); + } + if (Optional.IsDefined(TcpConnectionPool)) + { + writer.WritePropertyName("tcpConnectionPool"u8); + writer.WriteObjectValue(TcpConnectionPool, options); + } + writer.WriteEndObject(); + } + + AppResiliencyData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AppResiliencyData)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAppResiliencyData(document.RootElement, options); + } + + internal static AppResiliencyData DeserializeAppResiliencyData(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ResourceIdentifier id = default; + string name = default; + ResourceType type = default; + SystemData systemData = default; + ContainerAppTimeoutPolicy timeoutPolicy = default; + HttpRetryPolicy httpRetryPolicy = default; + TcpRetryPolicy tcpRetryPolicy = default; + CircuitBreakerPolicy circuitBreakerPolicy = default; + HttpConnectionPool httpConnectionPool = default; + TcpConnectionPool tcpConnectionPool = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + 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.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + systemData = JsonSerializer.Deserialize(property.Value.GetRawText()); + continue; + } + if (property.NameEquals("properties"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + foreach (var property0 in property.Value.EnumerateObject()) + { + if (property0.NameEquals("timeoutPolicy"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + timeoutPolicy = ContainerAppTimeoutPolicy.DeserializeContainerAppTimeoutPolicy(property0.Value, options); + continue; + } + if (property0.NameEquals("httpRetryPolicy"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + httpRetryPolicy = HttpRetryPolicy.DeserializeHttpRetryPolicy(property0.Value, options); + continue; + } + if (property0.NameEquals("tcpRetryPolicy"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + tcpRetryPolicy = TcpRetryPolicy.DeserializeTcpRetryPolicy(property0.Value, options); + continue; + } + if (property0.NameEquals("circuitBreakerPolicy"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + circuitBreakerPolicy = CircuitBreakerPolicy.DeserializeCircuitBreakerPolicy(property0.Value, options); + continue; + } + if (property0.NameEquals("httpConnectionPool"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + httpConnectionPool = HttpConnectionPool.DeserializeHttpConnectionPool(property0.Value, options); + continue; + } + if (property0.NameEquals("tcpConnectionPool"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + tcpConnectionPool = TcpConnectionPool.DeserializeTcpConnectionPool(property0.Value, options); + continue; + } + } + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new AppResiliencyData( + id, + name, + type, + systemData, + timeoutPolicy, + httpRetryPolicy, + tcpRetryPolicy, + circuitBreakerPolicy, + httpConnectionPool, + tcpConnectionPool, + serializedAdditionalRawData); + } + + private BinaryData SerializeBicep(ModelReaderWriterOptions options) + { + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Name), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" name: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Name)) + { + builder.Append(" name: "); + if (Name.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{Name}'''"); + } + else + { + builder.AppendLine($"'{Name}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Id), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" id: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Id)) + { + builder.Append(" id: "); + builder.AppendLine($"'{Id.ToString()}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(SystemData), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" systemData: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(SystemData)) + { + builder.Append(" systemData: "); + builder.AppendLine($"'{SystemData.ToString()}'"); + } + } + + builder.Append(" properties:"); + builder.AppendLine(" {"); + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(TimeoutPolicy), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" timeoutPolicy: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(TimeoutPolicy)) + { + builder.Append(" timeoutPolicy: "); + BicepSerializationHelpers.AppendChildObject(builder, TimeoutPolicy, options, 4, false, " timeoutPolicy: "); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(HttpRetryPolicy), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" httpRetryPolicy: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(HttpRetryPolicy)) + { + builder.Append(" httpRetryPolicy: "); + BicepSerializationHelpers.AppendChildObject(builder, HttpRetryPolicy, options, 4, false, " httpRetryPolicy: "); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue("TcpRetryMaxConnectAttempts", out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" tcpRetryPolicy: "); + builder.AppendLine("{"); + builder.AppendLine(" tcpRetryPolicy: {"); + builder.Append(" maxConnectAttempts: "); + builder.AppendLine(propertyOverride); + builder.AppendLine(" }"); + builder.AppendLine(" }"); + } + else + { + if (Optional.IsDefined(TcpRetryPolicy)) + { + builder.Append(" tcpRetryPolicy: "); + BicepSerializationHelpers.AppendChildObject(builder, TcpRetryPolicy, options, 4, false, " tcpRetryPolicy: "); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(CircuitBreakerPolicy), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" circuitBreakerPolicy: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(CircuitBreakerPolicy)) + { + builder.Append(" circuitBreakerPolicy: "); + BicepSerializationHelpers.AppendChildObject(builder, CircuitBreakerPolicy, options, 4, false, " circuitBreakerPolicy: "); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(HttpConnectionPool), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" httpConnectionPool: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(HttpConnectionPool)) + { + builder.Append(" httpConnectionPool: "); + BicepSerializationHelpers.AppendChildObject(builder, HttpConnectionPool, options, 4, false, " httpConnectionPool: "); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue("MaxConnections", out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" tcpConnectionPool: "); + builder.AppendLine("{"); + builder.AppendLine(" tcpConnectionPool: {"); + builder.Append(" maxConnections: "); + builder.AppendLine(propertyOverride); + builder.AppendLine(" }"); + builder.AppendLine(" }"); + } + else + { + if (Optional.IsDefined(TcpConnectionPool)) + { + builder.Append(" tcpConnectionPool: "); + BicepSerializationHelpers.AppendChildObject(builder, TcpConnectionPool, options, 4, false, " tcpConnectionPool: "); + } + } + + builder.AppendLine(" }"); + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerAppContainersContext.Default); + case "bicep": + return SerializeBicep(options); + default: + throw new FormatException($"The model {nameof(AppResiliencyData)} does not support writing '{options.Format}' format."); + } + } + + AppResiliencyData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeAppResiliencyData(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(AppResiliencyData)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/AppResiliencyData.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/AppResiliencyData.cs new file mode 100644 index 000000000000..c6b2658162e5 --- /dev/null +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/AppResiliencyData.cs @@ -0,0 +1,124 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; +using Azure.ResourceManager.AppContainers.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.AppContainers +{ + /// + /// A class representing the AppResiliency data model. + /// Configuration to setup App Resiliency + /// + public partial class AppResiliencyData : ResourceData + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public AppResiliencyData() + { + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// Policy to set request timeouts. + /// Policy that defines http request retry conditions. + /// Policy that defines tcp request retry conditions. + /// Policy that defines circuit breaker conditions. + /// Defines parameters for http connection pooling. + /// Defines parameters for tcp connection pooling. + /// Keeps track of any properties unknown to the library. + internal AppResiliencyData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, ContainerAppTimeoutPolicy timeoutPolicy, HttpRetryPolicy httpRetryPolicy, TcpRetryPolicy tcpRetryPolicy, CircuitBreakerPolicy circuitBreakerPolicy, HttpConnectionPool httpConnectionPool, TcpConnectionPool tcpConnectionPool, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) + { + TimeoutPolicy = timeoutPolicy; + HttpRetryPolicy = httpRetryPolicy; + TcpRetryPolicy = tcpRetryPolicy; + CircuitBreakerPolicy = circuitBreakerPolicy; + HttpConnectionPool = httpConnectionPool; + TcpConnectionPool = tcpConnectionPool; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Policy to set request timeouts. + [WirePath("properties.timeoutPolicy")] + public ContainerAppTimeoutPolicy TimeoutPolicy { get; set; } + /// Policy that defines http request retry conditions. + [WirePath("properties.httpRetryPolicy")] + public HttpRetryPolicy HttpRetryPolicy { get; set; } + /// Policy that defines tcp request retry conditions. + internal TcpRetryPolicy TcpRetryPolicy { get; set; } + /// Maximum number of attempts to connect to the tcp service. + [WirePath("properties.tcpRetryPolicy.maxConnectAttempts")] + public int? TcpRetryMaxConnectAttempts + { + get => TcpRetryPolicy is null ? default : TcpRetryPolicy.MaxConnectAttempts; + set + { + if (TcpRetryPolicy is null) + TcpRetryPolicy = new TcpRetryPolicy(); + TcpRetryPolicy.MaxConnectAttempts = value; + } + } + + /// Policy that defines circuit breaker conditions. + [WirePath("properties.circuitBreakerPolicy")] + public CircuitBreakerPolicy CircuitBreakerPolicy { get; set; } + /// Defines parameters for http connection pooling. + [WirePath("properties.httpConnectionPool")] + public HttpConnectionPool HttpConnectionPool { get; set; } + /// Defines parameters for tcp connection pooling. + internal TcpConnectionPool TcpConnectionPool { get; set; } + /// Maximum number of tcp connections allowed. + [WirePath("properties.tcpConnectionPool.maxConnections")] + public int? MaxConnections + { + get => TcpConnectionPool is null ? default : TcpConnectionPool.MaxConnections; + set + { + if (TcpConnectionPool is null) + TcpConnectionPool = new TcpConnectionPool(); + TcpConnectionPool.MaxConnections = value; + } + } + } +} diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/AppResiliencyResource.Serialization.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/AppResiliencyResource.Serialization.cs new file mode 100644 index 000000000000..0c028ea87f68 --- /dev/null +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/AppResiliencyResource.Serialization.cs @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; + +namespace Azure.ResourceManager.AppContainers +{ + public partial class AppResiliencyResource : IJsonModel + { + private static AppResiliencyData s_dataDeserializationInstance; + private static AppResiliencyData DataDeserializationInstance => s_dataDeserializationInstance ??= new(); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); + + AppResiliencyData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)DataDeserializationInstance).Create(ref reader, options); + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options, AzureResourceManagerAppContainersContext.Default); + + AppResiliencyData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options, AzureResourceManagerAppContainersContext.Default); + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)DataDeserializationInstance).GetFormatFromOptions(options); + } +} diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/AppResiliencyResource.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/AppResiliencyResource.cs new file mode 100644 index 000000000000..68d2fd871559 --- /dev/null +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/AppResiliencyResource.cs @@ -0,0 +1,343 @@ +// 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.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.AppContainers +{ + /// + /// A Class representing an AppResiliency 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 GetAppResiliencyResource method. + /// Otherwise you can get one from its parent resource using the GetAppResiliency method. + /// + public partial class AppResiliencyResource : ArmResource + { + /// Generate the resource identifier of a instance. + /// The subscriptionId. + /// The resourceGroupName. + /// The appName. + /// The name. + public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string appName, string name) + { + var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{appName}/resiliencyPolicies/{name}"; + return new ResourceIdentifier(resourceId); + } + + private readonly ClientDiagnostics _appResiliencyClientDiagnostics; + private readonly AppResiliencyRestOperations _appResiliencyRestClient; + private readonly AppResiliencyData _data; + + /// Gets the resource type for the operations. + public static readonly ResourceType ResourceType = "Microsoft.App/containerApps/resiliencyPolicies"; + + /// Initializes a new instance of the class for mocking. + protected AppResiliencyResource() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The resource that is the target of operations. + internal AppResiliencyResource(ArmClient client, AppResiliencyData 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 AppResiliencyResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _appResiliencyClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.AppContainers", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string appResiliencyApiVersion); + _appResiliencyRestClient = new AppResiliencyRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, appResiliencyApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + /// 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 AppResiliencyData 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 container app resiliency policy. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{appName}/resiliencyPolicies/{name} + /// + /// + /// Operation Id + /// AppResiliency_Get + /// + /// + /// Default Api Version + /// 2025-02-02-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + { + using var scope = _appResiliencyClientDiagnostics.CreateScope("AppResiliencyResource.Get"); + scope.Start(); + try + { + var response = await _appResiliencyRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new AppResiliencyResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get container app resiliency policy. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{appName}/resiliencyPolicies/{name} + /// + /// + /// Operation Id + /// AppResiliency_Get + /// + /// + /// Default Api Version + /// 2025-02-02-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual Response Get(CancellationToken cancellationToken = default) + { + using var scope = _appResiliencyClientDiagnostics.CreateScope("AppResiliencyResource.Get"); + scope.Start(); + try + { + var response = _appResiliencyRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new AppResiliencyResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Delete container app resiliency policy. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{appName}/resiliencyPolicies/{name} + /// + /// + /// Operation Id + /// AppResiliency_Delete + /// + /// + /// Default Api Version + /// 2025-02-02-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// 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 = _appResiliencyClientDiagnostics.CreateScope("AppResiliencyResource.Delete"); + scope.Start(); + try + { + var response = await _appResiliencyRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + var uri = _appResiliencyRestClient.CreateDeleteRequestUri(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name); + var rehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(RequestMethod.Delete, uri.ToUri(), uri.ToString(), "None", null, OperationFinalStateVia.OriginalUri.ToString()); + var operation = new AppContainersArmOperation(response, rehydrationToken); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Delete container app resiliency policy. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{appName}/resiliencyPolicies/{name} + /// + /// + /// Operation Id + /// AppResiliency_Delete + /// + /// + /// Default Api Version + /// 2025-02-02-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// 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 = _appResiliencyClientDiagnostics.CreateScope("AppResiliencyResource.Delete"); + scope.Start(); + try + { + var response = _appResiliencyRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + var uri = _appResiliencyRestClient.CreateDeleteRequestUri(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name); + var rehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(RequestMethod.Delete, uri.ToUri(), uri.ToString(), "None", null, OperationFinalStateVia.OriginalUri.ToString()); + var operation = new AppContainersArmOperation(response, rehydrationToken); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletionResponse(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Update container app resiliency policy. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{appName}/resiliencyPolicies/{name} + /// + /// + /// Operation Id + /// AppResiliency_Update + /// + /// + /// Default Api Version + /// 2025-02-02-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The resiliency policy to update. + /// The cancellation token to use. + /// is null. + public virtual async Task> UpdateAsync(AppResiliencyData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _appResiliencyClientDiagnostics.CreateScope("AppResiliencyResource.Update"); + scope.Start(); + try + { + var response = await _appResiliencyRestClient.UpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, cancellationToken).ConfigureAwait(false); + return Response.FromValue(new AppResiliencyResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Update container app resiliency policy. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{appName}/resiliencyPolicies/{name} + /// + /// + /// Operation Id + /// AppResiliency_Update + /// + /// + /// Default Api Version + /// 2025-02-02-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The resiliency policy to update. + /// The cancellation token to use. + /// is null. + public virtual Response Update(AppResiliencyData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _appResiliencyClientDiagnostics.CreateScope("AppResiliencyResource.Update"); + scope.Start(); + try + { + var response = _appResiliencyRestClient.Update(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, cancellationToken); + return Response.FromValue(new AppResiliencyResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/ArmAppContainersModelFactory.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/ArmAppContainersModelFactory.cs index 3a8313526290..c6f8e33628f6 100644 --- a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/ArmAppContainersModelFactory.cs +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/ArmAppContainersModelFactory.cs @@ -18,6 +18,34 @@ namespace Azure.ResourceManager.AppContainers.Models /// Model factory for models. public static partial class ArmAppContainersModelFactory { + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// Policy to set request timeouts. + /// Policy that defines http request retry conditions. + /// Policy that defines tcp request retry conditions. + /// Policy that defines circuit breaker conditions. + /// Defines parameters for http connection pooling. + /// Defines parameters for tcp connection pooling. + /// A new instance for mocking. + public static AppResiliencyData AppResiliencyData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, ContainerAppTimeoutPolicy timeoutPolicy = null, HttpRetryPolicy httpRetryPolicy = null, int? tcpRetryMaxConnectAttempts = null, CircuitBreakerPolicy circuitBreakerPolicy = null, HttpConnectionPool httpConnectionPool = null, int? maxConnections = null) + { + return new AppResiliencyData( + id, + name, + resourceType, + systemData, + timeoutPolicy, + httpRetryPolicy, + tcpRetryMaxConnectAttempts != null ? new TcpRetryPolicy(tcpRetryMaxConnectAttempts, serializedAdditionalRawData: null) : null, + circuitBreakerPolicy, + httpConnectionPool, + maxConnections != null ? new TcpConnectionPool(maxConnections, serializedAdditionalRawData: null) : null, + serializedAdditionalRawData: null); + } + /// Initializes a new instance of . /// The id. /// The name. @@ -86,6 +114,86 @@ public static ContainerAppBillingMeter ContainerAppBillingMeter(ResourceIdentifi serializedAdditionalRawData: null); } + /// Initializes a new instance of . + /// Used to categorize billing meters. + /// Billing meter type. + /// The everyday name of the billing meter. + /// A new instance for mocking. + public static ContainerAppBillingMeterProperties ContainerAppBillingMeterProperties(string workloadProfileCategory = null, string meterType = null, string displayName = null) + { + return new ContainerAppBillingMeterProperties(workloadProfileCategory, meterType, displayName, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The tags. + /// The location. + /// The managed service identities assigned to this resource. + /// Provisioning state of a builder resource. + /// Resource ID of the container apps environment that the builder is associated with. + /// List of mappings of container registries and the managed identity used to connect to it. + /// A new instance for mocking. + public static BuilderResourceData BuilderResourceData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, ManagedServiceIdentity identity = null, ContainerAppBuilderProvisioningState? provisioningState = null, ResourceIdentifier environmentId = null, IEnumerable containerRegistries = null) + { + tags ??= new Dictionary(); + containerRegistries ??= new List(); + + return new BuilderResourceData( + id, + name, + resourceType, + systemData, + tags, + location, + identity, + provisioningState, + environmentId, + containerRegistries?.ToList(), + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// Build provisioning state. + /// Status of the build once it has been provisioned. + /// Container registry that the final image will be uploaded to. + /// Configuration of the build. + /// Endpoint to which the source code should be uploaded. + /// Endpoint from which the build logs can be streamed. + /// Endpoint to use to retrieve an authentication token for log streaming and uploading source code. + /// A new instance for mocking. + public static BuildResourceData BuildResourceData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, ContainerAppBuildProvisioningState? provisioningState = null, ContainerAppBuildStatus? buildStatus = null, ContainerRegistryWithCustomImage destinationContainerRegistry = null, ContainerAppBuildConfiguration configuration = null, string uploadEndpoint = null, string logStreamEndpoint = null, string tokenEndpoint = null) + { + return new BuildResourceData( + id, + name, + resourceType, + systemData, + provisioningState, + buildStatus, + destinationContainerRegistry, + configuration, + uploadEndpoint, + logStreamEndpoint, + tokenEndpoint, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Authentication token. + /// Token expiration date. + /// A new instance for mocking. + public static ContainerAppBuildToken ContainerAppBuildToken(string token = null, DateTimeOffset? expires = null) + { + return new ContainerAppBuildToken(token, expires, serializedAdditionalRawData: null); + } + /// Initializes a new instance of . /// The id. /// The name. @@ -182,6 +290,7 @@ public static ContainerAppCertificateData ContainerAppCertificateData(ResourceId /// Initializes a new instance of . /// Provisioning state of the certificate. + /// Any errors that occurred during deployment or deployment validation. /// Properties for a certificate stored in a Key Vault. /// Certificate password. /// Subject name of the certificate. @@ -193,13 +302,15 @@ public static ContainerAppCertificateData ContainerAppCertificateData(ResourceId /// Certificate thumbprint. /// Is the certificate valid?. /// Public key hash. + /// The type of the certificate. Allowed values are `ServerSSLCertificate` and `ImagePullTrustedCA`. /// A new instance for mocking. - public static ContainerAppCertificateProperties ContainerAppCertificateProperties(ContainerAppCertificateProvisioningState? provisioningState = null, ContainerAppCertificateKeyVaultProperties certificateKeyVaultProperties = null, string password = null, string subjectName = null, IEnumerable subjectAlternativeNames = null, byte[] value = null, string issuer = null, DateTimeOffset? issueOn = null, DateTimeOffset? expireOn = null, string thumbprint = null, bool? isValid = null, string publicKeyHash = null) + public static ContainerAppCertificateProperties ContainerAppCertificateProperties(ContainerAppCertificateProvisioningState? provisioningState = null, string deploymentErrors = null, ContainerAppCertificateKeyVaultProperties certificateKeyVaultProperties = null, string password = null, string subjectName = null, IEnumerable subjectAlternativeNames = null, byte[] value = null, string issuer = null, DateTimeOffset? issueOn = null, DateTimeOffset? expireOn = null, string thumbprint = null, bool? isValid = null, string publicKeyHash = null, ContainerAppCertificateType? certificateType = null) { subjectAlternativeNames ??= new List(); return new ContainerAppCertificateProperties( provisioningState, + deploymentErrors, certificateKeyVaultProperties, password, subjectName, @@ -211,10 +322,11 @@ public static ContainerAppCertificateProperties ContainerAppCertificatePropertie thumbprint, isValid, publicKeyHash, + certificateType, serializedAdditionalRawData: null); } - /// Initializes a new instance of . + /// Initializes a new instance of . /// The id. /// The name. /// The resourceType. @@ -227,14 +339,18 @@ public static ContainerAppCertificateProperties ContainerAppCertificatePropertie /// Name of a Dapr component to retrieve component secrets from. /// Component metadata. /// Names of container apps that can use this Dapr component. - /// A new instance for mocking. - public static ContainerAppDaprComponentData ContainerAppDaprComponentData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, string componentType = null, string version = null, bool? ignoreErrors = null, string initTimeout = null, IEnumerable secrets = null, string secretStoreComponent = null, IEnumerable metadata = null, IEnumerable scopes = null) + /// List of container app services that are bound to the Dapr component. + /// Provisioning state of the Connected Environment Dapr Component. + /// Any errors that occurred during deployment or deployment validation. + /// A new instance for mocking. + public static ConnectedEnvironmentDaprComponentData ConnectedEnvironmentDaprComponentData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, string componentType = null, string version = null, bool? ignoreErrors = null, string initTimeout = null, IEnumerable secrets = null, string secretStoreComponent = null, IEnumerable metadata = null, IEnumerable scopes = null, IEnumerable serviceComponentBind = null, ConnectedEnvironmentDaprComponentProvisioningState? provisioningState = null, string deploymentErrors = null) { secrets ??= new List(); metadata ??= new List(); scopes ??= new List(); + serviceComponentBind ??= new List(); - return new ContainerAppDaprComponentData( + return new ConnectedEnvironmentDaprComponentData( id, name, resourceType, @@ -247,6 +363,9 @@ public static ContainerAppDaprComponentData ContainerAppDaprComponentData(Resour secretStoreComponent, metadata?.ToList(), scopes?.ToList(), + serviceComponentBind?.ToList(), + provisioningState, + deploymentErrors, serializedAdditionalRawData: null); } @@ -264,19 +383,30 @@ public static ContainerAppDaprSecret ContainerAppDaprSecret(string name = null, /// The name. /// The resourceType. /// The systemData. - /// Storage properties. + /// Storage properties. /// A new instance for mocking. - public static ContainerAppConnectedEnvironmentStorageData ContainerAppConnectedEnvironmentStorageData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, ContainerAppAzureFileProperties connectedEnvironmentStorageAzureFile = null) + public static ContainerAppConnectedEnvironmentStorageData ContainerAppConnectedEnvironmentStorageData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, ConnectedEnvironmentStorageProperties properties = null) { return new ContainerAppConnectedEnvironmentStorageData( id, name, resourceType, systemData, - connectedEnvironmentStorageAzureFile != null ? new ConnectedEnvironmentStorageProperties(connectedEnvironmentStorageAzureFile, serializedAdditionalRawData: null) : null, + properties, serializedAdditionalRawData: null); } + /// Initializes a new instance of . + /// Provisioning state of the storage. + /// Any errors that occurred during deployment or deployment validation. + /// Azure file properties. + /// SMB storage properties. + /// A new instance for mocking. + public static ConnectedEnvironmentStorageProperties ConnectedEnvironmentStorageProperties(ConnectedEnvironmentStorageProvisioningState? provisioningState = null, string deploymentErrors = null, ContainerAppAzureFileProperties azureFile = null, SmbStorage smb = null) + { + return new ConnectedEnvironmentStorageProperties(provisioningState, deploymentErrors, azureFile, smb, serializedAdditionalRawData: null); + } + /// Initializes a new instance of . /// The id. /// The name. @@ -287,11 +417,14 @@ public static ContainerAppConnectedEnvironmentStorageData ContainerAppConnectedE /// The complex type of the extended location. /// managed identities for the Container App to interact with other Azure services without maintaining any secrets or credentials in code. /// The fully qualified resource ID of the resource that manages this resource. Indicates if this resource is managed by another Azure resource. If this is present, complete mode deployment will not delete the resource if it is removed from the template since it is managed by another resource. + /// Metadata used to render different experiences for resources of the same type; e.g. WorkflowApp is a kind of Microsoft.App/ContainerApps type. If supported, the resource provider must validate and persist this value. /// Provisioning state of the Container App. /// Running status of the Container App. + /// Any errors that occurred during deployment. /// Deprecated. Resource ID of the Container App's environment. /// Resource ID of environment. /// Workload profile name to pin for container app execution. + /// Container App auto patch configuration. /// Name of the latest revision of the Container App. /// Name of the latest ready revision of the Container App. /// Fully Qualified Domain Name of the latest revision of the Container App. @@ -301,7 +434,7 @@ public static ContainerAppConnectedEnvironmentStorageData ContainerAppConnectedE /// Outbound IP Addresses for container app. /// The endpoint of the eventstream of the container app. /// A new instance for mocking. - public static ContainerAppData ContainerAppData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, ContainerAppExtendedLocation extendedLocation = null, ManagedServiceIdentity identity = null, string managedBy = null, ContainerAppProvisioningState? provisioningState = null, ContainerAppRunningStatus? runningStatus = null, ResourceIdentifier managedEnvironmentId = null, ResourceIdentifier environmentId = null, string workloadProfileName = null, string latestRevisionName = null, string latestReadyRevisionName = null, string latestRevisionFqdn = null, string customDomainVerificationId = null, ContainerAppConfiguration configuration = null, ContainerAppTemplate template = null, IEnumerable outboundIPAddressList = null, Uri eventStreamEndpoint = null) + public static ContainerAppData ContainerAppData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, ContainerAppExtendedLocation extendedLocation = null, ManagedServiceIdentity identity = null, string managedBy = null, AppContainersKind? kind = null, ContainerAppProvisioningState? provisioningState = null, ContainerAppRunningStatus? runningStatus = null, string deploymentErrors = null, ResourceIdentifier managedEnvironmentId = null, ResourceIdentifier environmentId = null, string workloadProfileName = null, PatchingMode? patchingMode = null, string latestRevisionName = null, string latestReadyRevisionName = null, string latestRevisionFqdn = null, string customDomainVerificationId = null, ContainerAppConfiguration configuration = null, ContainerAppTemplate template = null, IEnumerable outboundIPAddressList = null, Uri eventStreamEndpoint = null) { tags ??= new Dictionary(); outboundIPAddressList ??= new List(); @@ -316,11 +449,14 @@ public static ContainerAppData ContainerAppData(ResourceIdentifier id = null, st extendedLocation, identity, managedBy, + kind, provisioningState, runningStatus, + deploymentErrors, managedEnvironmentId, environmentId, workloadProfileName, + patchingMode != null ? new ContainerAppPropertiesPatchingConfiguration(patchingMode, serializedAdditionalRawData: null) : null, latestRevisionName, latestReadyRevisionName, latestRevisionFqdn, @@ -346,8 +482,9 @@ public static ContainerAppData ContainerAppData(ResourceIdentifier id = null, st /// Client certificate mode for mTLS authentication. Ignore indicates server drops client certificate on forwarding. Accept indicates server forwards client certificate but does not require a client certificate. Require indicates server requires a client certificate. /// CORS policy for container app. /// Settings to expose additional ports on container app. + /// Whether an http app listens on http or https. /// A new instance for mocking. - public static ContainerAppIngressConfiguration ContainerAppIngressConfiguration(string fqdn = null, bool? external = null, int? targetPort = null, int? exposedPort = null, ContainerAppIngressTransportMethod? transport = null, IEnumerable traffic = null, IEnumerable customDomains = null, bool? allowInsecure = null, IEnumerable ipSecurityRestrictions = null, Affinity? stickySessionsAffinity = null, ContainerAppIngressClientCertificateMode? clientCertificateMode = null, ContainerAppCorsPolicy corsPolicy = null, IEnumerable additionalPortMappings = null) + public static ContainerAppIngressConfiguration ContainerAppIngressConfiguration(string fqdn = null, bool? external = null, int? targetPort = null, int? exposedPort = null, ContainerAppIngressTransportMethod? transport = null, IEnumerable traffic = null, IEnumerable customDomains = null, bool? allowInsecure = null, IEnumerable ipSecurityRestrictions = null, Affinity? stickySessionsAffinity = null, ContainerAppIngressClientCertificateMode? clientCertificateMode = null, ContainerAppCorsPolicy corsPolicy = null, IEnumerable additionalPortMappings = null, IngressTargetPortHttpScheme? targetPortHttpScheme = null) { traffic ??= new List(); customDomains ??= new List(); @@ -368,6 +505,7 @@ public static ContainerAppIngressConfiguration ContainerAppIngressConfiguration( clientCertificateMode, corsPolicy, additionalPortMappings?.ToList(), + targetPortHttpScheme, serializedAdditionalRawData: null); } @@ -375,10 +513,11 @@ public static ContainerAppIngressConfiguration ContainerAppIngressConfiguration( /// Required CPU in cores, e.g. 0.5. /// Required memory, e.g. "250Mb". /// Ephemeral Storage, e.g. "1Gi". + /// Required GPU in cores for GPU based app, e.g. 1.0. /// A new instance for mocking. - public static AppContainerResources AppContainerResources(double? cpu = null, string memory = null, string ephemeralStorage = null) + public static AppContainerResources AppContainerResources(double? cpu = null, string memory = null, string ephemeralStorage = null, double? gpu = null) { - return new AppContainerResources(cpu, memory, ephemeralStorage, serializedAdditionalRawData: null); + return new AppContainerResources(cpu, memory, ephemeralStorage, gpu, serializedAdditionalRawData: null); } /// Initializes a new instance of . @@ -479,6 +618,170 @@ public static ContainerAppAuthToken ContainerAppAuthToken(ResourceIdentifier id serializedAdditionalRawData: null); } + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// Build provisioning state. + /// Status of the build once it has been provisioned. + /// Container registry that the final image will be uploaded to. + /// Configuration of the build. + /// Endpoint from which the build logs can be streamed. + /// A new instance for mocking. + public static ContainerAppsBuildResourceData ContainerAppsBuildResourceData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, ContainerAppBuildProvisioningState? provisioningState = null, ContainerAppBuildStatus? buildStatus = null, ContainerRegistryWithCustomImage destinationContainerRegistry = null, ContainerAppsBuildConfiguration configuration = null, string logStreamEndpoint = null) + { + return new ContainerAppsBuildResourceData( + id, + name, + resourceType, + systemData, + provisioningState, + buildStatus, + destinationContainerRegistry, + configuration, + logStreamEndpoint, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Base OS used to build and run the app. + /// Platform to be used to build and run the app. + /// Platform version to be used to build and run the app. + /// List of environment variables to be passed to the build, secrets should not be used in environment variable. + /// List of steps to perform before the build. + /// A new instance for mocking. + public static ContainerAppsBuildConfiguration ContainerAppsBuildConfiguration(string baseOS = null, string platform = null, string platformVersion = null, IEnumerable environmentVariables = null, IEnumerable preBuildSteps = null) + { + environmentVariables ??= new List(); + preBuildSteps ??= new List(); + + return new ContainerAppsBuildConfiguration( + baseOS, + platform, + platformVersion, + environmentVariables?.ToList(), + preBuildSteps?.ToList(), + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// Container App Label History resource specific properties. + /// A new instance for mocking. + public static LabelHistoryData LabelHistoryData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IEnumerable labelHistoryRecords = null) + { + labelHistoryRecords ??= new List(); + + return new LabelHistoryData( + id, + name, + resourceType, + systemData, + labelHistoryRecords != null ? new LabelHistoryProperties(labelHistoryRecords?.ToList(), serializedAdditionalRawData: null) : null, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Container App revision name that label was applied to. + /// Timestamp describing when the label was applied to the revision. + /// Timestamp describing when the label was removed from the revision. Only meaningful when the label is currently applied to the revision. + /// Status of the label history record. + /// A new instance for mocking. + public static LabelHistoryRecordItem LabelHistoryRecordItem(string revision = null, DateTimeOffset? start = null, DateTimeOffset? stop = null, LabelHistoryRecordItemStatus? status = null) + { + return new LabelHistoryRecordItem(revision, start, stop, status, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// Properties that describes current states of the patch resource. + /// A new instance for mocking. + public static ContainerAppsPatchResourceData ContainerAppsPatchResourceData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, PatchProperties properties = null) + { + return new ContainerAppsPatchResourceData( + id, + name, + resourceType, + systemData, + properties, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The Azure resource id of the target environment for the patch. + /// The Azure resource id of the target container app for the patch. + /// The Azure resource id of the target revision for the patch. + /// The status of the patch operation. + /// The UTC timestamp that describes when the patch object was created. + /// The UTC timestamp that describes when the patch object was last updated. + /// Detailed info describes the patch operation for the target container app. + /// A new instance for mocking. + public static PatchProperties PatchProperties(ResourceIdentifier targetEnvironmentId = null, ResourceIdentifier targetContainerAppId = null, ResourceIdentifier targetRevisionId = null, PatchApplyStatus? patchApplyStatus = null, DateTimeOffset? createdOn = null, DateTimeOffset? lastModifiedOn = null, IEnumerable patchDetails = null) + { + patchDetails ??= new List(); + + return new PatchProperties( + targetEnvironmentId, + targetContainerAppId, + targetRevisionId, + patchApplyStatus, + createdOn, + lastModifiedOn, + patchDetails?.ToList(), + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The name of the target container for the patch. + /// The name of the target image for the patch. + /// The UTC timestamp that describes the latest detection was done. + /// The status of the patch detection. + /// The name of the new image created by the patch. + /// New layer update details in the target image. + /// The old layer details in the target image. + /// The type for the patch. + /// A new instance for mocking. + public static PatchDetails PatchDetails(string targetContainerName = null, string targetImage = null, DateTimeOffset lastDetectionOn = default, DetectionStatus detectionStatus = default, string newImageName = null, PatchDetailsNewLayer newLayer = null, PatchDetailsOldLayer oldLayer = null, PatchType? patchType = null) + { + return new PatchDetails( + targetContainerName, + targetImage, + lastDetectionOn, + detectionStatus, + newImageName, + newLayer, + oldLayer, + patchType, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The details of the new layer for the target image. + /// The framework and its version in the new run image for the target image. + /// The OS name and its version in the new run image for the target image. + /// A new instance for mocking. + public static PatchDetailsNewLayer PatchDetailsNewLayer(string name = null, string frameworkAndVersion = null, string osAndVersion = null) + { + return new PatchDetailsNewLayer(name, frameworkAndVersion, osAndVersion, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The details of the old layer for the target image. + /// The framework and its version in the old run image for the target image. + /// The OS name and its version in the old run image for the target image. + /// A new instance for mocking. + public static PatchDetailsOldLayer PatchDetailsOldLayer(string name = null, string frameworkAndVersion = null, string osAndVersion = null) + { + return new PatchDetailsOldLayer(name, frameworkAndVersion, osAndVersion, serializedAdditionalRawData: null); + } + /// Initializes a new instance of . /// The id. /// The name. @@ -498,13 +801,16 @@ public static ContainerAppAuthToken ContainerAppAuthToken(ResourceIdentifier id /// Boolean describing if the Revision is Active. /// Number of pods currently running for this revision. /// Traffic weight assigned to this revision. + /// List of labels assigned to this revision. /// Optional Field - Platform Error Message. /// Current health State of the revision. /// Current provisioning State of the revision. /// Current running state of the revision. /// A new instance for mocking. - public static ContainerAppRevisionData ContainerAppRevisionData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, DateTimeOffset? createdOn = null, DateTimeOffset? lastActiveOn = null, string fqdn = null, ContainerAppTemplate template = null, bool? isActive = null, int? replicas = null, int? trafficWeight = null, string provisioningError = null, ContainerAppRevisionHealthState? healthState = null, ContainerAppRevisionProvisioningState? provisioningState = null, RevisionRunningState? runningState = null) + public static ContainerAppRevisionData ContainerAppRevisionData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, DateTimeOffset? createdOn = null, DateTimeOffset? lastActiveOn = null, string fqdn = null, ContainerAppTemplate template = null, bool? isActive = null, int? replicas = null, int? trafficWeight = null, IEnumerable labels = null, string provisioningError = null, ContainerAppRevisionHealthState? healthState = null, ContainerAppRevisionProvisioningState? provisioningState = null, RevisionRunningState? runningState = null) { + labels ??= new List(); + return new ContainerAppRevisionData( id, name, @@ -517,6 +823,7 @@ public static ContainerAppRevisionData ContainerAppRevisionData(ResourceIdentifi isActive, replicas, trafficWeight, + labels?.ToList(), provisioningError, healthState, provisioningState, @@ -563,8 +870,9 @@ public static ContainerAppReplicaData ContainerAppReplicaData(ResourceIdentifier /// The details of container current running state. /// Log Stream endpoint. /// Container exec endpoint. + /// Container debug endpoint. /// A new instance for mocking. - public static ContainerAppReplicaContainer ContainerAppReplicaContainer(string name = null, string containerId = null, bool? isReady = null, bool? isStarted = null, int? restartCount = null, ContainerAppContainerRunningState? runningState = null, string runningStateDetails = null, string logStreamEndpoint = null, string execEndpoint = null) + public static ContainerAppReplicaContainer ContainerAppReplicaContainer(string name = null, string containerId = null, bool? isReady = null, bool? isStarted = null, int? restartCount = null, ContainerAppContainerRunningState? runningState = null, string runningStateDetails = null, string logStreamEndpoint = null, string execEndpoint = null, string debugEndpoint = null) { return new ContainerAppReplicaContainer( name, @@ -576,6 +884,7 @@ public static ContainerAppReplicaContainer ContainerAppReplicaContainer(string n runningStateDetails, logStreamEndpoint, execEndpoint, + debugEndpoint, serializedAdditionalRawData: null); } @@ -652,9 +961,13 @@ public static ContainerAppDiagnosticSupportTopic ContainerAppDiagnosticSupportTo /// Vnet configuration for the environment. /// Any errors that occurred during deployment or deployment validation. /// Default Domain Name for the cluster. + /// Private Link Default Domain Name for the environment. /// Static IP of the Environment. /// Cluster configuration which enables the log daemon to export app logs to configured destination. + /// Environment level Application Insights configuration. + /// Environment Open Telemetry configuration. /// Whether or not this Managed Environment is zone-redundant. + /// The list of availability zones to use for managed environment. /// Custom domain configuration for the environment. /// The endpoint of the eventstream of the Environment. /// Workload profiles configured for the Managed Environment. @@ -663,11 +976,17 @@ public static ContainerAppDiagnosticSupportTopic ContainerAppDiagnosticSupportTo /// Name of the platform-managed resource group created for the Managed Environment to host infrastructure resources. If a subnet ID is provided, this resource group will be created in the same subscription as the subnet. /// Peer authentication settings for the Managed Environment. /// Peer traffic settings for the Managed Environment. + /// Ingress configuration for the Managed Environment. + /// Private endpoint connections to the resource. + /// Property to allow or block all public traffic. Allowed Values: 'Enabled', 'Disabled'. + /// Disk encryption configuration for the Managed Environment. /// A new instance for mocking. - public static ContainerAppManagedEnvironmentData ContainerAppManagedEnvironmentData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, string kind = null, ManagedServiceIdentity identity = null, ContainerAppEnvironmentProvisioningState? provisioningState = null, string daprAIInstrumentationKey = null, string daprAIConnectionString = null, ContainerAppVnetConfiguration vnetConfiguration = null, string deploymentErrors = null, string defaultDomain = null, IPAddress staticIP = null, ContainerAppLogsConfiguration appLogsConfiguration = null, bool? isZoneRedundant = null, ContainerAppCustomDomainConfiguration customDomainConfiguration = null, string eventStreamEndpoint = null, IEnumerable workloadProfiles = null, string kedaVersion = null, string daprVersion = null, string infrastructureResourceGroup = null, bool? isMtlsEnabled = null, bool? isEnabled = null) + public static ContainerAppManagedEnvironmentData ContainerAppManagedEnvironmentData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, string kind = null, ManagedServiceIdentity identity = null, ContainerAppEnvironmentProvisioningState? provisioningState = null, string daprAIInstrumentationKey = null, string daprAIConnectionString = null, ContainerAppVnetConfiguration vnetConfiguration = null, string deploymentErrors = null, string defaultDomain = null, string privateLinkDefaultDomain = null, IPAddress staticIP = null, ContainerAppLogsConfiguration appLogsConfiguration = null, string appInsightsConnectionString = null, OpenTelemetryConfiguration openTelemetryConfiguration = null, bool? isZoneRedundant = null, IEnumerable availabilityZones = null, ContainerAppCustomDomainConfiguration customDomainConfiguration = null, string eventStreamEndpoint = null, IEnumerable workloadProfiles = null, string kedaVersion = null, string daprVersion = null, string infrastructureResourceGroup = null, bool? isMtlsEnabled = null, bool? isEnabled = null, IngressConfiguration ingressConfiguration = null, IEnumerable privateEndpointConnections = null, PublicNetworkAccess? publicNetworkAccess = null, DiskEncryptionConfigurationKeyVaultConfiguration diskEncryptionKeyVaultConfiguration = null) { tags ??= new Dictionary(); + availabilityZones ??= new List(); workloadProfiles ??= new List(); + privateEndpointConnections ??= new List(); return new ContainerAppManagedEnvironmentData( id, @@ -684,9 +1003,13 @@ public static ContainerAppManagedEnvironmentData ContainerAppManagedEnvironmentD vnetConfiguration, deploymentErrors, defaultDomain, + privateLinkDefaultDomain, staticIP, appLogsConfiguration, + appInsightsConnectionString != null ? new AppInsightsConfiguration(appInsightsConnectionString, serializedAdditionalRawData: null) : null, + openTelemetryConfiguration, isZoneRedundant, + availabilityZones?.ToList(), customDomainConfiguration, eventStreamEndpoint, workloadProfiles?.ToList(), @@ -695,6 +1018,36 @@ public static ContainerAppManagedEnvironmentData ContainerAppManagedEnvironmentD infrastructureResourceGroup, isMtlsEnabled != null ? new ManagedEnvironmentPropertiesPeerAuthentication(new Mtls(isMtlsEnabled, serializedAdditionalRawData: null), serializedAdditionalRawData: null) : null, isEnabled != null ? new ManagedEnvironmentPropertiesPeerTrafficConfiguration(new ManagedEnvironmentPropertiesPeerTrafficConfigurationEncryption(isEnabled, serializedAdditionalRawData: null), serializedAdditionalRawData: null) : null, + ingressConfiguration, + privateEndpointConnections?.ToList(), + publicNetworkAccess, + diskEncryptionKeyVaultConfiguration != null ? new DiskEncryptionConfiguration(diskEncryptionKeyVaultConfiguration, serializedAdditionalRawData: null) : null, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The group ids for the private endpoint resource. + /// The resource of private end point. + /// A collection of information about the state of the connection between service consumer and provider. + /// The provisioning state of the private endpoint connection resource. + /// A new instance for mocking. + public static AppContainersPrivateEndpointConnectionData AppContainersPrivateEndpointConnectionData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IEnumerable groupIds = null, ResourceIdentifier privateEndpointId = null, AppContainersPrivateLinkServiceConnectionState connectionState = null, AppContainersPrivateEndpointConnectionProvisioningState? provisioningState = null) + { + groupIds ??= new List(); + + return new AppContainersPrivateEndpointConnectionData( + id, + name, + resourceType, + systemData, + groupIds?.ToList(), + privateEndpointId != null ? ResourceManagerModelFactory.SubResource(privateEndpointId) : null, + connectionState, + provisioningState, serializedAdditionalRawData: null); } @@ -705,8 +1058,10 @@ public static ContainerAppManagedEnvironmentData ContainerAppManagedEnvironmentD /// The systemData. /// The tags. /// The location. + /// The complex type of the extended location. /// Managed identities needed by a container app job to interact with other Azure services to not maintain any secrets or credentials in code. /// Provisioning state of the Container Apps Job. + /// Current running state of the job. /// Resource ID of environment. /// Workload profile name to pin for container apps job execution. /// Container Apps Job configuration properties. @@ -714,7 +1069,7 @@ public static ContainerAppManagedEnvironmentData ContainerAppManagedEnvironmentD /// Outbound IP Addresses of a container apps job. /// The endpoint of the eventstream of the container apps job. /// A new instance for mocking. - public static ContainerAppJobData ContainerAppJobData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, ManagedServiceIdentity identity = null, ContainerAppJobProvisioningState? provisioningState = null, string environmentId = null, string workloadProfileName = null, ContainerAppJobConfiguration configuration = null, ContainerAppJobTemplate template = null, IEnumerable outboundIPAddresses = null, string eventStreamEndpoint = null) + public static ContainerAppJobData ContainerAppJobData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, ContainerAppExtendedLocation extendedLocation = null, ManagedServiceIdentity identity = null, ContainerAppJobProvisioningState? provisioningState = null, ContainerAppJobRunningState? runningState = null, string environmentId = null, string workloadProfileName = null, ContainerAppJobConfiguration configuration = null, ContainerAppJobTemplate template = null, IEnumerable outboundIPAddresses = null, string eventStreamEndpoint = null) { tags ??= new Dictionary(); outboundIPAddresses ??= new List(); @@ -726,8 +1081,10 @@ public static ContainerAppJobData ContainerAppJobData(ResourceIdentifier id = nu systemData, tags, location, + extendedLocation, identity, provisioningState, + runningState, environmentId, workloadProfileName, configuration, @@ -737,6 +1094,33 @@ public static ContainerAppJobData ContainerAppJobData(ResourceIdentifier id = nu serializedAdditionalRawData: null); } + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// Type of the .NET Component. + /// Provisioning state of the .NET Component. + /// List of .NET Components configuration properties. + /// List of .NET Components that are bound to the .NET component. + /// A new instance for mocking. + public static DotNetComponentData DotNetComponentData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, DotNetComponentType? componentType = null, DotNetComponentProvisioningState? provisioningState = null, IEnumerable configurations = null, IEnumerable serviceBinds = null) + { + configurations ??= new List(); + serviceBinds ??= new List(); + + return new DotNetComponentData( + id, + name, + resourceType, + systemData, + componentType, + provisioningState, + configurations?.ToList(), + serviceBinds?.ToList(), + serializedAdditionalRawData: null); + } + /// Initializes a new instance of . /// The id. /// The name. @@ -745,7 +1129,7 @@ public static ContainerAppJobData ContainerAppJobData(ResourceIdentifier id = nu /// /// Java Component resource specific properties /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , and . + /// The available derived classes include , , , and . /// /// A new instance for mocking. public static JavaComponentData JavaComponentData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, JavaComponentProperties properties = null) @@ -809,9 +1193,12 @@ public static ContainerAppJobExecutions ContainerAppJobExecutions(IEnumerable Job execution start time. /// Job execution end time. /// Job's execution container. + /// Detailed status of the job execution. /// A new instance for mocking. - public static ContainerAppJobExecutionData ContainerAppJobExecutionData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, JobExecutionRunningState? status = null, DateTimeOffset? startOn = null, DateTimeOffset? endOn = null, ContainerAppJobExecutionTemplate template = null) + public static ContainerAppJobExecutionData ContainerAppJobExecutionData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, JobExecutionRunningState? status = null, DateTimeOffset? startOn = null, DateTimeOffset? endOn = null, ContainerAppJobExecutionTemplate template = null, IEnumerable detailedStatusReplicas = null) { + detailedStatusReplicas ??= new List(); + return new ContainerAppJobExecutionData( id, name, @@ -821,9 +1208,91 @@ public static ContainerAppJobExecutionData ContainerAppJobExecutionData(Resource startOn, endOn, template, + detailedStatusReplicas != null ? new ExecutionStatus(detailedStatusReplicas?.ToList(), serializedAdditionalRawData: null) : null, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Replica Name. + /// Containers in the execution replica. + /// A new instance for mocking. + public static ReplicaExecutionStatus ReplicaExecutionStatus(string name = null, IEnumerable containers = null) + { + containers ??= new List(); + + return new ReplicaExecutionStatus(name, containers?.ToList(), serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Container Name. + /// Exit code. + /// Additional information for the container status. + /// Status of the container. + /// A new instance for mocking. + public static ContainerExecutionStatus ContainerExecutionStatus(string name = null, int? code = null, string additionalInformation = null, string status = null) + { + return new ContainerExecutionStatus(name, code, additionalInformation, status, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The resource-specific properties for this resource. + /// A new instance for mocking. + public static LogicAppData LogicAppData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, BinaryData properties = null) + { + return new LogicAppData( + id, + name, + resourceType, + systemData, + properties, serializedAdditionalRawData: null); } + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The resource kind. + /// The resource location. + /// Additional workflow properties. + /// A new instance for mocking. + public static WorkflowEnvelopeData WorkflowEnvelopeData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, string kind = null, AzureLocation? location = null, ContainerAppWorkflowEnvelopeProperties properties = null) + { + return new WorkflowEnvelopeData( + id, + name, + resourceType, + systemData, + kind, + location, + properties, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Gets or sets the files. + /// Gets or sets the state of the workflow. + /// Gets or sets workflow health. + /// A new instance for mocking. + public static ContainerAppWorkflowEnvelopeProperties ContainerAppWorkflowEnvelopeProperties(BinaryData files = null, ContainerAppWorkflowState? flowState = null, ContainerAppWorkflowHealth health = null) + { + return new ContainerAppWorkflowEnvelopeProperties(files, flowState, health, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Gets or sets the workflow health state. + /// Gets or sets the workflow error. + /// A new instance for mocking. + public static ContainerAppWorkflowHealth ContainerAppWorkflowHealth(ContainerAppWorkflowHealthState state = default, ResponseError error = null) + { + return new ContainerAppWorkflowHealth(state, error, serializedAdditionalRawData: null); + } + /// Initializes a new instance of . /// The id. /// The name. @@ -910,69 +1379,255 @@ public static ContainerAppWorkloadProfileState ContainerAppWorkloadProfileState( serializedAdditionalRawData: null); } - /// Initializes a new instance of . + /// Initializes a new instance of . /// The id. /// The name. /// The resourceType. /// The systemData. - /// Storage properties. - /// A new instance for mocking. - public static ContainerAppManagedEnvironmentStorageData ContainerAppManagedEnvironmentStorageData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, ManagedEnvironmentStorageProperties properties = null) + /// The private link resource group id. + /// The private link resource required member names. + /// The private link resource private link DNS zone name. + /// A new instance for mocking. + public static AppContainersPrivateLinkResource AppContainersPrivateLinkResource(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, string groupId = null, IEnumerable requiredMembers = null, IEnumerable requiredZoneNames = null) { - return new ContainerAppManagedEnvironmentStorageData( + requiredMembers ??= new List(); + requiredZoneNames ??= new List(); + + return new AppContainersPrivateLinkResource( id, name, resourceType, systemData, - properties, + groupId, + requiredMembers?.ToList(), + requiredZoneNames?.ToList(), serializedAdditionalRawData: null); } - /// Initializes a new instance of . + /// Initializes a new instance of . /// The id. /// The name. /// The resourceType. /// The systemData. - /// The tags. - /// The location. - /// Managed identities needed by a session pool to interact with other Azure services to not maintain any secrets or credentials in code. - /// Resource ID of the session pool's environment. - /// The container type of the sessions. - /// The pool management type of the session pool. - /// The number of nodes the session pool is using. - /// The scale configuration of the session pool. - /// The secrets of the session pool. - /// The pool configuration if the poolManagementType is dynamic. - /// The custom container configuration if the containerType is CustomContainer. - /// The network configuration of the sessions in the session pool. - /// The endpoint to manage the pool. - /// Provisioning state of the session pool. - /// Optional settings for a Managed Identity that is assigned to the Session pool. - /// A new instance for mocking. - public static SessionPoolData SessionPoolData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, ManagedServiceIdentity identity = null, ResourceIdentifier environmentId = null, ContainerType? containerType = null, PoolManagementType? poolManagementType = null, int? nodeCount = null, SessionPoolScaleConfiguration scaleConfiguration = null, IEnumerable secrets = null, SessionPoolLifecycleConfiguration dynamicPoolLifecycleConfiguration = null, CustomContainerTemplate customContainerTemplate = null, SessionNetworkStatus? sessionNetworkStatus = null, Uri poolManagementEndpoint = null, SessionPoolProvisioningState? provisioningState = null, IEnumerable managedIdentitySettings = null) + /// The optional inbound component resiliency policy configuration. + /// The optional outbound component resiliency policy configuration. + /// A new instance for mocking. + public static DaprComponentResiliencyPolicyData DaprComponentResiliencyPolicyData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, DaprComponentResiliencyPolicyConfiguration inboundPolicy = null, DaprComponentResiliencyPolicyConfiguration outboundPolicy = null) { - tags ??= new Dictionary(); - secrets ??= new List(); - managedIdentitySettings ??= new List(); - - return new SessionPoolData( + return new DaprComponentResiliencyPolicyData( id, name, resourceType, systemData, - tags, - location, - identity, - environmentId, - containerType, - poolManagementType, - nodeCount, - scaleConfiguration, - secrets?.ToList(), - dynamicPoolLifecycleConfiguration != null ? new DynamicPoolConfiguration(dynamicPoolLifecycleConfiguration, serializedAdditionalRawData: null) : null, - customContainerTemplate, - sessionNetworkStatus != null ? new SessionNetworkConfiguration(sessionNetworkStatus, serializedAdditionalRawData: null) : null, - poolManagementEndpoint, + inboundPolicy, + outboundPolicy, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// Component type. + /// Component version. + /// Boolean describing if the component errors are ignores. + /// Initialization timeout. + /// Collection of secrets used by a Dapr component. + /// Name of a Dapr component to retrieve component secrets from. + /// Component metadata. + /// Names of container apps that can use this Dapr component. + /// List of container app services that are bound to the Dapr component. + /// A new instance for mocking. + public static ContainerAppDaprComponentData ContainerAppDaprComponentData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, string componentType = null, string version = null, bool? ignoreErrors = null, string initTimeout = null, IEnumerable secrets = null, string secretStoreComponent = null, IEnumerable metadata = null, IEnumerable scopes = null, IEnumerable serviceComponentBind = null) + { + secrets ??= new List(); + metadata ??= new List(); + scopes ??= new List(); + serviceComponentBind ??= new List(); + + return new ContainerAppDaprComponentData( + id, + name, + resourceType, + systemData, + componentType, + version, + ignoreErrors, + initTimeout, + secrets?.ToList(), + secretStoreComponent, + metadata?.ToList(), + scopes?.ToList(), + serviceComponentBind?.ToList(), + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// Dapr PubSub component name. + /// Topic name. + /// Deadletter topic name. + /// Subscription routes. + /// Application scopes to restrict the subscription to specific apps. + /// Subscription metadata. + /// Bulk subscription options. + /// A new instance for mocking. + public static DaprSubscriptionData DaprSubscriptionData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, string pubsubName = null, string topic = null, string deadLetterTopic = null, DaprSubscriptionRoutes routes = null, IEnumerable scopes = null, IDictionary metadata = null, DaprSubscriptionBulkSubscribeConfig bulkSubscribe = null) + { + scopes ??= new List(); + metadata ??= new Dictionary(); + + return new DaprSubscriptionData( + id, + name, + resourceType, + systemData, + pubsubName, + topic, + deadLetterTopic, + routes, + scopes?.ToList(), + metadata, + bulkSubscribe, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// Http Route Config properties. + /// A new instance for mocking. + public static HttpRouteConfigData HttpRouteConfigData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, HttpRouteConfigProperties properties = null) + { + return new HttpRouteConfigData( + id, + name, + resourceType, + systemData, + properties, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The provisioning state of the Http Route Config in cluster. + /// List of errors when trying to reconcile http routes. + /// FQDN of the route resource. + /// Custom domain bindings for http Routes' hostnames. + /// Routing Rules for http route resource. + /// A new instance for mocking. + public static HttpRouteConfigProperties HttpRouteConfigProperties(HttpRouteProvisioningState? provisioningState = null, IEnumerable provisioningErrors = null, string fqdn = null, IEnumerable customDomains = null, IEnumerable rules = null) + { + provisioningErrors ??= new List(); + customDomains ??= new List(); + rules ??= new List(); + + return new HttpRouteConfigProperties( + provisioningState, + provisioningErrors?.ToList(), + fqdn, + customDomains?.ToList(), + rules?.ToList(), + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Timestamp error occured at. + /// Description or error message. + /// A new instance for mocking. + public static HttpRouteProvisioningErrors HttpRouteProvisioningErrors(DateTimeOffset? timestamp = null, string message = null) + { + return new HttpRouteProvisioningErrors(timestamp, message, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// List of maintenance schedules for a managed environment. + /// A new instance for mocking. + public static MaintenanceConfigurationResourceData MaintenanceConfigurationResourceData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IEnumerable scheduledEntries = null) + { + scheduledEntries ??= new List(); + + return new MaintenanceConfigurationResourceData( + id, + name, + resourceType, + systemData, + scheduledEntries?.ToList(), + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// Storage properties. + /// A new instance for mocking. + public static ContainerAppManagedEnvironmentStorageData ContainerAppManagedEnvironmentStorageData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, ManagedEnvironmentStorageProperties properties = null) + { + return new ContainerAppManagedEnvironmentStorageData( + id, + name, + resourceType, + systemData, + properties, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The tags. + /// The location. + /// Managed identities needed by a session pool to interact with other Azure services to not maintain any secrets or credentials in code. + /// Resource ID of the session pool's environment. + /// The container type of the sessions. + /// The pool management type of the session pool. + /// The number of nodes the session pool is using. + /// The scale configuration of the session pool. + /// The secrets of the session pool. + /// The pool configuration if the poolManagementType is dynamic. + /// The custom container configuration if the containerType is CustomContainer. + /// The network configuration of the sessions in the session pool. + /// The endpoint to manage the pool. + /// Provisioning state of the session pool. + /// Optional settings for a Managed Identity that is assigned to the Session pool. + /// A new instance for mocking. + public static SessionPoolData SessionPoolData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, ManagedServiceIdentity identity = null, ResourceIdentifier environmentId = null, ContainerType? containerType = null, PoolManagementType? poolManagementType = null, int? nodeCount = null, SessionPoolScaleConfiguration scaleConfiguration = null, IEnumerable secrets = null, SessionPoolLifecycleConfiguration dynamicPoolLifecycleConfiguration = null, CustomContainerTemplate customContainerTemplate = null, SessionNetworkStatus? sessionNetworkStatus = null, Uri poolManagementEndpoint = null, SessionPoolProvisioningState? provisioningState = null, IEnumerable managedIdentitySettings = null) + { + tags ??= new Dictionary(); + secrets ??= new List(); + managedIdentitySettings ??= new List(); + + return new SessionPoolData( + id, + name, + resourceType, + systemData, + tags, + location, + identity, + environmentId, + containerType, + poolManagementType, + nodeCount, + scaleConfiguration, + secrets?.ToList(), + dynamicPoolLifecycleConfiguration != null ? new DynamicPoolConfiguration(dynamicPoolLifecycleConfiguration, serializedAdditionalRawData: null) : null, + customContainerTemplate, + sessionNetworkStatus != null ? new SessionNetworkConfiguration(sessionNetworkStatus, serializedAdditionalRawData: null) : null, + poolManagementEndpoint, provisioningState, managedIdentitySettings?.ToList(), serializedAdditionalRawData: null); @@ -1026,6 +1681,31 @@ public static ContainerAppUsageName ContainerAppUsageName(string value = null, s return new ContainerAppUsageName(value, localizedValue, serializedAdditionalRawData: null); } + /// Initializes a new instance of . + /// Provisioning state of the Java Component. + /// List of Java Components configuration properties. + /// Java component scaling configurations. + /// List of Java Components that are bound to the Java component. + /// Java Component Ingress configurations. + /// Gateway route definition. + /// A new instance for mocking. + public static SpringCloudGatewayComponent SpringCloudGatewayComponent(JavaComponentProvisioningState? provisioningState = null, IEnumerable configurations = null, JavaComponentPropertiesScale scale = null, IEnumerable serviceBinds = null, string ingressFqdn = null, IEnumerable springCloudGatewayRoutes = null) + { + configurations ??= new List(); + serviceBinds ??= new List(); + springCloudGatewayRoutes ??= new List(); + + return new SpringCloudGatewayComponent( + JavaComponentType.SpringCloudGateway, + provisioningState, + configurations?.ToList(), + scale, + serviceBinds?.ToList(), + serializedAdditionalRawData: null, + ingressFqdn != null ? new JavaComponentIngress(ingressFqdn, serializedAdditionalRawData: null) : null, + springCloudGatewayRoutes?.ToList()); + } + /// Initializes a new instance of . /// Provisioning state of the Java Component. /// List of Java Components configuration properties. @@ -1048,6 +1728,28 @@ public static SpringBootAdminComponent SpringBootAdminComponent(JavaComponentPro ingressFqdn != null ? new JavaComponentIngress(ingressFqdn, serializedAdditionalRawData: null) : null); } + /// Initializes a new instance of . + /// Provisioning state of the Java Component. + /// List of Java Components configuration properties. + /// Java component scaling configurations. + /// List of Java Components that are bound to the Java component. + /// Java Component Ingress configurations. + /// A new instance for mocking. + public static NacosComponent NacosComponent(JavaComponentProvisioningState? provisioningState = null, IEnumerable configurations = null, JavaComponentPropertiesScale scale = null, IEnumerable serviceBinds = null, string ingressFqdn = null) + { + configurations ??= new List(); + serviceBinds ??= new List(); + + return new NacosComponent( + JavaComponentType.Nacos, + provisioningState, + configurations?.ToList(), + scale, + serviceBinds?.ToList(), + serializedAdditionalRawData: null, + ingressFqdn != null ? new JavaComponentIngress(ingressFqdn, serializedAdditionalRawData: null) : null); + } + /// Initializes a new instance of . /// Provisioning state of the Java Component. /// List of Java Components configuration properties. @@ -1090,6 +1792,226 @@ public static SpringCloudConfigComponent SpringCloudConfigComponent(JavaComponen serializedAdditionalRawData: null); } + /// Initializes a new instance of . + /// Provisioning state of the certificate. + /// Properties for a certificate stored in a Key Vault. + /// Certificate password. + /// Subject name of the certificate. + /// Subject alternative names the certificate applies to. + /// PFX or PEM blob. + /// Certificate issuer. + /// Certificate issue Date. + /// Certificate expiration date. + /// Certificate thumbprint. + /// Is the certificate valid?. + /// Public key hash. + /// A new instance for mocking. + [EditorBrowsable(EditorBrowsableState.Never)] + public static ContainerAppCertificateProperties ContainerAppCertificateProperties(ContainerAppCertificateProvisioningState? provisioningState, ContainerAppCertificateKeyVaultProperties certificateKeyVaultProperties, string password, string subjectName, IEnumerable subjectAlternativeNames, byte[] value, string issuer, DateTimeOffset? issueOn, DateTimeOffset? expireOn, string thumbprint, bool? isValid, string publicKeyHash) + { + return ContainerAppCertificateProperties(provisioningState: provisioningState, deploymentErrors: default, certificateKeyVaultProperties: certificateKeyVaultProperties, password: password, subjectName: subjectName, subjectAlternativeNames: subjectAlternativeNames, value: value, issuer: issuer, issueOn: issueOn, expireOn: expireOn, thumbprint: thumbprint, isValid: isValid, publicKeyHash: publicKeyHash, certificateType: default); + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// Component type. + /// Component version. + /// Boolean describing if the component errors are ignores. + /// Initialization timeout. + /// Collection of secrets used by a Dapr component. + /// Name of a Dapr component to retrieve component secrets from. + /// Component metadata. + /// Names of container apps that can use this Dapr component. + /// A new instance for mocking. + [EditorBrowsable(EditorBrowsableState.Never)] + public static ContainerAppDaprComponentData ContainerAppDaprComponentData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, string componentType, string version, bool? ignoreErrors, string initTimeout, IEnumerable secrets, string secretStoreComponent, IEnumerable metadata, IEnumerable scopes) + { + return ContainerAppDaprComponentData(id: id, name: name, resourceType: resourceType, systemData: systemData, componentType: componentType, version: version, ignoreErrors: ignoreErrors, initTimeout: initTimeout, secrets: secrets, secretStoreComponent: secretStoreComponent, metadata: metadata, scopes: scopes, serviceComponentBind: default); + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The tags. + /// The location. + /// The complex type of the extended location. + /// managed identities for the Container App to interact with other Azure services without maintaining any secrets or credentials in code. + /// The fully qualified resource ID of the resource that manages this resource. Indicates if this resource is managed by another Azure resource. If this is present, complete mode deployment will not delete the resource if it is removed from the template since it is managed by another resource. + /// Provisioning state of the Container App. + /// Running status of the Container App. + /// Deprecated. Resource ID of the Container App's environment. + /// Resource ID of environment. + /// Workload profile name to pin for container app execution. + /// Name of the latest revision of the Container App. + /// Name of the latest ready revision of the Container App. + /// Fully Qualified Domain Name of the latest revision of the Container App. + /// Id used to verify domain name ownership. + /// Non versioned Container App configuration properties. + /// Container App versioned application definition. + /// Outbound IP Addresses for container app. + /// The endpoint of the eventstream of the container app. + /// A new instance for mocking. + [EditorBrowsable(EditorBrowsableState.Never)] + public static ContainerAppData ContainerAppData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, ContainerAppExtendedLocation extendedLocation, ManagedServiceIdentity identity, string managedBy, ContainerAppProvisioningState? provisioningState, ContainerAppRunningStatus? runningStatus, ResourceIdentifier managedEnvironmentId, ResourceIdentifier environmentId, string workloadProfileName, string latestRevisionName, string latestReadyRevisionName, string latestRevisionFqdn, string customDomainVerificationId, ContainerAppConfiguration configuration, ContainerAppTemplate template, IEnumerable outboundIPAddressList, Uri eventStreamEndpoint) + { + return ContainerAppData(id: id, name: name, resourceType: resourceType, systemData: systemData, tags: tags, location: location, extendedLocation: extendedLocation, identity: identity, managedBy: managedBy, kind: default, provisioningState: provisioningState, runningStatus: runningStatus, deploymentErrors: default, managedEnvironmentId: managedEnvironmentId, environmentId: environmentId, workloadProfileName: workloadProfileName, patchingMode: default, latestRevisionName: latestRevisionName, latestReadyRevisionName: latestReadyRevisionName, latestRevisionFqdn: latestRevisionFqdn, customDomainVerificationId: customDomainVerificationId, configuration: configuration, template: template, outboundIPAddressList: outboundIPAddressList, eventStreamEndpoint: eventStreamEndpoint); + } + + /// Initializes a new instance of . + /// Hostname. + /// Bool indicating if app exposes an external http endpoint. + /// Target Port in containers for traffic from ingress. + /// Exposed Port in containers for TCP traffic from ingress. + /// Ingress transport protocol. + /// Traffic weights for app's revisions. + /// custom domain bindings for Container Apps' hostnames. + /// Bool indicating if HTTP connections to is allowed. If set to false HTTP connections are automatically redirected to HTTPS connections. + /// Rules to restrict incoming IP address. + /// Sticky Sessions for Single Revision Mode. + /// Client certificate mode for mTLS authentication. Ignore indicates server drops client certificate on forwarding. Accept indicates server forwards client certificate but does not require a client certificate. Require indicates server requires a client certificate. + /// CORS policy for container app. + /// Settings to expose additional ports on container app. + /// A new instance for mocking. + [EditorBrowsable(EditorBrowsableState.Never)] + public static ContainerAppIngressConfiguration ContainerAppIngressConfiguration(string fqdn, bool? external, int? targetPort, int? exposedPort, ContainerAppIngressTransportMethod? transport, IEnumerable traffic, IEnumerable customDomains, bool? allowInsecure, IEnumerable ipSecurityRestrictions, Affinity? stickySessionsAffinity, ContainerAppIngressClientCertificateMode? clientCertificateMode, ContainerAppCorsPolicy corsPolicy, IEnumerable additionalPortMappings) + { + return ContainerAppIngressConfiguration(fqdn: fqdn, external: external, targetPort: targetPort, exposedPort: exposedPort, transport: transport, traffic: traffic, customDomains: customDomains, allowInsecure: allowInsecure, ipSecurityRestrictions: ipSecurityRestrictions, stickySessionsAffinity: stickySessionsAffinity, clientCertificateMode: clientCertificateMode, corsPolicy: corsPolicy, additionalPortMappings: additionalPortMappings, targetPortHttpScheme: default); + } + + /// Initializes a new instance of . + /// Required CPU in cores, e.g. 0.5. + /// Required memory, e.g. "250Mb". + /// Ephemeral Storage, e.g. "1Gi". + /// A new instance for mocking. + [EditorBrowsable(EditorBrowsableState.Never)] + public static AppContainerResources AppContainerResources(double? cpu, string memory, string ephemeralStorage) + { + return AppContainerResources(cpu: cpu, memory: memory, ephemeralStorage: ephemeralStorage, gpu: default); + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// + /// Timestamp describing when the revision was created + /// by controller + /// + /// Timestamp describing when the revision was last active. Only meaningful when revision is inactive. + /// Fully qualified domain name of the revision. + /// + /// Container App Revision Template with all possible settings and the + /// defaults if user did not provide them. The defaults are populated + /// as they were at the creation time + /// + /// Boolean describing if the Revision is Active. + /// Number of pods currently running for this revision. + /// Traffic weight assigned to this revision. + /// Optional Field - Platform Error Message. + /// Current health State of the revision. + /// Current provisioning State of the revision. + /// Current running state of the revision. + /// A new instance for mocking. + [EditorBrowsable(EditorBrowsableState.Never)] + public static ContainerAppRevisionData ContainerAppRevisionData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, DateTimeOffset? createdOn, DateTimeOffset? lastActiveOn, string fqdn, ContainerAppTemplate template, bool? isActive, int? replicas, int? trafficWeight, string provisioningError, ContainerAppRevisionHealthState? healthState, ContainerAppRevisionProvisioningState? provisioningState, RevisionRunningState? runningState) + { + return ContainerAppRevisionData(id: id, name: name, resourceType: resourceType, systemData: systemData, createdOn: createdOn, lastActiveOn: lastActiveOn, fqdn: fqdn, template: template, isActive: isActive, replicas: replicas, trafficWeight: trafficWeight, labels: default, provisioningError: provisioningError, healthState: healthState, provisioningState: provisioningState, runningState: runningState); + } + + /// Initializes a new instance of . + /// The Name of the Container. + /// The Id of the Container. + /// The container ready status. + /// The container start status. + /// The container restart count. + /// Current running state of the container. + /// The details of container current running state. + /// Log Stream endpoint. + /// Container exec endpoint. + /// A new instance for mocking. + [EditorBrowsable(EditorBrowsableState.Never)] + public static ContainerAppReplicaContainer ContainerAppReplicaContainer(string name, string containerId, bool? isReady, bool? isStarted, int? restartCount, ContainerAppContainerRunningState? runningState, string runningStateDetails, string logStreamEndpoint, string execEndpoint) + { + return ContainerAppReplicaContainer(name: name, containerId: containerId, isReady: isReady, isStarted: isStarted, restartCount: restartCount, runningState: runningState, runningStateDetails: runningStateDetails, logStreamEndpoint: logStreamEndpoint, execEndpoint: execEndpoint, debugEndpoint: default); + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The tags. + /// The location. + /// Kind of the Environment. + /// Managed identities for the Managed Environment to interact with other Azure services without maintaining any secrets or credentials in code. + /// Provisioning state of the Environment. + /// Azure Monitor instrumentation key used by Dapr to export Service to Service communication telemetry. + /// Application Insights connection string used by Dapr to export Service to Service communication telemetry. + /// Vnet configuration for the environment. + /// Any errors that occurred during deployment or deployment validation. + /// Default Domain Name for the cluster. + /// Static IP of the Environment. + /// Cluster configuration which enables the log daemon to export app logs to configured destination. + /// Whether or not this Managed Environment is zone-redundant. + /// Custom domain configuration for the environment. + /// The endpoint of the eventstream of the Environment. + /// Workload profiles configured for the Managed Environment. + /// The configuration of Keda component. + /// The configuration of Dapr component. + /// Name of the platform-managed resource group created for the Managed Environment to host infrastructure resources. If a subnet ID is provided, this resource group will be created in the same subscription as the subnet. + /// Peer authentication settings for the Managed Environment. + /// Peer traffic settings for the Managed Environment. + /// A new instance for mocking. + [EditorBrowsable(EditorBrowsableState.Never)] + public static ContainerAppManagedEnvironmentData ContainerAppManagedEnvironmentData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, string kind, ManagedServiceIdentity identity, ContainerAppEnvironmentProvisioningState? provisioningState, string daprAIInstrumentationKey, string daprAIConnectionString, ContainerAppVnetConfiguration vnetConfiguration, string deploymentErrors, string defaultDomain, IPAddress staticIP, ContainerAppLogsConfiguration appLogsConfiguration, bool? isZoneRedundant, ContainerAppCustomDomainConfiguration customDomainConfiguration, string eventStreamEndpoint, IEnumerable workloadProfiles, string kedaVersion, string daprVersion, string infrastructureResourceGroup, bool? isMtlsEnabled, bool? isEnabled) + { + return ContainerAppManagedEnvironmentData(id: id, name: name, resourceType: resourceType, systemData: systemData, tags: tags, location: location, kind: kind, identity: identity, provisioningState: provisioningState, daprAIInstrumentationKey: daprAIInstrumentationKey, daprAIConnectionString: daprAIConnectionString, vnetConfiguration: vnetConfiguration, deploymentErrors: deploymentErrors, defaultDomain: defaultDomain, privateLinkDefaultDomain: default, staticIP: staticIP, appLogsConfiguration: appLogsConfiguration, appInsightsConnectionString: default, openTelemetryConfiguration: default, isZoneRedundant: isZoneRedundant, availabilityZones: default, customDomainConfiguration: customDomainConfiguration, eventStreamEndpoint: eventStreamEndpoint, workloadProfiles: workloadProfiles, kedaVersion: kedaVersion, daprVersion: daprVersion, infrastructureResourceGroup: infrastructureResourceGroup, isMtlsEnabled: isMtlsEnabled, isEnabled: isEnabled, ingressConfiguration: default, privateEndpointConnections: default, publicNetworkAccess: default, diskEncryptionKeyVaultConfiguration: default); + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The tags. + /// The location. + /// Managed identities needed by a container app job to interact with other Azure services to not maintain any secrets or credentials in code. + /// Provisioning state of the Container Apps Job. + /// Resource ID of environment. + /// Workload profile name to pin for container apps job execution. + /// Container Apps Job configuration properties. + /// Container Apps job definition. + /// Outbound IP Addresses of a container apps job. + /// The endpoint of the eventstream of the container apps job. + /// A new instance for mocking. + [EditorBrowsable(EditorBrowsableState.Never)] + public static ContainerAppJobData ContainerAppJobData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, ManagedServiceIdentity identity, ContainerAppJobProvisioningState? provisioningState, string environmentId, string workloadProfileName, ContainerAppJobConfiguration configuration, ContainerAppJobTemplate template, IEnumerable outboundIPAddresses, string eventStreamEndpoint) + { + return ContainerAppJobData(id: id, name: name, resourceType: resourceType, systemData: systemData, tags: tags, location: location, extendedLocation: default, identity: identity, provisioningState: provisioningState, runningState: default, environmentId: environmentId, workloadProfileName: workloadProfileName, configuration: configuration, template: template, outboundIPAddresses: outboundIPAddresses, eventStreamEndpoint: eventStreamEndpoint); + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// Current running State of the job. + /// Job execution start time. + /// Job execution end time. + /// Job's execution container. + /// A new instance for mocking. + [EditorBrowsable(EditorBrowsableState.Never)] + public static ContainerAppJobExecutionData ContainerAppJobExecutionData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, JobExecutionRunningState? status, DateTimeOffset? startOn, DateTimeOffset? endOn, ContainerAppJobExecutionTemplate template) + { + return ContainerAppJobExecutionData(id: id, name: name, resourceType: resourceType, systemData: systemData, status: status, startOn: startOn, endOn: endOn, template: template, detailedStatusReplicas: default); + } + /// Initializes a new instance of . /// Id used to verify domain name ownership. /// Dns suffix for the environment domain. @@ -1121,7 +2043,7 @@ public static ContainerAppCustomDomainConfiguration ContainerAppCustomDomainConf [EditorBrowsable(EditorBrowsableState.Never)] public static ContainerAppCertificateProperties ContainerAppCertificateProperties(ContainerAppCertificateProvisioningState? provisioningState, string password, string subjectName, IEnumerable subjectAlternativeNames, byte[] value, string issuer, DateTimeOffset? issueOn, DateTimeOffset? expireOn, string thumbprint, bool? isValid, string publicKeyHash) { - return ContainerAppCertificateProperties(provisioningState: provisioningState, certificateKeyVaultProperties: default, password: password, subjectName: subjectName, subjectAlternativeNames: subjectAlternativeNames, value: value, issuer: issuer, issueOn: issueOn, expireOn: expireOn, thumbprint: thumbprint, isValid: isValid, publicKeyHash: publicKeyHash); + return ContainerAppCertificateProperties(provisioningState: provisioningState, deploymentErrors: default, certificateKeyVaultProperties: default, password: password, subjectName: subjectName, subjectAlternativeNames: subjectAlternativeNames, value: value, issuer: issuer, issueOn: issueOn, expireOn: expireOn, thumbprint: thumbprint, isValid: isValid, publicKeyHash: publicKeyHash, certificateType: default); } /// Initializes a new instance of . @@ -1150,7 +2072,7 @@ public static ContainerAppCertificateProperties ContainerAppCertificatePropertie [EditorBrowsable(EditorBrowsableState.Never)] public static ContainerAppData ContainerAppData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, ContainerAppExtendedLocation extendedLocation, ManagedServiceIdentity identity, string managedBy, ContainerAppProvisioningState? provisioningState, ResourceIdentifier managedEnvironmentId, ResourceIdentifier environmentId, string workloadProfileName, string latestRevisionName, string latestReadyRevisionName, string latestRevisionFqdn, string customDomainVerificationId, ContainerAppConfiguration configuration, ContainerAppTemplate template, IEnumerable outboundIPAddressList, Uri eventStreamEndpoint) { - return ContainerAppData(id: id, name: name, resourceType: resourceType, systemData: systemData, tags: tags, location: location, extendedLocation: extendedLocation, identity: identity, managedBy: managedBy, provisioningState: provisioningState, runningStatus: default, managedEnvironmentId: managedEnvironmentId, environmentId: environmentId, workloadProfileName: workloadProfileName, latestRevisionName: latestRevisionName, latestReadyRevisionName: latestReadyRevisionName, latestRevisionFqdn: latestRevisionFqdn, customDomainVerificationId: customDomainVerificationId, configuration: configuration, template: template, outboundIPAddressList: outboundIPAddressList, eventStreamEndpoint: eventStreamEndpoint); + return ContainerAppData(id: id, name: name, resourceType: resourceType, systemData: systemData, tags: tags, location: location, extendedLocation: extendedLocation, identity: identity, managedBy: managedBy, kind: default, provisioningState: provisioningState, runningStatus: default, deploymentErrors: default, managedEnvironmentId: managedEnvironmentId, environmentId: environmentId, workloadProfileName: workloadProfileName, patchingMode: default, latestRevisionName: latestRevisionName, latestReadyRevisionName: latestReadyRevisionName, latestRevisionFqdn: latestRevisionFqdn, customDomainVerificationId: customDomainVerificationId, configuration: configuration, template: template, outboundIPAddressList: outboundIPAddressList, eventStreamEndpoint: eventStreamEndpoint); } /// Initializes a new instance of . @@ -1186,7 +2108,7 @@ public static ContainerAppData ContainerAppData(ResourceIdentifier id, string na [EditorBrowsable(EditorBrowsableState.Never)] public static ContainerAppManagedEnvironmentData ContainerAppManagedEnvironmentData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, string kind, ContainerAppEnvironmentProvisioningState? provisioningState, string daprAIInstrumentationKey, string daprAIConnectionString, ContainerAppVnetConfiguration vnetConfiguration, string deploymentErrors, string defaultDomain, IPAddress staticIP, ContainerAppLogsConfiguration appLogsConfiguration, bool? isZoneRedundant, ContainerAppCustomDomainConfiguration customDomainConfiguration, string eventStreamEndpoint, IEnumerable workloadProfiles, string kedaVersion, string daprVersion, string infrastructureResourceGroup, bool? isMtlsEnabled, bool? isEnabled) { - return ContainerAppManagedEnvironmentData(id: id, name: name, resourceType: resourceType, systemData: systemData, tags: tags, location: location, kind: kind, identity: default, provisioningState: provisioningState, daprAIInstrumentationKey: daprAIInstrumentationKey, daprAIConnectionString: daprAIConnectionString, vnetConfiguration: vnetConfiguration, deploymentErrors: deploymentErrors, defaultDomain: defaultDomain, staticIP: staticIP, appLogsConfiguration: appLogsConfiguration, isZoneRedundant: isZoneRedundant, customDomainConfiguration: customDomainConfiguration, eventStreamEndpoint: eventStreamEndpoint, workloadProfiles: workloadProfiles, kedaVersion: kedaVersion, daprVersion: daprVersion, infrastructureResourceGroup: infrastructureResourceGroup, isMtlsEnabled: isMtlsEnabled, isEnabled: isEnabled); + return ContainerAppManagedEnvironmentData(id: id, name: name, resourceType: resourceType, systemData: systemData, tags: tags, location: location, kind: kind, identity: default, provisioningState: provisioningState, daprAIInstrumentationKey: daprAIInstrumentationKey, daprAIConnectionString: daprAIConnectionString, vnetConfiguration: vnetConfiguration, deploymentErrors: deploymentErrors, defaultDomain: defaultDomain, privateLinkDefaultDomain: default, staticIP: staticIP, appLogsConfiguration: appLogsConfiguration, appInsightsConnectionString: default, openTelemetryConfiguration: default, isZoneRedundant: isZoneRedundant, availabilityZones: default, customDomainConfiguration: customDomainConfiguration, eventStreamEndpoint: eventStreamEndpoint, workloadProfiles: workloadProfiles, kedaVersion: kedaVersion, daprVersion: daprVersion, infrastructureResourceGroup: infrastructureResourceGroup, isMtlsEnabled: isMtlsEnabled, isEnabled: isEnabled, ingressConfiguration: default, privateEndpointConnections: default, publicNetworkAccess: default, diskEncryptionKeyVaultConfiguration: default); } /// Initializes a new instance of ContainerAppAuthConfigData. @@ -1223,7 +2145,7 @@ public static ContainerAppAuthConfigData ContainerAppAuthConfigData(ResourceIden [EditorBrowsable(EditorBrowsableState.Never)] public static ContainerAppIngressConfiguration ContainerAppIngressConfiguration(string fqdn, bool? external, int? targetPort, int? exposedPort, ContainerAppIngressTransportMethod? transport, IEnumerable traffic, IEnumerable customDomains, bool? allowInsecure, IEnumerable ipSecurityRestrictions, Affinity? stickySessionsAffinity, ContainerAppIngressClientCertificateMode? clientCertificateMode, ContainerAppCorsPolicy corsPolicy) { - return ContainerAppIngressConfiguration(fqdn: fqdn, external: external, targetPort: targetPort, exposedPort: exposedPort, transport: transport, traffic: traffic, customDomains: customDomains, allowInsecure: allowInsecure, ipSecurityRestrictions: ipSecurityRestrictions, stickySessionsAffinity: stickySessionsAffinity, clientCertificateMode: clientCertificateMode, corsPolicy: corsPolicy, additionalPortMappings: default); + return ContainerAppIngressConfiguration(fqdn: fqdn, external: external, targetPort: targetPort, exposedPort: exposedPort, transport: transport, traffic: traffic, customDomains: customDomains, allowInsecure: allowInsecure, ipSecurityRestrictions: ipSecurityRestrictions, stickySessionsAffinity: stickySessionsAffinity, clientCertificateMode: clientCertificateMode, corsPolicy: corsPolicy, additionalPortMappings: default, targetPortHttpScheme: default); } /// Initializes a new instance of ContainerAppManagedEnvironmentData. @@ -1258,7 +2180,7 @@ public static ContainerAppIngressConfiguration ContainerAppIngressConfiguration( [EditorBrowsable(EditorBrowsableState.Never)] public static ContainerAppManagedEnvironmentData ContainerAppManagedEnvironmentData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, string kind, ContainerAppEnvironmentProvisioningState? provisioningState, string daprAIInstrumentationKey, string daprAIConnectionString, ContainerAppVnetConfiguration vnetConfiguration, string deploymentErrors, string defaultDomain, IPAddress staticIP, ContainerAppLogsConfiguration appLogsConfiguration, bool? isZoneRedundant, ContainerAppCustomDomainConfiguration customDomainConfiguration, string eventStreamEndpoint, IEnumerable workloadProfiles, string kedaVersion, string daprVersion, string infrastructureResourceGroup, bool? isMtlsEnabled) { - return ContainerAppManagedEnvironmentData(id: id, name: name, resourceType: resourceType, systemData: systemData, tags: tags, location: location, kind: kind, identity: default, provisioningState: provisioningState, daprAIInstrumentationKey: daprAIInstrumentationKey, daprAIConnectionString: daprAIConnectionString, vnetConfiguration: vnetConfiguration, deploymentErrors: deploymentErrors, defaultDomain: defaultDomain, staticIP: staticIP, appLogsConfiguration: appLogsConfiguration, isZoneRedundant: isZoneRedundant, customDomainConfiguration: customDomainConfiguration, eventStreamEndpoint: eventStreamEndpoint, workloadProfiles: workloadProfiles, kedaVersion: kedaVersion, daprVersion: daprVersion, infrastructureResourceGroup: infrastructureResourceGroup, isMtlsEnabled: isMtlsEnabled, isEnabled: default); + return ContainerAppManagedEnvironmentData(id: id, name: name, resourceType: resourceType, systemData: systemData, tags: tags, location: location, kind: kind, identity: default, provisioningState: provisioningState, daprAIInstrumentationKey: daprAIInstrumentationKey, daprAIConnectionString: daprAIConnectionString, vnetConfiguration: vnetConfiguration, deploymentErrors: deploymentErrors, defaultDomain: defaultDomain, privateLinkDefaultDomain: default, staticIP: staticIP, appLogsConfiguration: appLogsConfiguration, appInsightsConnectionString: default, openTelemetryConfiguration: default, isZoneRedundant: isZoneRedundant, availabilityZones: default, customDomainConfiguration: customDomainConfiguration, eventStreamEndpoint: eventStreamEndpoint, workloadProfiles: workloadProfiles, kedaVersion: kedaVersion, daprVersion: daprVersion, infrastructureResourceGroup: infrastructureResourceGroup, isMtlsEnabled: isMtlsEnabled, isEnabled: default, ingressConfiguration: default, privateEndpointConnections: default, publicNetworkAccess: default, diskEncryptionKeyVaultConfiguration: default); } } } diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/BuildResource.Serialization.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/BuildResource.Serialization.cs new file mode 100644 index 000000000000..78f37e5c8cbd --- /dev/null +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/BuildResource.Serialization.cs @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; + +namespace Azure.ResourceManager.AppContainers +{ + public partial class BuildResource : IJsonModel + { + private static BuildResourceData s_dataDeserializationInstance; + private static BuildResourceData DataDeserializationInstance => s_dataDeserializationInstance ??= new(); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); + + BuildResourceData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)DataDeserializationInstance).Create(ref reader, options); + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options, AzureResourceManagerAppContainersContext.Default); + + BuildResourceData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options, AzureResourceManagerAppContainersContext.Default); + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)DataDeserializationInstance).GetFormatFromOptions(options); + } +} diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/BuildResource.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/BuildResource.cs new file mode 100644 index 000000000000..c1838fbf4998 --- /dev/null +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/BuildResource.cs @@ -0,0 +1,420 @@ +// 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.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.AppContainers.Models; + +namespace Azure.ResourceManager.AppContainers +{ + /// + /// A Class representing a BuildResource 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 GetBuildResource method. + /// Otherwise you can get one from its parent resource using the GetBuildResource method. + /// + public partial class BuildResource : ArmResource + { + /// Generate the resource identifier of a instance. + /// The subscriptionId. + /// The resourceGroupName. + /// The builderName. + /// The buildName. + public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string builderName, string buildName) + { + var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/builders/{builderName}/builds/{buildName}"; + return new ResourceIdentifier(resourceId); + } + + private readonly ClientDiagnostics _buildResourceBuildsClientDiagnostics; + private readonly BuildsRestOperations _buildResourceBuildsRestClient; + private readonly ClientDiagnostics _buildAuthTokenClientDiagnostics; + private readonly BuildAuthTokenRestOperations _buildAuthTokenRestClient; + private readonly BuildResourceData _data; + + /// Gets the resource type for the operations. + public static readonly ResourceType ResourceType = "Microsoft.App/builders/builds"; + + /// Initializes a new instance of the class for mocking. + protected BuildResource() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The resource that is the target of operations. + internal BuildResource(ArmClient client, BuildResourceData 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 BuildResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _buildResourceBuildsClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.AppContainers", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string buildResourceBuildsApiVersion); + _buildResourceBuildsRestClient = new BuildsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, buildResourceBuildsApiVersion); + _buildAuthTokenClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.AppContainers", ProviderConstants.DefaultProviderNamespace, Diagnostics); + _buildAuthTokenRestClient = new BuildAuthTokenRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + /// 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 BuildResourceData 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 a BuildResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/builders/{builderName}/builds/{buildName} + /// + /// + /// Operation Id + /// Builds_Get + /// + /// + /// Default Api Version + /// 2025-02-02-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + { + using var scope = _buildResourceBuildsClientDiagnostics.CreateScope("BuildResource.Get"); + scope.Start(); + try + { + var response = await _buildResourceBuildsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new BuildResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a BuildResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/builders/{builderName}/builds/{buildName} + /// + /// + /// Operation Id + /// Builds_Get + /// + /// + /// Default Api Version + /// 2025-02-02-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual Response Get(CancellationToken cancellationToken = default) + { + using var scope = _buildResourceBuildsClientDiagnostics.CreateScope("BuildResource.Get"); + scope.Start(); + try + { + var response = _buildResourceBuildsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new BuildResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Delete a BuildResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/builders/{builderName}/builds/{buildName} + /// + /// + /// Operation Id + /// Builds_Delete + /// + /// + /// Default Api Version + /// 2025-02-02-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// 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 = _buildResourceBuildsClientDiagnostics.CreateScope("BuildResource.Delete"); + scope.Start(); + try + { + var response = await _buildResourceBuildsRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + var operation = new AppContainersArmOperation(_buildResourceBuildsClientDiagnostics, Pipeline, _buildResourceBuildsRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, 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; + } + } + + /// + /// Delete a BuildResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/builders/{builderName}/builds/{buildName} + /// + /// + /// Operation Id + /// Builds_Delete + /// + /// + /// Default Api Version + /// 2025-02-02-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// 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 = _buildResourceBuildsClientDiagnostics.CreateScope("BuildResource.Delete"); + scope.Start(); + try + { + var response = _buildResourceBuildsRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + var operation = new AppContainersArmOperation(_buildResourceBuildsClientDiagnostics, Pipeline, _buildResourceBuildsRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletionResponse(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Create a BuildResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/builders/{builderName}/builds/{buildName} + /// + /// + /// Operation Id + /// Builds_CreateOrUpdate + /// + /// + /// Default Api Version + /// 2025-02-02-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// 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. + /// Resource create or update parameters. + /// The cancellation token to use. + /// is null. + public virtual async Task> UpdateAsync(WaitUntil waitUntil, BuildResourceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _buildResourceBuildsClientDiagnostics.CreateScope("BuildResource.Update"); + scope.Start(); + try + { + var response = await _buildResourceBuildsRestClient.CreateOrUpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, cancellationToken).ConfigureAwait(false); + var operation = new AppContainersArmOperation(new BuildResourceOperationSource(Client), _buildResourceBuildsClientDiagnostics, Pipeline, _buildResourceBuildsRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Create a BuildResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/builders/{builderName}/builds/{buildName} + /// + /// + /// Operation Id + /// Builds_CreateOrUpdate + /// + /// + /// Default Api Version + /// 2025-02-02-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// 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. + /// Resource create or update parameters. + /// The cancellation token to use. + /// is null. + public virtual ArmOperation Update(WaitUntil waitUntil, BuildResourceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _buildResourceBuildsClientDiagnostics.CreateScope("BuildResource.Update"); + scope.Start(); + try + { + var response = _buildResourceBuildsRestClient.CreateOrUpdate(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, cancellationToken); + var operation = new AppContainersArmOperation(new BuildResourceOperationSource(Client), _buildResourceBuildsClientDiagnostics, Pipeline, _buildResourceBuildsRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets the token used to connect to the endpoint where source code can be uploaded for a build. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/builders/{builderName}/builds/{buildName}/listAuthToken + /// + /// + /// Operation Id + /// BuildAuthToken_List + /// + /// + /// Default Api Version + /// 2025-02-02-preview + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> GetBuildAuthTokenAsync(CancellationToken cancellationToken = default) + { + using var scope = _buildAuthTokenClientDiagnostics.CreateScope("BuildResource.GetBuildAuthToken"); + scope.Start(); + try + { + var response = await _buildAuthTokenRestClient.ListAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + return response; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets the token used to connect to the endpoint where source code can be uploaded for a build. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/builders/{builderName}/builds/{buildName}/listAuthToken + /// + /// + /// Operation Id + /// BuildAuthToken_List + /// + /// + /// Default Api Version + /// 2025-02-02-preview + /// + /// + /// + /// The cancellation token to use. + public virtual Response GetBuildAuthToken(CancellationToken cancellationToken = default) + { + using var scope = _buildAuthTokenClientDiagnostics.CreateScope("BuildResource.GetBuildAuthToken"); + scope.Start(); + try + { + var response = _buildAuthTokenRestClient.List(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + return response; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/BuildResourceCollection.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/BuildResourceCollection.cs new file mode 100644 index 000000000000..7776874997e6 --- /dev/null +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/BuildResourceCollection.cs @@ -0,0 +1,498 @@ +// 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 Autorest.CSharp.Core; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.AppContainers +{ + /// + /// 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 GetBuildResources method from an instance of . + /// + public partial class BuildResourceCollection : ArmCollection, IEnumerable, IAsyncEnumerable + { + private readonly ClientDiagnostics _buildResourceBuildsClientDiagnostics; + private readonly BuildsRestOperations _buildResourceBuildsRestClient; + private readonly ClientDiagnostics _buildResourceBuildsByBuilderResourceClientDiagnostics; + private readonly BuildsByBuilderResourceRestOperations _buildResourceBuildsByBuilderResourceRestClient; + + /// Initializes a new instance of the class for mocking. + protected BuildResourceCollection() + { + } + + /// 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 BuildResourceCollection(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _buildResourceBuildsClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.AppContainers", BuildResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(BuildResource.ResourceType, out string buildResourceBuildsApiVersion); + _buildResourceBuildsRestClient = new BuildsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, buildResourceBuildsApiVersion); + _buildResourceBuildsByBuilderResourceClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.AppContainers", BuildResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(BuildResource.ResourceType, out string buildResourceBuildsByBuilderResourceApiVersion); + _buildResourceBuildsByBuilderResourceRestClient = new BuildsByBuilderResourceRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, buildResourceBuildsByBuilderResourceApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != BuilderResource.ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, BuilderResource.ResourceType), nameof(id)); + } + + /// + /// Create a BuildResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/builders/{builderName}/builds/{buildName} + /// + /// + /// Operation Id + /// Builds_CreateOrUpdate + /// + /// + /// Default Api Version + /// 2025-02-02-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// 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 name of a build. + /// Resource create or update parameters. + /// 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 buildName, BuildResourceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(buildName, nameof(buildName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _buildResourceBuildsClientDiagnostics.CreateScope("BuildResourceCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = await _buildResourceBuildsRestClient.CreateOrUpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, buildName, data, cancellationToken).ConfigureAwait(false); + var operation = new AppContainersArmOperation(new BuildResourceOperationSource(Client), _buildResourceBuildsClientDiagnostics, Pipeline, _buildResourceBuildsRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, buildName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Create a BuildResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/builders/{builderName}/builds/{buildName} + /// + /// + /// Operation Id + /// Builds_CreateOrUpdate + /// + /// + /// Default Api Version + /// 2025-02-02-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// 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 name of a build. + /// Resource create or update parameters. + /// 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 buildName, BuildResourceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(buildName, nameof(buildName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _buildResourceBuildsClientDiagnostics.CreateScope("BuildResourceCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = _buildResourceBuildsRestClient.CreateOrUpdate(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, buildName, data, cancellationToken); + var operation = new AppContainersArmOperation(new BuildResourceOperationSource(Client), _buildResourceBuildsClientDiagnostics, Pipeline, _buildResourceBuildsRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, buildName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a BuildResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/builders/{builderName}/builds/{buildName} + /// + /// + /// Operation Id + /// Builds_Get + /// + /// + /// Default Api Version + /// 2025-02-02-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of a build. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetAsync(string buildName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(buildName, nameof(buildName)); + + using var scope = _buildResourceBuildsClientDiagnostics.CreateScope("BuildResourceCollection.Get"); + scope.Start(); + try + { + var response = await _buildResourceBuildsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, buildName, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new BuildResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a BuildResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/builders/{builderName}/builds/{buildName} + /// + /// + /// Operation Id + /// Builds_Get + /// + /// + /// Default Api Version + /// 2025-02-02-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of a build. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Get(string buildName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(buildName, nameof(buildName)); + + using var scope = _buildResourceBuildsClientDiagnostics.CreateScope("BuildResourceCollection.Get"); + scope.Start(); + try + { + var response = _buildResourceBuildsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, buildName, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new BuildResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// List BuildResource resources by BuilderResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/builders/{builderName}/builds + /// + /// + /// Operation Id + /// BuildsByBuilderResource_List + /// + /// + /// Default Api Version + /// 2025-02-02-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// 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) => _buildResourceBuildsByBuilderResourceRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _buildResourceBuildsByBuilderResourceRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new BuildResource(Client, BuildResourceData.DeserializeBuildResourceData(e)), _buildResourceBuildsByBuilderResourceClientDiagnostics, Pipeline, "BuildResourceCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// List BuildResource resources by BuilderResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/builders/{builderName}/builds + /// + /// + /// Operation Id + /// BuildsByBuilderResource_List + /// + /// + /// Default Api Version + /// 2025-02-02-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// 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) => _buildResourceBuildsByBuilderResourceRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _buildResourceBuildsByBuilderResourceRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new BuildResource(Client, BuildResourceData.DeserializeBuildResourceData(e)), _buildResourceBuildsByBuilderResourceClientDiagnostics, Pipeline, "BuildResourceCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/builders/{builderName}/builds/{buildName} + /// + /// + /// Operation Id + /// Builds_Get + /// + /// + /// Default Api Version + /// 2025-02-02-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of a build. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> ExistsAsync(string buildName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(buildName, nameof(buildName)); + + using var scope = _buildResourceBuildsClientDiagnostics.CreateScope("BuildResourceCollection.Exists"); + scope.Start(); + try + { + var response = await _buildResourceBuildsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, buildName, 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.App/builders/{builderName}/builds/{buildName} + /// + /// + /// Operation Id + /// Builds_Get + /// + /// + /// Default Api Version + /// 2025-02-02-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of a build. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Exists(string buildName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(buildName, nameof(buildName)); + + using var scope = _buildResourceBuildsClientDiagnostics.CreateScope("BuildResourceCollection.Exists"); + scope.Start(); + try + { + var response = _buildResourceBuildsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, buildName, cancellationToken: cancellationToken); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/builders/{builderName}/builds/{buildName} + /// + /// + /// Operation Id + /// Builds_Get + /// + /// + /// Default Api Version + /// 2025-02-02-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of a build. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetIfExistsAsync(string buildName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(buildName, nameof(buildName)); + + using var scope = _buildResourceBuildsClientDiagnostics.CreateScope("BuildResourceCollection.GetIfExists"); + scope.Start(); + try + { + var response = await _buildResourceBuildsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, buildName, cancellationToken: cancellationToken).ConfigureAwait(false); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new BuildResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/builders/{builderName}/builds/{buildName} + /// + /// + /// Operation Id + /// Builds_Get + /// + /// + /// Default Api Version + /// 2025-02-02-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of a build. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual NullableResponse GetIfExists(string buildName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(buildName, nameof(buildName)); + + using var scope = _buildResourceBuildsClientDiagnostics.CreateScope("BuildResourceCollection.GetIfExists"); + scope.Start(); + try + { + var response = _buildResourceBuildsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, buildName, cancellationToken: cancellationToken); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new BuildResource(Client, response.Value), 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/containerapps/Azure.ResourceManager.AppContainers/src/Generated/BuildResourceData.Serialization.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/BuildResourceData.Serialization.cs new file mode 100644 index 000000000000..4ec505e6b3ff --- /dev/null +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/BuildResourceData.Serialization.cs @@ -0,0 +1,457 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text; +using System.Text.Json; +using Azure.Core; +using Azure.ResourceManager.AppContainers.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.AppContainers +{ + public partial class BuildResourceData : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(BuildResourceData)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + writer.WritePropertyName("properties"u8); + writer.WriteStartObject(); + if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) + { + writer.WritePropertyName("provisioningState"u8); + writer.WriteStringValue(ProvisioningState.Value.ToString()); + } + if (options.Format != "W" && Optional.IsDefined(BuildStatus)) + { + writer.WritePropertyName("buildStatus"u8); + writer.WriteStringValue(BuildStatus.Value.ToString()); + } + if (Optional.IsDefined(DestinationContainerRegistry)) + { + writer.WritePropertyName("destinationContainerRegistry"u8); + writer.WriteObjectValue(DestinationContainerRegistry, options); + } + if (Optional.IsDefined(Configuration)) + { + writer.WritePropertyName("configuration"u8); + writer.WriteObjectValue(Configuration, options); + } + if (options.Format != "W" && Optional.IsDefined(UploadEndpoint)) + { + writer.WritePropertyName("uploadEndpoint"u8); + writer.WriteStringValue(UploadEndpoint); + } + if (options.Format != "W" && Optional.IsDefined(LogStreamEndpoint)) + { + writer.WritePropertyName("logStreamEndpoint"u8); + writer.WriteStringValue(LogStreamEndpoint); + } + if (options.Format != "W" && Optional.IsDefined(TokenEndpoint)) + { + writer.WritePropertyName("tokenEndpoint"u8); + writer.WriteStringValue(TokenEndpoint); + } + writer.WriteEndObject(); + } + + BuildResourceData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(BuildResourceData)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeBuildResourceData(document.RootElement, options); + } + + internal static BuildResourceData DeserializeBuildResourceData(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ResourceIdentifier id = default; + string name = default; + ResourceType type = default; + SystemData systemData = default; + ContainerAppBuildProvisioningState? provisioningState = default; + ContainerAppBuildStatus? buildStatus = default; + ContainerRegistryWithCustomImage destinationContainerRegistry = default; + ContainerAppBuildConfiguration configuration = default; + string uploadEndpoint = default; + string logStreamEndpoint = default; + string tokenEndpoint = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + 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.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + systemData = JsonSerializer.Deserialize(property.Value.GetRawText()); + continue; + } + if (property.NameEquals("properties"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + foreach (var property0 in property.Value.EnumerateObject()) + { + if (property0.NameEquals("provisioningState"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + provisioningState = new ContainerAppBuildProvisioningState(property0.Value.GetString()); + continue; + } + if (property0.NameEquals("buildStatus"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + buildStatus = new ContainerAppBuildStatus(property0.Value.GetString()); + continue; + } + if (property0.NameEquals("destinationContainerRegistry"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + destinationContainerRegistry = ContainerRegistryWithCustomImage.DeserializeContainerRegistryWithCustomImage(property0.Value, options); + continue; + } + if (property0.NameEquals("configuration"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + configuration = ContainerAppBuildConfiguration.DeserializeContainerAppBuildConfiguration(property0.Value, options); + continue; + } + if (property0.NameEquals("uploadEndpoint"u8)) + { + uploadEndpoint = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("logStreamEndpoint"u8)) + { + logStreamEndpoint = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("tokenEndpoint"u8)) + { + tokenEndpoint = property0.Value.GetString(); + continue; + } + } + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new BuildResourceData( + id, + name, + type, + systemData, + provisioningState, + buildStatus, + destinationContainerRegistry, + configuration, + uploadEndpoint, + logStreamEndpoint, + tokenEndpoint, + serializedAdditionalRawData); + } + + private BinaryData SerializeBicep(ModelReaderWriterOptions options) + { + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Name), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" name: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Name)) + { + builder.Append(" name: "); + if (Name.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{Name}'''"); + } + else + { + builder.AppendLine($"'{Name}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Id), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" id: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Id)) + { + builder.Append(" id: "); + builder.AppendLine($"'{Id.ToString()}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(SystemData), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" systemData: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(SystemData)) + { + builder.Append(" systemData: "); + builder.AppendLine($"'{SystemData.ToString()}'"); + } + } + + builder.Append(" properties:"); + builder.AppendLine(" {"); + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(ProvisioningState), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" provisioningState: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(ProvisioningState)) + { + builder.Append(" provisioningState: "); + builder.AppendLine($"'{ProvisioningState.Value.ToString()}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(BuildStatus), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" buildStatus: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(BuildStatus)) + { + builder.Append(" buildStatus: "); + builder.AppendLine($"'{BuildStatus.Value.ToString()}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(DestinationContainerRegistry), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" destinationContainerRegistry: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(DestinationContainerRegistry)) + { + builder.Append(" destinationContainerRegistry: "); + BicepSerializationHelpers.AppendChildObject(builder, DestinationContainerRegistry, options, 4, false, " destinationContainerRegistry: "); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Configuration), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" configuration: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Configuration)) + { + builder.Append(" configuration: "); + BicepSerializationHelpers.AppendChildObject(builder, Configuration, options, 4, false, " configuration: "); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(UploadEndpoint), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" uploadEndpoint: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(UploadEndpoint)) + { + builder.Append(" uploadEndpoint: "); + if (UploadEndpoint.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{UploadEndpoint}'''"); + } + else + { + builder.AppendLine($"'{UploadEndpoint}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(LogStreamEndpoint), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" logStreamEndpoint: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(LogStreamEndpoint)) + { + builder.Append(" logStreamEndpoint: "); + if (LogStreamEndpoint.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{LogStreamEndpoint}'''"); + } + else + { + builder.AppendLine($"'{LogStreamEndpoint}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(TokenEndpoint), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" tokenEndpoint: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(TokenEndpoint)) + { + builder.Append(" tokenEndpoint: "); + if (TokenEndpoint.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{TokenEndpoint}'''"); + } + else + { + builder.AppendLine($"'{TokenEndpoint}'"); + } + } + } + + builder.AppendLine(" }"); + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerAppContainersContext.Default); + case "bicep": + return SerializeBicep(options); + default: + throw new FormatException($"The model {nameof(BuildResourceData)} does not support writing '{options.Format}' format."); + } + } + + BuildResourceData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeBuildResourceData(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(BuildResourceData)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/BuildResourceData.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/BuildResourceData.cs new file mode 100644 index 000000000000..51c01e686b6d --- /dev/null +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/BuildResourceData.cs @@ -0,0 +1,106 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; +using Azure.ResourceManager.AppContainers.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.AppContainers +{ + /// + /// A class representing the BuildResource data model. + /// Information pertaining to an individual build. + /// + public partial class BuildResourceData : ResourceData + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public BuildResourceData() + { + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// Build provisioning state. + /// Status of the build once it has been provisioned. + /// Container registry that the final image will be uploaded to. + /// Configuration of the build. + /// Endpoint to which the source code should be uploaded. + /// Endpoint from which the build logs can be streamed. + /// Endpoint to use to retrieve an authentication token for log streaming and uploading source code. + /// Keeps track of any properties unknown to the library. + internal BuildResourceData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, ContainerAppBuildProvisioningState? provisioningState, ContainerAppBuildStatus? buildStatus, ContainerRegistryWithCustomImage destinationContainerRegistry, ContainerAppBuildConfiguration configuration, string uploadEndpoint, string logStreamEndpoint, string tokenEndpoint, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) + { + ProvisioningState = provisioningState; + BuildStatus = buildStatus; + DestinationContainerRegistry = destinationContainerRegistry; + Configuration = configuration; + UploadEndpoint = uploadEndpoint; + LogStreamEndpoint = logStreamEndpoint; + TokenEndpoint = tokenEndpoint; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Build provisioning state. + [WirePath("properties.provisioningState")] + public ContainerAppBuildProvisioningState? ProvisioningState { get; } + /// Status of the build once it has been provisioned. + [WirePath("properties.buildStatus")] + public ContainerAppBuildStatus? BuildStatus { get; } + /// Container registry that the final image will be uploaded to. + [WirePath("properties.destinationContainerRegistry")] + public ContainerRegistryWithCustomImage DestinationContainerRegistry { get; set; } + /// Configuration of the build. + [WirePath("properties.configuration")] + public ContainerAppBuildConfiguration Configuration { get; set; } + /// Endpoint to which the source code should be uploaded. + [WirePath("properties.uploadEndpoint")] + public string UploadEndpoint { get; } + /// Endpoint from which the build logs can be streamed. + [WirePath("properties.logStreamEndpoint")] + public string LogStreamEndpoint { get; } + /// Endpoint to use to retrieve an authentication token for log streaming and uploading source code. + [WirePath("properties.tokenEndpoint")] + public string TokenEndpoint { get; } + } +} diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/BuilderResource.Serialization.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/BuilderResource.Serialization.cs new file mode 100644 index 000000000000..191edc363da4 --- /dev/null +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/BuilderResource.Serialization.cs @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; + +namespace Azure.ResourceManager.AppContainers +{ + public partial class BuilderResource : IJsonModel + { + private static BuilderResourceData s_dataDeserializationInstance; + private static BuilderResourceData DataDeserializationInstance => s_dataDeserializationInstance ??= new(); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); + + BuilderResourceData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)DataDeserializationInstance).Create(ref reader, options); + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options, AzureResourceManagerAppContainersContext.Default); + + BuilderResourceData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options, AzureResourceManagerAppContainersContext.Default); + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)DataDeserializationInstance).GetFormatFromOptions(options); + } +} diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/BuilderResource.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/BuilderResource.cs new file mode 100644 index 000000000000..819db6594474 --- /dev/null +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/BuilderResource.cs @@ -0,0 +1,776 @@ +// 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.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.AppContainers.Models; +using Azure.ResourceManager.Resources; + +namespace Azure.ResourceManager.AppContainers +{ + /// + /// A Class representing a BuilderResource 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 GetBuilderResource method. + /// Otherwise you can get one from its parent resource using the GetBuilderResource method. + /// + public partial class BuilderResource : ArmResource + { + /// Generate the resource identifier of a instance. + /// The subscriptionId. + /// The resourceGroupName. + /// The builderName. + public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string builderName) + { + var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/builders/{builderName}"; + return new ResourceIdentifier(resourceId); + } + + private readonly ClientDiagnostics _builderResourceBuildersClientDiagnostics; + private readonly BuildersRestOperations _builderResourceBuildersRestClient; + private readonly BuilderResourceData _data; + + /// Gets the resource type for the operations. + public static readonly ResourceType ResourceType = "Microsoft.App/builders"; + + /// Initializes a new instance of the class for mocking. + protected BuilderResource() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The resource that is the target of operations. + internal BuilderResource(ArmClient client, BuilderResourceData 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 BuilderResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _builderResourceBuildersClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.AppContainers", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string builderResourceBuildersApiVersion); + _builderResourceBuildersRestClient = new BuildersRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, builderResourceBuildersApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + /// 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 BuilderResourceData 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 BuildResources in the BuilderResource. + /// An object representing collection of BuildResources and their operations over a BuildResource. + public virtual BuildResourceCollection GetBuildResources() + { + return GetCachedClient(client => new BuildResourceCollection(client, Id)); + } + + /// + /// Get a BuildResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/builders/{builderName}/builds/{buildName} + /// + /// + /// Operation Id + /// Builds_Get + /// + /// + /// Default Api Version + /// 2025-02-02-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of a build. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetBuildResourceAsync(string buildName, CancellationToken cancellationToken = default) + { + return await GetBuildResources().GetAsync(buildName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get a BuildResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/builders/{builderName}/builds/{buildName} + /// + /// + /// Operation Id + /// Builds_Get + /// + /// + /// Default Api Version + /// 2025-02-02-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of a build. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetBuildResource(string buildName, CancellationToken cancellationToken = default) + { + return GetBuildResources().Get(buildName, cancellationToken); + } + + /// + /// Get a BuilderResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/builders/{builderName} + /// + /// + /// Operation Id + /// Builders_Get + /// + /// + /// Default Api Version + /// 2025-02-02-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + { + using var scope = _builderResourceBuildersClientDiagnostics.CreateScope("BuilderResource.Get"); + scope.Start(); + try + { + var response = await _builderResourceBuildersRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new BuilderResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a BuilderResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/builders/{builderName} + /// + /// + /// Operation Id + /// Builders_Get + /// + /// + /// Default Api Version + /// 2025-02-02-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual Response Get(CancellationToken cancellationToken = default) + { + using var scope = _builderResourceBuildersClientDiagnostics.CreateScope("BuilderResource.Get"); + scope.Start(); + try + { + var response = _builderResourceBuildersRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new BuilderResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Delete a BuilderResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/builders/{builderName} + /// + /// + /// Operation Id + /// Builders_Delete + /// + /// + /// Default Api Version + /// 2025-02-02-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// 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 = _builderResourceBuildersClientDiagnostics.CreateScope("BuilderResource.Delete"); + scope.Start(); + try + { + var response = await _builderResourceBuildersRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + var operation = new AppContainersArmOperation(_builderResourceBuildersClientDiagnostics, Pipeline, _builderResourceBuildersRestClient.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; + } + } + + /// + /// Delete a BuilderResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/builders/{builderName} + /// + /// + /// Operation Id + /// Builders_Delete + /// + /// + /// Default Api Version + /// 2025-02-02-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// 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 = _builderResourceBuildersClientDiagnostics.CreateScope("BuilderResource.Delete"); + scope.Start(); + try + { + var response = _builderResourceBuildersRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + var operation = new AppContainersArmOperation(_builderResourceBuildersClientDiagnostics, Pipeline, _builderResourceBuildersRestClient.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; + } + } + + /// + /// Update a BuilderResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/builders/{builderName} + /// + /// + /// Operation Id + /// Builders_Update + /// + /// + /// Default Api Version + /// 2025-02-02-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// 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 resource properties to be updated. + /// The cancellation token to use. + /// is null. + public virtual async Task> UpdateAsync(WaitUntil waitUntil, BuilderResourcePatch patch, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(patch, nameof(patch)); + + using var scope = _builderResourceBuildersClientDiagnostics.CreateScope("BuilderResource.Update"); + scope.Start(); + try + { + var response = await _builderResourceBuildersRestClient.UpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, patch, cancellationToken).ConfigureAwait(false); + var operation = new AppContainersArmOperation(new BuilderResourceOperationSource(Client), _builderResourceBuildersClientDiagnostics, Pipeline, _builderResourceBuildersRestClient.CreateUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, patch).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Update a BuilderResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/builders/{builderName} + /// + /// + /// Operation Id + /// Builders_Update + /// + /// + /// Default Api Version + /// 2025-02-02-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// 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 resource properties to be updated. + /// The cancellation token to use. + /// is null. + public virtual ArmOperation Update(WaitUntil waitUntil, BuilderResourcePatch patch, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(patch, nameof(patch)); + + using var scope = _builderResourceBuildersClientDiagnostics.CreateScope("BuilderResource.Update"); + scope.Start(); + try + { + var response = _builderResourceBuildersRestClient.Update(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, patch, cancellationToken); + var operation = new AppContainersArmOperation(new BuilderResourceOperationSource(Client), _builderResourceBuildersClientDiagnostics, Pipeline, _builderResourceBuildersRestClient.CreateUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, patch).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.App/builders/{builderName} + /// + /// + /// Operation Id + /// Builders_Get + /// + /// + /// Default Api Version + /// 2025-02-02-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// 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 = _builderResourceBuildersClientDiagnostics.CreateScope("BuilderResource.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 _builderResourceBuildersRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + return Response.FromValue(new BuilderResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; + var patch = new BuilderResourcePatch(); + foreach (var tag in current.Tags) + { + patch.Tags.Add(tag); + } + patch.Tags[key] = value; + var result = await UpdateAsync(WaitUntil.Completed, patch, 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.App/builders/{builderName} + /// + /// + /// Operation Id + /// Builders_Get + /// + /// + /// Default Api Version + /// 2025-02-02-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// 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 = _builderResourceBuildersClientDiagnostics.CreateScope("BuilderResource.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 = _builderResourceBuildersRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + return Response.FromValue(new BuilderResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = Get(cancellationToken: cancellationToken).Value.Data; + var patch = new BuilderResourcePatch(); + foreach (var tag in current.Tags) + { + patch.Tags.Add(tag); + } + patch.Tags[key] = value; + var result = Update(WaitUntil.Completed, patch, 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.App/builders/{builderName} + /// + /// + /// Operation Id + /// Builders_Get + /// + /// + /// Default Api Version + /// 2025-02-02-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// 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 = _builderResourceBuildersClientDiagnostics.CreateScope("BuilderResource.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 _builderResourceBuildersRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + return Response.FromValue(new BuilderResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; + var patch = new BuilderResourcePatch(); + patch.Tags.ReplaceWith(tags); + var result = await UpdateAsync(WaitUntil.Completed, patch, 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.App/builders/{builderName} + /// + /// + /// Operation Id + /// Builders_Get + /// + /// + /// Default Api Version + /// 2025-02-02-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// 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 = _builderResourceBuildersClientDiagnostics.CreateScope("BuilderResource.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 = _builderResourceBuildersRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + return Response.FromValue(new BuilderResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = Get(cancellationToken: cancellationToken).Value.Data; + var patch = new BuilderResourcePatch(); + patch.Tags.ReplaceWith(tags); + var result = Update(WaitUntil.Completed, patch, 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.App/builders/{builderName} + /// + /// + /// Operation Id + /// Builders_Get + /// + /// + /// Default Api Version + /// 2025-02-02-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// 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 = _builderResourceBuildersClientDiagnostics.CreateScope("BuilderResource.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 _builderResourceBuildersRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + return Response.FromValue(new BuilderResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; + var patch = new BuilderResourcePatch(); + foreach (var tag in current.Tags) + { + patch.Tags.Add(tag); + } + patch.Tags.Remove(key); + var result = await UpdateAsync(WaitUntil.Completed, patch, 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.App/builders/{builderName} + /// + /// + /// Operation Id + /// Builders_Get + /// + /// + /// Default Api Version + /// 2025-02-02-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// 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 = _builderResourceBuildersClientDiagnostics.CreateScope("BuilderResource.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 = _builderResourceBuildersRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + return Response.FromValue(new BuilderResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = Get(cancellationToken: cancellationToken).Value.Data; + var patch = new BuilderResourcePatch(); + foreach (var tag in current.Tags) + { + patch.Tags.Add(tag); + } + patch.Tags.Remove(key); + var result = Update(WaitUntil.Completed, patch, cancellationToken: cancellationToken); + return Response.FromValue(result.Value, result.GetRawResponse()); + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/BuilderResourceCollection.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/BuilderResourceCollection.cs new file mode 100644 index 000000000000..508ca869c499 --- /dev/null +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/BuilderResourceCollection.cs @@ -0,0 +1,494 @@ +// 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 Autorest.CSharp.Core; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.Resources; + +namespace Azure.ResourceManager.AppContainers +{ + /// + /// 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 GetBuilderResources method from an instance of . + /// + public partial class BuilderResourceCollection : ArmCollection, IEnumerable, IAsyncEnumerable + { + private readonly ClientDiagnostics _builderResourceBuildersClientDiagnostics; + private readonly BuildersRestOperations _builderResourceBuildersRestClient; + + /// Initializes a new instance of the class for mocking. + protected BuilderResourceCollection() + { + } + + /// 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 BuilderResourceCollection(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _builderResourceBuildersClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.AppContainers", BuilderResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(BuilderResource.ResourceType, out string builderResourceBuildersApiVersion); + _builderResourceBuildersRestClient = new BuildersRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, builderResourceBuildersApiVersion); +#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)); + } + + /// + /// Create or update a BuilderResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/builders/{builderName} + /// + /// + /// Operation Id + /// Builders_CreateOrUpdate + /// + /// + /// Default Api Version + /// 2025-02-02-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// 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 name of the builder. + /// Resource create parameters. + /// 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 builderName, BuilderResourceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(builderName, nameof(builderName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _builderResourceBuildersClientDiagnostics.CreateScope("BuilderResourceCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = await _builderResourceBuildersRestClient.CreateOrUpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, builderName, data, cancellationToken).ConfigureAwait(false); + var operation = new AppContainersArmOperation(new BuilderResourceOperationSource(Client), _builderResourceBuildersClientDiagnostics, Pipeline, _builderResourceBuildersRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, builderName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Create or update a BuilderResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/builders/{builderName} + /// + /// + /// Operation Id + /// Builders_CreateOrUpdate + /// + /// + /// Default Api Version + /// 2025-02-02-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// 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 name of the builder. + /// Resource create parameters. + /// 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 builderName, BuilderResourceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(builderName, nameof(builderName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _builderResourceBuildersClientDiagnostics.CreateScope("BuilderResourceCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = _builderResourceBuildersRestClient.CreateOrUpdate(Id.SubscriptionId, Id.ResourceGroupName, builderName, data, cancellationToken); + var operation = new AppContainersArmOperation(new BuilderResourceOperationSource(Client), _builderResourceBuildersClientDiagnostics, Pipeline, _builderResourceBuildersRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, builderName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a BuilderResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/builders/{builderName} + /// + /// + /// Operation Id + /// Builders_Get + /// + /// + /// Default Api Version + /// 2025-02-02-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the builder. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetAsync(string builderName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(builderName, nameof(builderName)); + + using var scope = _builderResourceBuildersClientDiagnostics.CreateScope("BuilderResourceCollection.Get"); + scope.Start(); + try + { + var response = await _builderResourceBuildersRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, builderName, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new BuilderResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a BuilderResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/builders/{builderName} + /// + /// + /// Operation Id + /// Builders_Get + /// + /// + /// Default Api Version + /// 2025-02-02-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the builder. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Get(string builderName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(builderName, nameof(builderName)); + + using var scope = _builderResourceBuildersClientDiagnostics.CreateScope("BuilderResourceCollection.Get"); + scope.Start(); + try + { + var response = _builderResourceBuildersRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, builderName, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new BuilderResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// List BuilderResource resources by resource group + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/builders + /// + /// + /// Operation Id + /// Builders_ListByResourceGroup + /// + /// + /// Default Api Version + /// 2025-02-02-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// 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) => _builderResourceBuildersRestClient.CreateListByResourceGroupRequest(Id.SubscriptionId, Id.ResourceGroupName); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _builderResourceBuildersRestClient.CreateListByResourceGroupNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new BuilderResource(Client, BuilderResourceData.DeserializeBuilderResourceData(e)), _builderResourceBuildersClientDiagnostics, Pipeline, "BuilderResourceCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// List BuilderResource resources by resource group + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/builders + /// + /// + /// Operation Id + /// Builders_ListByResourceGroup + /// + /// + /// Default Api Version + /// 2025-02-02-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// 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) => _builderResourceBuildersRestClient.CreateListByResourceGroupRequest(Id.SubscriptionId, Id.ResourceGroupName); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _builderResourceBuildersRestClient.CreateListByResourceGroupNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new BuilderResource(Client, BuilderResourceData.DeserializeBuilderResourceData(e)), _builderResourceBuildersClientDiagnostics, Pipeline, "BuilderResourceCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/builders/{builderName} + /// + /// + /// Operation Id + /// Builders_Get + /// + /// + /// Default Api Version + /// 2025-02-02-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the builder. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> ExistsAsync(string builderName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(builderName, nameof(builderName)); + + using var scope = _builderResourceBuildersClientDiagnostics.CreateScope("BuilderResourceCollection.Exists"); + scope.Start(); + try + { + var response = await _builderResourceBuildersRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, builderName, 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.App/builders/{builderName} + /// + /// + /// Operation Id + /// Builders_Get + /// + /// + /// Default Api Version + /// 2025-02-02-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the builder. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Exists(string builderName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(builderName, nameof(builderName)); + + using var scope = _builderResourceBuildersClientDiagnostics.CreateScope("BuilderResourceCollection.Exists"); + scope.Start(); + try + { + var response = _builderResourceBuildersRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, builderName, cancellationToken: cancellationToken); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/builders/{builderName} + /// + /// + /// Operation Id + /// Builders_Get + /// + /// + /// Default Api Version + /// 2025-02-02-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the builder. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetIfExistsAsync(string builderName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(builderName, nameof(builderName)); + + using var scope = _builderResourceBuildersClientDiagnostics.CreateScope("BuilderResourceCollection.GetIfExists"); + scope.Start(); + try + { + var response = await _builderResourceBuildersRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, builderName, cancellationToken: cancellationToken).ConfigureAwait(false); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new BuilderResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/builders/{builderName} + /// + /// + /// Operation Id + /// Builders_Get + /// + /// + /// Default Api Version + /// 2025-02-02-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the builder. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual NullableResponse GetIfExists(string builderName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(builderName, nameof(builderName)); + + using var scope = _builderResourceBuildersClientDiagnostics.CreateScope("BuilderResourceCollection.GetIfExists"); + scope.Start(); + try + { + var response = _builderResourceBuildersRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, builderName, cancellationToken: cancellationToken); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new BuilderResource(Client, response.Value), 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/containerapps/Azure.ResourceManager.AppContainers/src/Generated/BuilderResourceData.Serialization.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/BuilderResourceData.Serialization.cs new file mode 100644 index 000000000000..d429e4002601 --- /dev/null +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/BuilderResourceData.Serialization.cs @@ -0,0 +1,445 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Text.Json; +using Azure.Core; +using Azure.ResourceManager.AppContainers.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.AppContainers +{ + public partial class BuilderResourceData : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(BuilderResourceData)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + if (Optional.IsDefined(Identity)) + { + writer.WritePropertyName("identity"u8); + var serializeOptions = new JsonSerializerOptions { Converters = { new ManagedServiceIdentityTypeV3Converter() } }; + JsonSerializer.Serialize(writer, Identity, serializeOptions); + } + writer.WritePropertyName("properties"u8); + writer.WriteStartObject(); + if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) + { + writer.WritePropertyName("provisioningState"u8); + writer.WriteStringValue(ProvisioningState.Value.ToString()); + } + if (Optional.IsDefined(EnvironmentId)) + { + writer.WritePropertyName("environmentId"u8); + writer.WriteStringValue(EnvironmentId); + } + if (Optional.IsCollectionDefined(ContainerRegistries)) + { + writer.WritePropertyName("containerRegistries"u8); + writer.WriteStartArray(); + foreach (var item in ContainerRegistries) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + writer.WriteEndObject(); + } + + BuilderResourceData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(BuilderResourceData)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeBuilderResourceData(document.RootElement, options); + } + + internal static BuilderResourceData DeserializeBuilderResourceData(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ManagedServiceIdentity identity = default; + IDictionary tags = default; + AzureLocation location = default; + ResourceIdentifier id = default; + string name = default; + ResourceType type = default; + SystemData systemData = default; + ContainerAppBuilderProvisioningState? provisioningState = default; + ResourceIdentifier environmentId = default; + IList containerRegistries = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("identity"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + var serializeOptions = new JsonSerializerOptions { Converters = { new ManagedServiceIdentityTypeV3Converter() } }; + identity = JsonSerializer.Deserialize(property.Value.GetRawText(), serializeOptions); + continue; + } + if (property.NameEquals("tags"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + Dictionary dictionary = new Dictionary(); + foreach (var property0 in property.Value.EnumerateObject()) + { + dictionary.Add(property0.Name, property0.Value.GetString()); + } + tags = dictionary; + continue; + } + if (property.NameEquals("location"u8)) + { + location = new AzureLocation(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.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + systemData = JsonSerializer.Deserialize(property.Value.GetRawText()); + continue; + } + if (property.NameEquals("properties"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + foreach (var property0 in property.Value.EnumerateObject()) + { + if (property0.NameEquals("provisioningState"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + provisioningState = new ContainerAppBuilderProvisioningState(property0.Value.GetString()); + continue; + } + if (property0.NameEquals("environmentId"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + environmentId = new ResourceIdentifier(property0.Value.GetString()); + continue; + } + if (property0.NameEquals("containerRegistries"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property0.Value.EnumerateArray()) + { + array.Add(ContainerAppContainerRegistry.DeserializeContainerAppContainerRegistry(item, options)); + } + containerRegistries = array; + continue; + } + } + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new BuilderResourceData( + id, + name, + type, + systemData, + tags ?? new ChangeTrackingDictionary(), + location, + identity, + provisioningState, + environmentId, + containerRegistries ?? new ChangeTrackingList(), + serializedAdditionalRawData); + } + + private BinaryData SerializeBicep(ModelReaderWriterOptions options) + { + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Name), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" name: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Name)) + { + builder.Append(" name: "); + if (Name.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{Name}'''"); + } + else + { + builder.AppendLine($"'{Name}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Location), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" location: "); + builder.AppendLine(propertyOverride); + } + else + { + builder.Append(" location: "); + builder.AppendLine($"'{Location.ToString()}'"); + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Tags), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" tags: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsCollectionDefined(Tags)) + { + if (Tags.Any()) + { + builder.Append(" tags: "); + builder.AppendLine("{"); + foreach (var item in Tags) + { + builder.Append($" '{item.Key}': "); + if (item.Value == null) + { + builder.Append("null"); + continue; + } + if (item.Value.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{item.Value}'''"); + } + else + { + builder.AppendLine($"'{item.Value}'"); + } + } + builder.AppendLine(" }"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Identity), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" identity: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Identity)) + { + builder.Append(" identity: "); + BicepSerializationHelpers.AppendChildObject(builder, Identity, options, 2, false, " identity: "); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Id), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" id: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Id)) + { + builder.Append(" id: "); + builder.AppendLine($"'{Id.ToString()}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(SystemData), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" systemData: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(SystemData)) + { + builder.Append(" systemData: "); + builder.AppendLine($"'{SystemData.ToString()}'"); + } + } + + builder.Append(" properties:"); + builder.AppendLine(" {"); + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(ProvisioningState), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" provisioningState: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(ProvisioningState)) + { + builder.Append(" provisioningState: "); + builder.AppendLine($"'{ProvisioningState.Value.ToString()}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(EnvironmentId), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" environmentId: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(EnvironmentId)) + { + builder.Append(" environmentId: "); + builder.AppendLine($"'{EnvironmentId.ToString()}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(ContainerRegistries), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" containerRegistries: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsCollectionDefined(ContainerRegistries)) + { + if (ContainerRegistries.Any()) + { + builder.Append(" containerRegistries: "); + builder.AppendLine("["); + foreach (var item in ContainerRegistries) + { + BicepSerializationHelpers.AppendChildObject(builder, item, options, 6, true, " containerRegistries: "); + } + builder.AppendLine(" ]"); + } + } + } + + builder.AppendLine(" }"); + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerAppContainersContext.Default); + case "bicep": + return SerializeBicep(options); + default: + throw new FormatException($"The model {nameof(BuilderResourceData)} does not support writing '{options.Format}' format."); + } + } + + BuilderResourceData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeBuilderResourceData(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(BuilderResourceData)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/BuilderResourceData.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/BuilderResourceData.cs new file mode 100644 index 000000000000..8256d8af371e --- /dev/null +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/BuilderResourceData.cs @@ -0,0 +1,100 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; +using Azure.ResourceManager.AppContainers.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.AppContainers +{ + /// + /// A class representing the BuilderResource data model. + /// Information about the SourceToCloud builder resource. + /// + public partial class BuilderResourceData : TrackedResourceData + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The location. + public BuilderResourceData(AzureLocation location) : base(location) + { + ContainerRegistries = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The tags. + /// The location. + /// The managed service identities assigned to this resource. + /// Provisioning state of a builder resource. + /// Resource ID of the container apps environment that the builder is associated with. + /// List of mappings of container registries and the managed identity used to connect to it. + /// Keeps track of any properties unknown to the library. + internal BuilderResourceData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, ManagedServiceIdentity identity, ContainerAppBuilderProvisioningState? provisioningState, ResourceIdentifier environmentId, IList containerRegistries, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) + { + Identity = identity; + ProvisioningState = provisioningState; + EnvironmentId = environmentId; + ContainerRegistries = containerRegistries; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal BuilderResourceData() + { + } + + /// The managed service identities assigned to this resource. + [WirePath("identity")] + public ManagedServiceIdentity Identity { get; set; } + /// Provisioning state of a builder resource. + [WirePath("properties.provisioningState")] + public ContainerAppBuilderProvisioningState? ProvisioningState { get; } + /// Resource ID of the container apps environment that the builder is associated with. + [WirePath("properties.environmentId")] + public ResourceIdentifier EnvironmentId { get; set; } + /// List of mappings of container registries and the managed identity used to connect to it. + [WirePath("properties.containerRegistries")] + public IList ContainerRegistries { get; } + } +} diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/ContainerAppConnectedEnvironmentDaprComponentCollection.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/ConnectedEnvironmentDaprComponentCollection.cs similarity index 57% rename from sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/ContainerAppConnectedEnvironmentDaprComponentCollection.cs rename to sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/ConnectedEnvironmentDaprComponentCollection.cs index 305e1eb63a35..2ee72918db85 100644 --- a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/ContainerAppConnectedEnvironmentDaprComponentCollection.cs +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/ConnectedEnvironmentDaprComponentCollection.cs @@ -18,28 +18,28 @@ namespace Azure.ResourceManager.AppContainers { /// - /// 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 GetContainerAppConnectedEnvironmentDaprComponents method from an instance of . + /// 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 GetConnectedEnvironmentDaprComponents method from an instance of . /// - public partial class ContainerAppConnectedEnvironmentDaprComponentCollection : ArmCollection, IEnumerable, IAsyncEnumerable + public partial class ConnectedEnvironmentDaprComponentCollection : ArmCollection, IEnumerable, IAsyncEnumerable { - private readonly ClientDiagnostics _containerAppConnectedEnvironmentDaprComponentConnectedEnvironmentsDaprComponentsClientDiagnostics; - private readonly ConnectedEnvironmentsDaprComponentsRestOperations _containerAppConnectedEnvironmentDaprComponentConnectedEnvironmentsDaprComponentsRestClient; + private readonly ClientDiagnostics _connectedEnvironmentDaprComponentConnectedEnvironmentsDaprComponentsClientDiagnostics; + private readonly ConnectedEnvironmentsDaprComponentsRestOperations _connectedEnvironmentDaprComponentConnectedEnvironmentsDaprComponentsRestClient; - /// Initializes a new instance of the class for mocking. - protected ContainerAppConnectedEnvironmentDaprComponentCollection() + /// Initializes a new instance of the class for mocking. + protected ConnectedEnvironmentDaprComponentCollection() { } - /// Initializes a new instance of the class. + /// 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 ContainerAppConnectedEnvironmentDaprComponentCollection(ArmClient client, ResourceIdentifier id) : base(client, id) + internal ConnectedEnvironmentDaprComponentCollection(ArmClient client, ResourceIdentifier id) : base(client, id) { - _containerAppConnectedEnvironmentDaprComponentConnectedEnvironmentsDaprComponentsClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.AppContainers", ContainerAppConnectedEnvironmentDaprComponentResource.ResourceType.Namespace, Diagnostics); - TryGetApiVersion(ContainerAppConnectedEnvironmentDaprComponentResource.ResourceType, out string containerAppConnectedEnvironmentDaprComponentConnectedEnvironmentsDaprComponentsApiVersion); - _containerAppConnectedEnvironmentDaprComponentConnectedEnvironmentsDaprComponentsRestClient = new ConnectedEnvironmentsDaprComponentsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, containerAppConnectedEnvironmentDaprComponentConnectedEnvironmentsDaprComponentsApiVersion); + _connectedEnvironmentDaprComponentConnectedEnvironmentsDaprComponentsClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.AppContainers", ConnectedEnvironmentDaprComponentResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ConnectedEnvironmentDaprComponentResource.ResourceType, out string connectedEnvironmentDaprComponentConnectedEnvironmentsDaprComponentsApiVersion); + _connectedEnvironmentDaprComponentConnectedEnvironmentsDaprComponentsRestClient = new ConnectedEnvironmentsDaprComponentsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, connectedEnvironmentDaprComponentConnectedEnvironmentsDaprComponentsApiVersion); #if DEBUG ValidateResourceId(Id); #endif @@ -64,11 +64,11 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource - /// + /// /// /// /// @@ -78,19 +78,17 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// 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 componentName, ContainerAppDaprComponentData data, CancellationToken cancellationToken = default) + public virtual async Task> CreateOrUpdateAsync(WaitUntil waitUntil, string componentName, ConnectedEnvironmentDaprComponentData data, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(componentName, nameof(componentName)); Argument.AssertNotNull(data, nameof(data)); - using var scope = _containerAppConnectedEnvironmentDaprComponentConnectedEnvironmentsDaprComponentsClientDiagnostics.CreateScope("ContainerAppConnectedEnvironmentDaprComponentCollection.CreateOrUpdate"); + using var scope = _connectedEnvironmentDaprComponentConnectedEnvironmentsDaprComponentsClientDiagnostics.CreateScope("ConnectedEnvironmentDaprComponentCollection.CreateOrUpdate"); scope.Start(); try { - var response = await _containerAppConnectedEnvironmentDaprComponentConnectedEnvironmentsDaprComponentsRestClient.CreateOrUpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, componentName, data, cancellationToken).ConfigureAwait(false); - var uri = _containerAppConnectedEnvironmentDaprComponentConnectedEnvironmentsDaprComponentsRestClient.CreateCreateOrUpdateRequestUri(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, componentName, data); - var rehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(RequestMethod.Put, uri.ToUri(), uri.ToString(), "None", null, OperationFinalStateVia.OriginalUri.ToString()); - var operation = new AppContainersArmOperation(Response.FromValue(new ContainerAppConnectedEnvironmentDaprComponentResource(Client, response), response.GetRawResponse()), rehydrationToken); + var response = await _connectedEnvironmentDaprComponentConnectedEnvironmentsDaprComponentsRestClient.CreateOrUpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, componentName, data, cancellationToken).ConfigureAwait(false); + var operation = new AppContainersArmOperation(new ConnectedEnvironmentDaprComponentOperationSource(Client), _connectedEnvironmentDaprComponentConnectedEnvironmentsDaprComponentsClientDiagnostics, Pipeline, _connectedEnvironmentDaprComponentConnectedEnvironmentsDaprComponentsRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, componentName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); if (waitUntil == WaitUntil.Completed) await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); return operation; @@ -115,11 +113,11 @@ public virtual async Task /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource - /// + /// /// /// /// @@ -129,19 +127,17 @@ public virtual async Task 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 componentName, ContainerAppDaprComponentData data, CancellationToken cancellationToken = default) + public virtual ArmOperation CreateOrUpdate(WaitUntil waitUntil, string componentName, ConnectedEnvironmentDaprComponentData data, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(componentName, nameof(componentName)); Argument.AssertNotNull(data, nameof(data)); - using var scope = _containerAppConnectedEnvironmentDaprComponentConnectedEnvironmentsDaprComponentsClientDiagnostics.CreateScope("ContainerAppConnectedEnvironmentDaprComponentCollection.CreateOrUpdate"); + using var scope = _connectedEnvironmentDaprComponentConnectedEnvironmentsDaprComponentsClientDiagnostics.CreateScope("ConnectedEnvironmentDaprComponentCollection.CreateOrUpdate"); scope.Start(); try { - var response = _containerAppConnectedEnvironmentDaprComponentConnectedEnvironmentsDaprComponentsRestClient.CreateOrUpdate(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, componentName, data, cancellationToken); - var uri = _containerAppConnectedEnvironmentDaprComponentConnectedEnvironmentsDaprComponentsRestClient.CreateCreateOrUpdateRequestUri(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, componentName, data); - var rehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(RequestMethod.Put, uri.ToUri(), uri.ToString(), "None", null, OperationFinalStateVia.OriginalUri.ToString()); - var operation = new AppContainersArmOperation(Response.FromValue(new ContainerAppConnectedEnvironmentDaprComponentResource(Client, response), response.GetRawResponse()), rehydrationToken); + var response = _connectedEnvironmentDaprComponentConnectedEnvironmentsDaprComponentsRestClient.CreateOrUpdate(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, componentName, data, cancellationToken); + var operation = new AppContainersArmOperation(new ConnectedEnvironmentDaprComponentOperationSource(Client), _connectedEnvironmentDaprComponentConnectedEnvironmentsDaprComponentsClientDiagnostics, Pipeline, _connectedEnvironmentDaprComponentConnectedEnvironmentsDaprComponentsRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, componentName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); if (waitUntil == WaitUntil.Completed) operation.WaitForCompletion(cancellationToken); return operation; @@ -166,11 +162,11 @@ public virtual ArmOperation /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource - /// + /// /// /// /// @@ -178,18 +174,18 @@ public virtual ArmOperation The cancellation token to use. /// is an empty string, and was expected to be non-empty. /// is null. - public virtual async Task> GetAsync(string componentName, CancellationToken cancellationToken = default) + public virtual async Task> GetAsync(string componentName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(componentName, nameof(componentName)); - using var scope = _containerAppConnectedEnvironmentDaprComponentConnectedEnvironmentsDaprComponentsClientDiagnostics.CreateScope("ContainerAppConnectedEnvironmentDaprComponentCollection.Get"); + using var scope = _connectedEnvironmentDaprComponentConnectedEnvironmentsDaprComponentsClientDiagnostics.CreateScope("ConnectedEnvironmentDaprComponentCollection.Get"); scope.Start(); try { - var response = await _containerAppConnectedEnvironmentDaprComponentConnectedEnvironmentsDaprComponentsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, componentName, cancellationToken).ConfigureAwait(false); + var response = await _connectedEnvironmentDaprComponentConnectedEnvironmentsDaprComponentsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, componentName, cancellationToken).ConfigureAwait(false); if (response.Value == null) throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new ContainerAppConnectedEnvironmentDaprComponentResource(Client, response.Value), response.GetRawResponse()); + return Response.FromValue(new ConnectedEnvironmentDaprComponentResource(Client, response.Value), response.GetRawResponse()); } catch (Exception e) { @@ -211,11 +207,11 @@ public virtual async Task /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource - /// + /// /// /// /// @@ -223,18 +219,18 @@ public virtual async Task The cancellation token to use. /// is an empty string, and was expected to be non-empty. /// is null. - public virtual Response Get(string componentName, CancellationToken cancellationToken = default) + public virtual Response Get(string componentName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(componentName, nameof(componentName)); - using var scope = _containerAppConnectedEnvironmentDaprComponentConnectedEnvironmentsDaprComponentsClientDiagnostics.CreateScope("ContainerAppConnectedEnvironmentDaprComponentCollection.Get"); + using var scope = _connectedEnvironmentDaprComponentConnectedEnvironmentsDaprComponentsClientDiagnostics.CreateScope("ConnectedEnvironmentDaprComponentCollection.Get"); scope.Start(); try { - var response = _containerAppConnectedEnvironmentDaprComponentConnectedEnvironmentsDaprComponentsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, componentName, cancellationToken); + var response = _connectedEnvironmentDaprComponentConnectedEnvironmentsDaprComponentsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, componentName, cancellationToken); if (response.Value == null) throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new ContainerAppConnectedEnvironmentDaprComponentResource(Client, response.Value), response.GetRawResponse()); + return Response.FromValue(new ConnectedEnvironmentDaprComponentResource(Client, response.Value), response.GetRawResponse()); } catch (Exception e) { @@ -256,21 +252,21 @@ public virtual Response G /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource - /// + /// /// /// /// /// 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) + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetAllAsync(CancellationToken cancellationToken = default) { - HttpMessage FirstPageRequest(int? pageSizeHint) => _containerAppConnectedEnvironmentDaprComponentConnectedEnvironmentsDaprComponentsRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _containerAppConnectedEnvironmentDaprComponentConnectedEnvironmentsDaprComponentsRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new ContainerAppConnectedEnvironmentDaprComponentResource(Client, ContainerAppDaprComponentData.DeserializeContainerAppDaprComponentData(e)), _containerAppConnectedEnvironmentDaprComponentConnectedEnvironmentsDaprComponentsClientDiagnostics, Pipeline, "ContainerAppConnectedEnvironmentDaprComponentCollection.GetAll", "value", "nextLink", cancellationToken); + HttpMessage FirstPageRequest(int? pageSizeHint) => _connectedEnvironmentDaprComponentConnectedEnvironmentsDaprComponentsRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _connectedEnvironmentDaprComponentConnectedEnvironmentsDaprComponentsRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new ConnectedEnvironmentDaprComponentResource(Client, ConnectedEnvironmentDaprComponentData.DeserializeConnectedEnvironmentDaprComponentData(e)), _connectedEnvironmentDaprComponentConnectedEnvironmentsDaprComponentsClientDiagnostics, Pipeline, "ConnectedEnvironmentDaprComponentCollection.GetAll", "value", "nextLink", cancellationToken); } /// @@ -286,21 +282,21 @@ public virtual AsyncPageable /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource - /// + /// /// /// /// /// The cancellation token to use. - /// A collection of that may take multiple service requests to iterate over. - public virtual Pageable GetAll(CancellationToken cancellationToken = default) + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetAll(CancellationToken cancellationToken = default) { - HttpMessage FirstPageRequest(int? pageSizeHint) => _containerAppConnectedEnvironmentDaprComponentConnectedEnvironmentsDaprComponentsRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _containerAppConnectedEnvironmentDaprComponentConnectedEnvironmentsDaprComponentsRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new ContainerAppConnectedEnvironmentDaprComponentResource(Client, ContainerAppDaprComponentData.DeserializeContainerAppDaprComponentData(e)), _containerAppConnectedEnvironmentDaprComponentConnectedEnvironmentsDaprComponentsClientDiagnostics, Pipeline, "ContainerAppConnectedEnvironmentDaprComponentCollection.GetAll", "value", "nextLink", cancellationToken); + HttpMessage FirstPageRequest(int? pageSizeHint) => _connectedEnvironmentDaprComponentConnectedEnvironmentsDaprComponentsRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _connectedEnvironmentDaprComponentConnectedEnvironmentsDaprComponentsRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new ConnectedEnvironmentDaprComponentResource(Client, ConnectedEnvironmentDaprComponentData.DeserializeConnectedEnvironmentDaprComponentData(e)), _connectedEnvironmentDaprComponentConnectedEnvironmentsDaprComponentsClientDiagnostics, Pipeline, "ConnectedEnvironmentDaprComponentCollection.GetAll", "value", "nextLink", cancellationToken); } /// @@ -316,11 +312,11 @@ public virtual Pageable G /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource - /// + /// /// /// /// @@ -332,11 +328,11 @@ public virtual async Task> ExistsAsync(string componentName, Canc { Argument.AssertNotNullOrEmpty(componentName, nameof(componentName)); - using var scope = _containerAppConnectedEnvironmentDaprComponentConnectedEnvironmentsDaprComponentsClientDiagnostics.CreateScope("ContainerAppConnectedEnvironmentDaprComponentCollection.Exists"); + using var scope = _connectedEnvironmentDaprComponentConnectedEnvironmentsDaprComponentsClientDiagnostics.CreateScope("ConnectedEnvironmentDaprComponentCollection.Exists"); scope.Start(); try { - var response = await _containerAppConnectedEnvironmentDaprComponentConnectedEnvironmentsDaprComponentsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, componentName, cancellationToken: cancellationToken).ConfigureAwait(false); + var response = await _connectedEnvironmentDaprComponentConnectedEnvironmentsDaprComponentsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, componentName, cancellationToken: cancellationToken).ConfigureAwait(false); return Response.FromValue(response.Value != null, response.GetRawResponse()); } catch (Exception e) @@ -359,11 +355,11 @@ public virtual async Task> ExistsAsync(string componentName, Canc /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource - /// + /// /// /// /// @@ -375,11 +371,11 @@ public virtual Response Exists(string componentName, CancellationToken can { Argument.AssertNotNullOrEmpty(componentName, nameof(componentName)); - using var scope = _containerAppConnectedEnvironmentDaprComponentConnectedEnvironmentsDaprComponentsClientDiagnostics.CreateScope("ContainerAppConnectedEnvironmentDaprComponentCollection.Exists"); + using var scope = _connectedEnvironmentDaprComponentConnectedEnvironmentsDaprComponentsClientDiagnostics.CreateScope("ConnectedEnvironmentDaprComponentCollection.Exists"); scope.Start(); try { - var response = _containerAppConnectedEnvironmentDaprComponentConnectedEnvironmentsDaprComponentsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, componentName, cancellationToken: cancellationToken); + var response = _connectedEnvironmentDaprComponentConnectedEnvironmentsDaprComponentsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, componentName, cancellationToken: cancellationToken); return Response.FromValue(response.Value != null, response.GetRawResponse()); } catch (Exception e) @@ -402,11 +398,11 @@ public virtual Response Exists(string componentName, CancellationToken can /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource - /// + /// /// /// /// @@ -414,18 +410,18 @@ public virtual Response Exists(string componentName, CancellationToken can /// The cancellation token to use. /// is an empty string, and was expected to be non-empty. /// is null. - public virtual async Task> GetIfExistsAsync(string componentName, CancellationToken cancellationToken = default) + public virtual async Task> GetIfExistsAsync(string componentName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(componentName, nameof(componentName)); - using var scope = _containerAppConnectedEnvironmentDaprComponentConnectedEnvironmentsDaprComponentsClientDiagnostics.CreateScope("ContainerAppConnectedEnvironmentDaprComponentCollection.GetIfExists"); + using var scope = _connectedEnvironmentDaprComponentConnectedEnvironmentsDaprComponentsClientDiagnostics.CreateScope("ConnectedEnvironmentDaprComponentCollection.GetIfExists"); scope.Start(); try { - var response = await _containerAppConnectedEnvironmentDaprComponentConnectedEnvironmentsDaprComponentsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, componentName, cancellationToken: cancellationToken).ConfigureAwait(false); + var response = await _connectedEnvironmentDaprComponentConnectedEnvironmentsDaprComponentsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, componentName, cancellationToken: cancellationToken).ConfigureAwait(false); if (response.Value == null) - return new NoValueResponse(response.GetRawResponse()); - return Response.FromValue(new ContainerAppConnectedEnvironmentDaprComponentResource(Client, response.Value), response.GetRawResponse()); + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new ConnectedEnvironmentDaprComponentResource(Client, response.Value), response.GetRawResponse()); } catch (Exception e) { @@ -447,11 +443,11 @@ public virtual async Task /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource - /// + /// /// /// /// @@ -459,18 +455,18 @@ public virtual async Task The cancellation token to use. /// is an empty string, and was expected to be non-empty. /// is null. - public virtual NullableResponse GetIfExists(string componentName, CancellationToken cancellationToken = default) + public virtual NullableResponse GetIfExists(string componentName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(componentName, nameof(componentName)); - using var scope = _containerAppConnectedEnvironmentDaprComponentConnectedEnvironmentsDaprComponentsClientDiagnostics.CreateScope("ContainerAppConnectedEnvironmentDaprComponentCollection.GetIfExists"); + using var scope = _connectedEnvironmentDaprComponentConnectedEnvironmentsDaprComponentsClientDiagnostics.CreateScope("ConnectedEnvironmentDaprComponentCollection.GetIfExists"); scope.Start(); try { - var response = _containerAppConnectedEnvironmentDaprComponentConnectedEnvironmentsDaprComponentsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, componentName, cancellationToken: cancellationToken); + var response = _connectedEnvironmentDaprComponentConnectedEnvironmentsDaprComponentsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, componentName, cancellationToken: cancellationToken); if (response.Value == null) - return new NoValueResponse(response.GetRawResponse()); - return Response.FromValue(new ContainerAppConnectedEnvironmentDaprComponentResource(Client, response.Value), response.GetRawResponse()); + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new ConnectedEnvironmentDaprComponentResource(Client, response.Value), response.GetRawResponse()); } catch (Exception e) { @@ -479,7 +475,7 @@ public virtual NullableResponse IEnumerable.GetEnumerator() + IEnumerator IEnumerable.GetEnumerator() { return GetAll().GetEnumerator(); } @@ -489,7 +485,7 @@ IEnumerator IEnumerable.GetEnumerator() return GetAll().GetEnumerator(); } - IAsyncEnumerator IAsyncEnumerable.GetAsyncEnumerator(CancellationToken cancellationToken) + IAsyncEnumerator IAsyncEnumerable.GetAsyncEnumerator(CancellationToken cancellationToken) { return GetAllAsync(cancellationToken: cancellationToken).GetAsyncEnumerator(cancellationToken); } diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/ConnectedEnvironmentDaprComponentData.Serialization.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/ConnectedEnvironmentDaprComponentData.Serialization.cs new file mode 100644 index 000000000000..545bbb1d541f --- /dev/null +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/ConnectedEnvironmentDaprComponentData.Serialization.cs @@ -0,0 +1,676 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Text.Json; +using Azure.Core; +using Azure.ResourceManager.AppContainers.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.AppContainers +{ + public partial class ConnectedEnvironmentDaprComponentData : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ConnectedEnvironmentDaprComponentData)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + writer.WritePropertyName("properties"u8); + writer.WriteStartObject(); + if (Optional.IsDefined(ComponentType)) + { + writer.WritePropertyName("componentType"u8); + writer.WriteStringValue(ComponentType); + } + if (Optional.IsDefined(Version)) + { + writer.WritePropertyName("version"u8); + writer.WriteStringValue(Version); + } + if (Optional.IsDefined(IgnoreErrors)) + { + writer.WritePropertyName("ignoreErrors"u8); + writer.WriteBooleanValue(IgnoreErrors.Value); + } + if (Optional.IsDefined(InitTimeout)) + { + writer.WritePropertyName("initTimeout"u8); + writer.WriteStringValue(InitTimeout); + } + if (Optional.IsCollectionDefined(Secrets)) + { + writer.WritePropertyName("secrets"u8); + writer.WriteStartArray(); + foreach (var item in Secrets) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(SecretStoreComponent)) + { + writer.WritePropertyName("secretStoreComponent"u8); + writer.WriteStringValue(SecretStoreComponent); + } + if (Optional.IsCollectionDefined(Metadata)) + { + writer.WritePropertyName("metadata"u8); + writer.WriteStartArray(); + foreach (var item in Metadata) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(Scopes)) + { + writer.WritePropertyName("scopes"u8); + writer.WriteStartArray(); + foreach (var item in Scopes) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(ServiceComponentBind)) + { + writer.WritePropertyName("serviceComponentBind"u8); + writer.WriteStartArray(); + foreach (var item in ServiceComponentBind) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) + { + writer.WritePropertyName("provisioningState"u8); + writer.WriteStringValue(ProvisioningState.Value.ToString()); + } + if (options.Format != "W" && Optional.IsDefined(DeploymentErrors)) + { + writer.WritePropertyName("deploymentErrors"u8); + writer.WriteStringValue(DeploymentErrors); + } + writer.WriteEndObject(); + } + + ConnectedEnvironmentDaprComponentData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ConnectedEnvironmentDaprComponentData)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeConnectedEnvironmentDaprComponentData(document.RootElement, options); + } + + internal static ConnectedEnvironmentDaprComponentData DeserializeConnectedEnvironmentDaprComponentData(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ResourceIdentifier id = default; + string name = default; + ResourceType type = default; + SystemData systemData = default; + string componentType = default; + string version = default; + bool? ignoreErrors = default; + string initTimeout = default; + IList secrets = default; + string secretStoreComponent = default; + IList metadata = default; + IList scopes = default; + IList serviceComponentBind = default; + ConnectedEnvironmentDaprComponentProvisioningState? provisioningState = default; + string deploymentErrors = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + 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.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + systemData = JsonSerializer.Deserialize(property.Value.GetRawText()); + continue; + } + if (property.NameEquals("properties"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + foreach (var property0 in property.Value.EnumerateObject()) + { + if (property0.NameEquals("componentType"u8)) + { + componentType = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("version"u8)) + { + version = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("ignoreErrors"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + ignoreErrors = property0.Value.GetBoolean(); + continue; + } + if (property0.NameEquals("initTimeout"u8)) + { + initTimeout = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("secrets"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property0.Value.EnumerateArray()) + { + array.Add(ContainerAppWritableSecret.DeserializeContainerAppWritableSecret(item, options)); + } + secrets = array; + continue; + } + if (property0.NameEquals("secretStoreComponent"u8)) + { + secretStoreComponent = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("metadata"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property0.Value.EnumerateArray()) + { + array.Add(ContainerAppDaprMetadata.DeserializeContainerAppDaprMetadata(item, options)); + } + metadata = array; + continue; + } + if (property0.NameEquals("scopes"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property0.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + scopes = array; + continue; + } + if (property0.NameEquals("serviceComponentBind"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property0.Value.EnumerateArray()) + { + array.Add(DaprComponentServiceBinding.DeserializeDaprComponentServiceBinding(item, options)); + } + serviceComponentBind = array; + continue; + } + if (property0.NameEquals("provisioningState"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + provisioningState = new ConnectedEnvironmentDaprComponentProvisioningState(property0.Value.GetString()); + continue; + } + if (property0.NameEquals("deploymentErrors"u8)) + { + deploymentErrors = property0.Value.GetString(); + continue; + } + } + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ConnectedEnvironmentDaprComponentData( + id, + name, + type, + systemData, + componentType, + version, + ignoreErrors, + initTimeout, + secrets ?? new ChangeTrackingList(), + secretStoreComponent, + metadata ?? new ChangeTrackingList(), + scopes ?? new ChangeTrackingList(), + serviceComponentBind ?? new ChangeTrackingList(), + provisioningState, + deploymentErrors, + serializedAdditionalRawData); + } + + private BinaryData SerializeBicep(ModelReaderWriterOptions options) + { + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Name), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" name: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Name)) + { + builder.Append(" name: "); + if (Name.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{Name}'''"); + } + else + { + builder.AppendLine($"'{Name}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Id), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" id: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Id)) + { + builder.Append(" id: "); + builder.AppendLine($"'{Id.ToString()}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(SystemData), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" systemData: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(SystemData)) + { + builder.Append(" systemData: "); + builder.AppendLine($"'{SystemData.ToString()}'"); + } + } + + builder.Append(" properties:"); + builder.AppendLine(" {"); + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(ComponentType), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" componentType: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(ComponentType)) + { + builder.Append(" componentType: "); + if (ComponentType.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{ComponentType}'''"); + } + else + { + builder.AppendLine($"'{ComponentType}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Version), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" version: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Version)) + { + builder.Append(" version: "); + if (Version.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{Version}'''"); + } + else + { + builder.AppendLine($"'{Version}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(IgnoreErrors), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" ignoreErrors: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(IgnoreErrors)) + { + builder.Append(" ignoreErrors: "); + var boolValue = IgnoreErrors.Value == true ? "true" : "false"; + builder.AppendLine($"{boolValue}"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(InitTimeout), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" initTimeout: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(InitTimeout)) + { + builder.Append(" initTimeout: "); + if (InitTimeout.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{InitTimeout}'''"); + } + else + { + builder.AppendLine($"'{InitTimeout}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Secrets), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" secrets: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsCollectionDefined(Secrets)) + { + if (Secrets.Any()) + { + builder.Append(" secrets: "); + builder.AppendLine("["); + foreach (var item in Secrets) + { + BicepSerializationHelpers.AppendChildObject(builder, item, options, 6, true, " secrets: "); + } + builder.AppendLine(" ]"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(SecretStoreComponent), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" secretStoreComponent: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(SecretStoreComponent)) + { + builder.Append(" secretStoreComponent: "); + if (SecretStoreComponent.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{SecretStoreComponent}'''"); + } + else + { + builder.AppendLine($"'{SecretStoreComponent}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Metadata), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" metadata: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsCollectionDefined(Metadata)) + { + if (Metadata.Any()) + { + builder.Append(" metadata: "); + builder.AppendLine("["); + foreach (var item in Metadata) + { + BicepSerializationHelpers.AppendChildObject(builder, item, options, 6, true, " metadata: "); + } + builder.AppendLine(" ]"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Scopes), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" scopes: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsCollectionDefined(Scopes)) + { + if (Scopes.Any()) + { + builder.Append(" scopes: "); + builder.AppendLine("["); + foreach (var item in Scopes) + { + if (item == null) + { + builder.Append("null"); + continue; + } + if (item.Contains(Environment.NewLine)) + { + builder.AppendLine(" '''"); + builder.AppendLine($"{item}'''"); + } + else + { + builder.AppendLine($" '{item}'"); + } + } + builder.AppendLine(" ]"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(ServiceComponentBind), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" serviceComponentBind: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsCollectionDefined(ServiceComponentBind)) + { + if (ServiceComponentBind.Any()) + { + builder.Append(" serviceComponentBind: "); + builder.AppendLine("["); + foreach (var item in ServiceComponentBind) + { + BicepSerializationHelpers.AppendChildObject(builder, item, options, 6, true, " serviceComponentBind: "); + } + builder.AppendLine(" ]"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(ProvisioningState), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" provisioningState: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(ProvisioningState)) + { + builder.Append(" provisioningState: "); + builder.AppendLine($"'{ProvisioningState.Value.ToString()}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(DeploymentErrors), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" deploymentErrors: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(DeploymentErrors)) + { + builder.Append(" deploymentErrors: "); + if (DeploymentErrors.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{DeploymentErrors}'''"); + } + else + { + builder.AppendLine($"'{DeploymentErrors}'"); + } + } + } + + builder.AppendLine(" }"); + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerAppContainersContext.Default); + case "bicep": + return SerializeBicep(options); + default: + throw new FormatException($"The model {nameof(ConnectedEnvironmentDaprComponentData)} does not support writing '{options.Format}' format."); + } + } + + ConnectedEnvironmentDaprComponentData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeConnectedEnvironmentDaprComponentData(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ConnectedEnvironmentDaprComponentData)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/ConnectedEnvironmentDaprComponentData.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/ConnectedEnvironmentDaprComponentData.cs new file mode 100644 index 000000000000..e8cd8836ba29 --- /dev/null +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/ConnectedEnvironmentDaprComponentData.cs @@ -0,0 +1,130 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; +using Azure.ResourceManager.AppContainers.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.AppContainers +{ + /// + /// A class representing the ConnectedEnvironmentDaprComponent data model. + /// Dapr Component. + /// + public partial class ConnectedEnvironmentDaprComponentData : ResourceData + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public ConnectedEnvironmentDaprComponentData() + { + Secrets = new ChangeTrackingList(); + Metadata = new ChangeTrackingList(); + Scopes = new ChangeTrackingList(); + ServiceComponentBind = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// Component type. + /// Component version. + /// Boolean describing if the component errors are ignores. + /// Initialization timeout. + /// Collection of secrets used by a Dapr component. + /// Name of a Dapr component to retrieve component secrets from. + /// Component metadata. + /// Names of container apps that can use this Dapr component. + /// List of container app services that are bound to the Dapr component. + /// Provisioning state of the Connected Environment Dapr Component. + /// Any errors that occurred during deployment or deployment validation. + /// Keeps track of any properties unknown to the library. + internal ConnectedEnvironmentDaprComponentData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, string componentType, string version, bool? ignoreErrors, string initTimeout, IList secrets, string secretStoreComponent, IList metadata, IList scopes, IList serviceComponentBind, ConnectedEnvironmentDaprComponentProvisioningState? provisioningState, string deploymentErrors, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) + { + ComponentType = componentType; + Version = version; + IgnoreErrors = ignoreErrors; + InitTimeout = initTimeout; + Secrets = secrets; + SecretStoreComponent = secretStoreComponent; + Metadata = metadata; + Scopes = scopes; + ServiceComponentBind = serviceComponentBind; + ProvisioningState = provisioningState; + DeploymentErrors = deploymentErrors; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Component type. + [WirePath("properties.componentType")] + public string ComponentType { get; set; } + /// Component version. + [WirePath("properties.version")] + public string Version { get; set; } + /// Boolean describing if the component errors are ignores. + [WirePath("properties.ignoreErrors")] + public bool? IgnoreErrors { get; set; } + /// Initialization timeout. + [WirePath("properties.initTimeout")] + public string InitTimeout { get; set; } + /// Collection of secrets used by a Dapr component. + [WirePath("properties.secrets")] + public IList Secrets { get; } + /// Name of a Dapr component to retrieve component secrets from. + [WirePath("properties.secretStoreComponent")] + public string SecretStoreComponent { get; set; } + /// Component metadata. + [WirePath("properties.metadata")] + public IList Metadata { get; } + /// Names of container apps that can use this Dapr component. + [WirePath("properties.scopes")] + public IList Scopes { get; } + /// List of container app services that are bound to the Dapr component. + [WirePath("properties.serviceComponentBind")] + public IList ServiceComponentBind { get; } + /// Provisioning state of the Connected Environment Dapr Component. + [WirePath("properties.provisioningState")] + public ConnectedEnvironmentDaprComponentProvisioningState? ProvisioningState { get; } + /// Any errors that occurred during deployment or deployment validation. + [WirePath("properties.deploymentErrors")] + public string DeploymentErrors { get; } + } +} diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/ConnectedEnvironmentDaprComponentResource.Serialization.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/ConnectedEnvironmentDaprComponentResource.Serialization.cs new file mode 100644 index 000000000000..402d3e63a366 --- /dev/null +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/ConnectedEnvironmentDaprComponentResource.Serialization.cs @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; + +namespace Azure.ResourceManager.AppContainers +{ + public partial class ConnectedEnvironmentDaprComponentResource : IJsonModel + { + private static ConnectedEnvironmentDaprComponentData s_dataDeserializationInstance; + private static ConnectedEnvironmentDaprComponentData DataDeserializationInstance => s_dataDeserializationInstance ??= new(); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); + + ConnectedEnvironmentDaprComponentData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)DataDeserializationInstance).Create(ref reader, options); + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options, AzureResourceManagerAppContainersContext.Default); + + ConnectedEnvironmentDaprComponentData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options, AzureResourceManagerAppContainersContext.Default); + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)DataDeserializationInstance).GetFormatFromOptions(options); + } +} diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/ContainerAppConnectedEnvironmentDaprComponentResource.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/ConnectedEnvironmentDaprComponentResource.cs similarity index 61% rename from sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/ContainerAppConnectedEnvironmentDaprComponentResource.cs rename to sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/ConnectedEnvironmentDaprComponentResource.cs index cfdeb27e5343..5681654d6aa6 100644 --- a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/ContainerAppConnectedEnvironmentDaprComponentResource.cs +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/ConnectedEnvironmentDaprComponentResource.cs @@ -17,14 +17,14 @@ namespace Azure.ResourceManager.AppContainers { /// - /// A Class representing a ContainerAppConnectedEnvironmentDaprComponent 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 GetContainerAppConnectedEnvironmentDaprComponentResource method. - /// Otherwise you can get one from its parent resource using the GetContainerAppConnectedEnvironmentDaprComponent method. + /// A Class representing a ConnectedEnvironmentDaprComponent 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 GetConnectedEnvironmentDaprComponentResource method. + /// Otherwise you can get one from its parent resource using the GetConnectedEnvironmentDaprComponent method. /// - public partial class ContainerAppConnectedEnvironmentDaprComponentResource : ArmResource + public partial class ConnectedEnvironmentDaprComponentResource : ArmResource { - /// Generate the resource identifier of a instance. + /// Generate the resource identifier of a instance. /// The subscriptionId. /// The resourceGroupName. /// The connectedEnvironmentName. @@ -35,35 +35,35 @@ public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, return new ResourceIdentifier(resourceId); } - private readonly ClientDiagnostics _containerAppConnectedEnvironmentDaprComponentConnectedEnvironmentsDaprComponentsClientDiagnostics; - private readonly ConnectedEnvironmentsDaprComponentsRestOperations _containerAppConnectedEnvironmentDaprComponentConnectedEnvironmentsDaprComponentsRestClient; - private readonly ContainerAppDaprComponentData _data; + private readonly ClientDiagnostics _connectedEnvironmentDaprComponentConnectedEnvironmentsDaprComponentsClientDiagnostics; + private readonly ConnectedEnvironmentsDaprComponentsRestOperations _connectedEnvironmentDaprComponentConnectedEnvironmentsDaprComponentsRestClient; + private readonly ConnectedEnvironmentDaprComponentData _data; /// Gets the resource type for the operations. public static readonly ResourceType ResourceType = "Microsoft.App/connectedEnvironments/daprComponents"; - /// Initializes a new instance of the class for mocking. - protected ContainerAppConnectedEnvironmentDaprComponentResource() + /// Initializes a new instance of the class for mocking. + protected ConnectedEnvironmentDaprComponentResource() { } - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// The client parameters to use in these operations. /// The resource that is the target of operations. - internal ContainerAppConnectedEnvironmentDaprComponentResource(ArmClient client, ContainerAppDaprComponentData data) : this(client, data.Id) + internal ConnectedEnvironmentDaprComponentResource(ArmClient client, ConnectedEnvironmentDaprComponentData data) : this(client, data.Id) { HasData = true; _data = data; } - /// Initializes a new instance of the class. + /// 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 ContainerAppConnectedEnvironmentDaprComponentResource(ArmClient client, ResourceIdentifier id) : base(client, id) + internal ConnectedEnvironmentDaprComponentResource(ArmClient client, ResourceIdentifier id) : base(client, id) { - _containerAppConnectedEnvironmentDaprComponentConnectedEnvironmentsDaprComponentsClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.AppContainers", ResourceType.Namespace, Diagnostics); - TryGetApiVersion(ResourceType, out string containerAppConnectedEnvironmentDaprComponentConnectedEnvironmentsDaprComponentsApiVersion); - _containerAppConnectedEnvironmentDaprComponentConnectedEnvironmentsDaprComponentsRestClient = new ConnectedEnvironmentsDaprComponentsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, containerAppConnectedEnvironmentDaprComponentConnectedEnvironmentsDaprComponentsApiVersion); + _connectedEnvironmentDaprComponentConnectedEnvironmentsDaprComponentsClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.AppContainers", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string connectedEnvironmentDaprComponentConnectedEnvironmentsDaprComponentsApiVersion); + _connectedEnvironmentDaprComponentConnectedEnvironmentsDaprComponentsRestClient = new ConnectedEnvironmentsDaprComponentsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, connectedEnvironmentDaprComponentConnectedEnvironmentsDaprComponentsApiVersion); #if DEBUG ValidateResourceId(Id); #endif @@ -74,7 +74,7 @@ internal ContainerAppConnectedEnvironmentDaprComponentResource(ArmClient client, /// Gets the data representing this Feature. /// Throws if there is no data loaded in the current instance. - public virtual ContainerAppDaprComponentData Data + public virtual ConnectedEnvironmentDaprComponentData Data { get { @@ -103,25 +103,25 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource - /// + /// /// /// /// /// The cancellation token to use. - public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) { - using var scope = _containerAppConnectedEnvironmentDaprComponentConnectedEnvironmentsDaprComponentsClientDiagnostics.CreateScope("ContainerAppConnectedEnvironmentDaprComponentResource.Get"); + using var scope = _connectedEnvironmentDaprComponentConnectedEnvironmentsDaprComponentsClientDiagnostics.CreateScope("ConnectedEnvironmentDaprComponentResource.Get"); scope.Start(); try { - var response = await _containerAppConnectedEnvironmentDaprComponentConnectedEnvironmentsDaprComponentsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + var response = await _connectedEnvironmentDaprComponentConnectedEnvironmentsDaprComponentsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); if (response.Value == null) throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new ContainerAppConnectedEnvironmentDaprComponentResource(Client, response.Value), response.GetRawResponse()); + return Response.FromValue(new ConnectedEnvironmentDaprComponentResource(Client, response.Value), response.GetRawResponse()); } catch (Exception e) { @@ -143,25 +143,25 @@ public virtual async Task /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource - /// + /// /// /// /// /// The cancellation token to use. - public virtual Response Get(CancellationToken cancellationToken = default) + public virtual Response Get(CancellationToken cancellationToken = default) { - using var scope = _containerAppConnectedEnvironmentDaprComponentConnectedEnvironmentsDaprComponentsClientDiagnostics.CreateScope("ContainerAppConnectedEnvironmentDaprComponentResource.Get"); + using var scope = _connectedEnvironmentDaprComponentConnectedEnvironmentsDaprComponentsClientDiagnostics.CreateScope("ConnectedEnvironmentDaprComponentResource.Get"); scope.Start(); try { - var response = _containerAppConnectedEnvironmentDaprComponentConnectedEnvironmentsDaprComponentsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + var response = _connectedEnvironmentDaprComponentConnectedEnvironmentsDaprComponentsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); if (response.Value == null) throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new ContainerAppConnectedEnvironmentDaprComponentResource(Client, response.Value), response.GetRawResponse()); + return Response.FromValue(new ConnectedEnvironmentDaprComponentResource(Client, response.Value), response.GetRawResponse()); } catch (Exception e) { @@ -183,11 +183,11 @@ public virtual Response G /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource - /// + /// /// /// /// @@ -195,14 +195,12 @@ public virtual Response G /// The cancellation token to use. public virtual async Task DeleteAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default) { - using var scope = _containerAppConnectedEnvironmentDaprComponentConnectedEnvironmentsDaprComponentsClientDiagnostics.CreateScope("ContainerAppConnectedEnvironmentDaprComponentResource.Delete"); + using var scope = _connectedEnvironmentDaprComponentConnectedEnvironmentsDaprComponentsClientDiagnostics.CreateScope("ConnectedEnvironmentDaprComponentResource.Delete"); scope.Start(); try { - var response = await _containerAppConnectedEnvironmentDaprComponentConnectedEnvironmentsDaprComponentsRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); - var uri = _containerAppConnectedEnvironmentDaprComponentConnectedEnvironmentsDaprComponentsRestClient.CreateDeleteRequestUri(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name); - var rehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(RequestMethod.Delete, uri.ToUri(), uri.ToString(), "None", null, OperationFinalStateVia.OriginalUri.ToString()); - var operation = new AppContainersArmOperation(response, rehydrationToken); + var response = await _connectedEnvironmentDaprComponentConnectedEnvironmentsDaprComponentsRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + var operation = new AppContainersArmOperation(_connectedEnvironmentDaprComponentConnectedEnvironmentsDaprComponentsClientDiagnostics, Pipeline, _connectedEnvironmentDaprComponentConnectedEnvironmentsDaprComponentsRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); if (waitUntil == WaitUntil.Completed) await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); return operation; @@ -227,11 +225,11 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource - /// + /// /// /// /// @@ -239,14 +237,12 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// The cancellation token to use. public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancellationToken = default) { - using var scope = _containerAppConnectedEnvironmentDaprComponentConnectedEnvironmentsDaprComponentsClientDiagnostics.CreateScope("ContainerAppConnectedEnvironmentDaprComponentResource.Delete"); + using var scope = _connectedEnvironmentDaprComponentConnectedEnvironmentsDaprComponentsClientDiagnostics.CreateScope("ConnectedEnvironmentDaprComponentResource.Delete"); scope.Start(); try { - var response = _containerAppConnectedEnvironmentDaprComponentConnectedEnvironmentsDaprComponentsRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); - var uri = _containerAppConnectedEnvironmentDaprComponentConnectedEnvironmentsDaprComponentsRestClient.CreateDeleteRequestUri(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name); - var rehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(RequestMethod.Delete, uri.ToUri(), uri.ToString(), "None", null, OperationFinalStateVia.OriginalUri.ToString()); - var operation = new AppContainersArmOperation(response, rehydrationToken); + var response = _connectedEnvironmentDaprComponentConnectedEnvironmentsDaprComponentsRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + var operation = new AppContainersArmOperation(_connectedEnvironmentDaprComponentConnectedEnvironmentsDaprComponentsClientDiagnostics, Pipeline, _connectedEnvironmentDaprComponentConnectedEnvironmentsDaprComponentsRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); if (waitUntil == WaitUntil.Completed) operation.WaitForCompletionResponse(cancellationToken); return operation; @@ -271,11 +267,11 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource - /// + /// /// /// /// @@ -283,18 +279,16 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// Configuration details of the Dapr Component. /// The cancellation token to use. /// is null. - public virtual async Task> UpdateAsync(WaitUntil waitUntil, ContainerAppDaprComponentData data, CancellationToken cancellationToken = default) + public virtual async Task> UpdateAsync(WaitUntil waitUntil, ConnectedEnvironmentDaprComponentData data, CancellationToken cancellationToken = default) { Argument.AssertNotNull(data, nameof(data)); - using var scope = _containerAppConnectedEnvironmentDaprComponentConnectedEnvironmentsDaprComponentsClientDiagnostics.CreateScope("ContainerAppConnectedEnvironmentDaprComponentResource.Update"); + using var scope = _connectedEnvironmentDaprComponentConnectedEnvironmentsDaprComponentsClientDiagnostics.CreateScope("ConnectedEnvironmentDaprComponentResource.Update"); scope.Start(); try { - var response = await _containerAppConnectedEnvironmentDaprComponentConnectedEnvironmentsDaprComponentsRestClient.CreateOrUpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, cancellationToken).ConfigureAwait(false); - var uri = _containerAppConnectedEnvironmentDaprComponentConnectedEnvironmentsDaprComponentsRestClient.CreateCreateOrUpdateRequestUri(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data); - var rehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(RequestMethod.Put, uri.ToUri(), uri.ToString(), "None", null, OperationFinalStateVia.OriginalUri.ToString()); - var operation = new AppContainersArmOperation(Response.FromValue(new ContainerAppConnectedEnvironmentDaprComponentResource(Client, response), response.GetRawResponse()), rehydrationToken); + var response = await _connectedEnvironmentDaprComponentConnectedEnvironmentsDaprComponentsRestClient.CreateOrUpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, cancellationToken).ConfigureAwait(false); + var operation = new AppContainersArmOperation(new ConnectedEnvironmentDaprComponentOperationSource(Client), _connectedEnvironmentDaprComponentConnectedEnvironmentsDaprComponentsClientDiagnostics, Pipeline, _connectedEnvironmentDaprComponentConnectedEnvironmentsDaprComponentsRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); if (waitUntil == WaitUntil.Completed) await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); return operation; @@ -319,11 +313,11 @@ public virtual async Task /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource - /// + /// /// /// /// @@ -331,18 +325,16 @@ public virtual async Task Configuration details of the Dapr Component. /// The cancellation token to use. /// is null. - public virtual ArmOperation Update(WaitUntil waitUntil, ContainerAppDaprComponentData data, CancellationToken cancellationToken = default) + public virtual ArmOperation Update(WaitUntil waitUntil, ConnectedEnvironmentDaprComponentData data, CancellationToken cancellationToken = default) { Argument.AssertNotNull(data, nameof(data)); - using var scope = _containerAppConnectedEnvironmentDaprComponentConnectedEnvironmentsDaprComponentsClientDiagnostics.CreateScope("ContainerAppConnectedEnvironmentDaprComponentResource.Update"); + using var scope = _connectedEnvironmentDaprComponentConnectedEnvironmentsDaprComponentsClientDiagnostics.CreateScope("ConnectedEnvironmentDaprComponentResource.Update"); scope.Start(); try { - var response = _containerAppConnectedEnvironmentDaprComponentConnectedEnvironmentsDaprComponentsRestClient.CreateOrUpdate(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, cancellationToken); - var uri = _containerAppConnectedEnvironmentDaprComponentConnectedEnvironmentsDaprComponentsRestClient.CreateCreateOrUpdateRequestUri(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data); - var rehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(RequestMethod.Put, uri.ToUri(), uri.ToString(), "None", null, OperationFinalStateVia.OriginalUri.ToString()); - var operation = new AppContainersArmOperation(Response.FromValue(new ContainerAppConnectedEnvironmentDaprComponentResource(Client, response), response.GetRawResponse()), rehydrationToken); + var response = _connectedEnvironmentDaprComponentConnectedEnvironmentsDaprComponentsRestClient.CreateOrUpdate(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, cancellationToken); + var operation = new AppContainersArmOperation(new ConnectedEnvironmentDaprComponentOperationSource(Client), _connectedEnvironmentDaprComponentConnectedEnvironmentsDaprComponentsClientDiagnostics, Pipeline, _connectedEnvironmentDaprComponentConnectedEnvironmentsDaprComponentsRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); if (waitUntil == WaitUntil.Completed) operation.WaitForCompletion(cancellationToken); return operation; @@ -367,11 +359,11 @@ public virtual ArmOperation /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource - /// + /// /// /// /// @@ -379,8 +371,8 @@ public virtual ArmOperation An async collection of that may take multiple service requests to iterate over. public virtual AsyncPageable GetSecretsAsync(CancellationToken cancellationToken = default) { - HttpMessage FirstPageRequest(int? pageSizeHint) => _containerAppConnectedEnvironmentDaprComponentConnectedEnvironmentsDaprComponentsRestClient.CreateListSecretsRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, null, e => ContainerAppDaprSecret.DeserializeContainerAppDaprSecret(e), _containerAppConnectedEnvironmentDaprComponentConnectedEnvironmentsDaprComponentsClientDiagnostics, Pipeline, "ContainerAppConnectedEnvironmentDaprComponentResource.GetSecrets", "value", null, cancellationToken); + HttpMessage FirstPageRequest(int? pageSizeHint) => _connectedEnvironmentDaprComponentConnectedEnvironmentsDaprComponentsRestClient.CreateListSecretsRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, null, e => ContainerAppDaprSecret.DeserializeContainerAppDaprSecret(e), _connectedEnvironmentDaprComponentConnectedEnvironmentsDaprComponentsClientDiagnostics, Pipeline, "ConnectedEnvironmentDaprComponentResource.GetSecrets", "value", null, cancellationToken); } /// @@ -396,11 +388,11 @@ public virtual AsyncPageable GetSecretsAsync(Cancellatio /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource - /// + /// /// /// /// @@ -408,8 +400,8 @@ public virtual AsyncPageable GetSecretsAsync(Cancellatio /// A collection of that may take multiple service requests to iterate over. public virtual Pageable GetSecrets(CancellationToken cancellationToken = default) { - HttpMessage FirstPageRequest(int? pageSizeHint) => _containerAppConnectedEnvironmentDaprComponentConnectedEnvironmentsDaprComponentsRestClient.CreateListSecretsRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, null, e => ContainerAppDaprSecret.DeserializeContainerAppDaprSecret(e), _containerAppConnectedEnvironmentDaprComponentConnectedEnvironmentsDaprComponentsClientDiagnostics, Pipeline, "ContainerAppConnectedEnvironmentDaprComponentResource.GetSecrets", "value", null, cancellationToken); + HttpMessage FirstPageRequest(int? pageSizeHint) => _connectedEnvironmentDaprComponentConnectedEnvironmentsDaprComponentsRestClient.CreateListSecretsRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, null, e => ContainerAppDaprSecret.DeserializeContainerAppDaprSecret(e), _connectedEnvironmentDaprComponentConnectedEnvironmentsDaprComponentsClientDiagnostics, Pipeline, "ConnectedEnvironmentDaprComponentResource.GetSecrets", "value", null, cancellationToken); } } } diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/ContainerAppAuthConfigCollection.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/ContainerAppAuthConfigCollection.cs index e289ff87647e..c955bd3063ce 100644 --- a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/ContainerAppAuthConfigCollection.cs +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/ContainerAppAuthConfigCollection.cs @@ -64,7 +64,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -115,7 +115,7 @@ public virtual async Task> CreateOr /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -166,7 +166,7 @@ public virtual ArmOperation CreateOrUpdate(WaitU /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -211,7 +211,7 @@ public virtual async Task> GetAsync(str /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -256,7 +256,7 @@ public virtual Response Get(string authConfigNam /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -286,7 +286,7 @@ public virtual AsyncPageable GetAllAsync(Cancell /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -316,7 +316,7 @@ public virtual Pageable GetAll(CancellationToken /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -359,7 +359,7 @@ public virtual async Task> ExistsAsync(string authConfigName, Can /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -402,7 +402,7 @@ public virtual Response Exists(string authConfigName, CancellationToken ca /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -447,7 +447,7 @@ public virtual async Task> GetI /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/ContainerAppAuthConfigResource.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/ContainerAppAuthConfigResource.cs index 530c3e486585..7a02ee82c0ca 100644 --- a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/ContainerAppAuthConfigResource.cs +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/ContainerAppAuthConfigResource.cs @@ -101,7 +101,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -141,7 +141,7 @@ public virtual async Task> GetAsync(Can /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -181,7 +181,7 @@ public virtual Response Get(CancellationToken ca /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -225,7 +225,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -269,7 +269,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -317,7 +317,7 @@ public virtual async Task> UpdateAs /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/ContainerAppCollection.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/ContainerAppCollection.cs index 83661d002f3e..0c1b46f638db 100644 --- a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/ContainerAppCollection.cs +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/ContainerAppCollection.cs @@ -65,7 +65,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -114,7 +114,7 @@ public virtual async Task> CreateOrUpdateAsyn /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -163,7 +163,7 @@ public virtual ArmOperation CreateOrUpdate(WaitUntil waitU /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -208,7 +208,7 @@ public virtual async Task> GetAsync(string contai /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -253,7 +253,7 @@ public virtual Response Get(string containerAppName, Cance /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -283,7 +283,7 @@ public virtual AsyncPageable GetAllAsync(CancellationToken /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -313,7 +313,7 @@ public virtual Pageable GetAll(CancellationToken cancellat /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -356,7 +356,7 @@ public virtual async Task> ExistsAsync(string containerAppName, C /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -399,7 +399,7 @@ public virtual Response Exists(string containerAppName, CancellationToken /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -444,7 +444,7 @@ public virtual async Task> GetIfExistsAsy /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/ContainerAppConnectedEnvironmentCertificateCollection.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/ContainerAppConnectedEnvironmentCertificateCollection.cs index 45840d8bfea6..977f7ab105a6 100644 --- a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/ContainerAppConnectedEnvironmentCertificateCollection.cs +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/ContainerAppConnectedEnvironmentCertificateCollection.cs @@ -64,7 +64,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -88,9 +88,7 @@ public virtual async Task(Response.FromValue(new ContainerAppConnectedEnvironmentCertificateResource(Client, response), response.GetRawResponse()), rehydrationToken); + var operation = new AppContainersArmOperation(new ContainerAppConnectedEnvironmentCertificateOperationSource(Client), _containerAppConnectedEnvironmentCertificateConnectedEnvironmentsCertificatesClientDiagnostics, Pipeline, _containerAppConnectedEnvironmentCertificateConnectedEnvironmentsCertificatesRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, certificateName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); if (waitUntil == WaitUntil.Completed) await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); return operation; @@ -115,7 +113,7 @@ public virtual async Task /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -139,9 +137,7 @@ public virtual ArmOperation try { var response = _containerAppConnectedEnvironmentCertificateConnectedEnvironmentsCertificatesRestClient.CreateOrUpdate(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, certificateName, data, cancellationToken); - var uri = _containerAppConnectedEnvironmentCertificateConnectedEnvironmentsCertificatesRestClient.CreateCreateOrUpdateRequestUri(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, certificateName, data); - var rehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(RequestMethod.Put, uri.ToUri(), uri.ToString(), "None", null, OperationFinalStateVia.OriginalUri.ToString()); - var operation = new AppContainersArmOperation(Response.FromValue(new ContainerAppConnectedEnvironmentCertificateResource(Client, response), response.GetRawResponse()), rehydrationToken); + var operation = new AppContainersArmOperation(new ContainerAppConnectedEnvironmentCertificateOperationSource(Client), _containerAppConnectedEnvironmentCertificateConnectedEnvironmentsCertificatesClientDiagnostics, Pipeline, _containerAppConnectedEnvironmentCertificateConnectedEnvironmentsCertificatesRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, certificateName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); if (waitUntil == WaitUntil.Completed) operation.WaitForCompletion(cancellationToken); return operation; @@ -166,7 +162,7 @@ public virtual ArmOperation /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -211,7 +207,7 @@ public virtual async Task /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -256,7 +252,7 @@ public virtual Response Get /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -286,7 +282,7 @@ public virtual AsyncPageable /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -316,7 +312,7 @@ public virtual Pageable Get /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -359,7 +355,7 @@ public virtual async Task> ExistsAsync(string certificateName, Ca /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -402,7 +398,7 @@ public virtual Response Exists(string certificateName, CancellationToken c /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -447,7 +443,7 @@ public virtual async Task /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/ContainerAppConnectedEnvironmentCertificateResource.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/ContainerAppConnectedEnvironmentCertificateResource.cs index d857fe83cb4e..0aa0e6657705 100644 --- a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/ContainerAppConnectedEnvironmentCertificateResource.cs +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/ContainerAppConnectedEnvironmentCertificateResource.cs @@ -103,7 +103,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -143,7 +143,7 @@ public virtual async Task /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -183,7 +183,7 @@ public virtual Response Get /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -200,9 +200,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell try { var response = await _containerAppConnectedEnvironmentCertificateConnectedEnvironmentsCertificatesRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); - var uri = _containerAppConnectedEnvironmentCertificateConnectedEnvironmentsCertificatesRestClient.CreateDeleteRequestUri(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name); - var rehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(RequestMethod.Delete, uri.ToUri(), uri.ToString(), "None", null, OperationFinalStateVia.OriginalUri.ToString()); - var operation = new AppContainersArmOperation(response, rehydrationToken); + var operation = new AppContainersArmOperation(_containerAppConnectedEnvironmentCertificateConnectedEnvironmentsCertificatesClientDiagnostics, Pipeline, _containerAppConnectedEnvironmentCertificateConnectedEnvironmentsCertificatesRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); if (waitUntil == WaitUntil.Completed) await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); return operation; @@ -227,7 +225,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -244,9 +242,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel try { var response = _containerAppConnectedEnvironmentCertificateConnectedEnvironmentsCertificatesRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); - var uri = _containerAppConnectedEnvironmentCertificateConnectedEnvironmentsCertificatesRestClient.CreateDeleteRequestUri(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name); - var rehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(RequestMethod.Delete, uri.ToUri(), uri.ToString(), "None", null, OperationFinalStateVia.OriginalUri.ToString()); - var operation = new AppContainersArmOperation(response, rehydrationToken); + var operation = new AppContainersArmOperation(_containerAppConnectedEnvironmentCertificateConnectedEnvironmentsCertificatesClientDiagnostics, Pipeline, _containerAppConnectedEnvironmentCertificateConnectedEnvironmentsCertificatesRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); if (waitUntil == WaitUntil.Completed) operation.WaitForCompletionResponse(cancellationToken); return operation; @@ -271,7 +267,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -279,10 +275,11 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// + /// 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. /// Properties of a certificate that need to be updated. /// The cancellation token to use. /// is null. - public virtual async Task> UpdateAsync(ContainerAppCertificatePatch patch, CancellationToken cancellationToken = default) + public virtual async Task> UpdateAsync(WaitUntil waitUntil, ContainerAppCertificatePatch patch, CancellationToken cancellationToken = default) { Argument.AssertNotNull(patch, nameof(patch)); @@ -291,7 +288,10 @@ public virtual async Task(new ContainerAppConnectedEnvironmentCertificateOperationSource(Client), _containerAppConnectedEnvironmentCertificateConnectedEnvironmentsCertificatesClientDiagnostics, Pipeline, _containerAppConnectedEnvironmentCertificateConnectedEnvironmentsCertificatesRestClient.CreateUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, patch).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; } catch (Exception e) { @@ -313,7 +313,7 @@ public virtual async Task /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -321,10 +321,11 @@ public virtual async Task /// /// + /// 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. /// Properties of a certificate that need to be updated. /// The cancellation token to use. /// is null. - public virtual Response Update(ContainerAppCertificatePatch patch, CancellationToken cancellationToken = default) + public virtual ArmOperation Update(WaitUntil waitUntil, ContainerAppCertificatePatch patch, CancellationToken cancellationToken = default) { Argument.AssertNotNull(patch, nameof(patch)); @@ -333,7 +334,10 @@ public virtual Response Upd try { var response = _containerAppConnectedEnvironmentCertificateConnectedEnvironmentsCertificatesRestClient.Update(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, patch, cancellationToken); - return Response.FromValue(new ContainerAppConnectedEnvironmentCertificateResource(Client, response.Value), response.GetRawResponse()); + var operation = new AppContainersArmOperation(new ContainerAppConnectedEnvironmentCertificateOperationSource(Client), _containerAppConnectedEnvironmentCertificateConnectedEnvironmentsCertificatesClientDiagnostics, Pipeline, _containerAppConnectedEnvironmentCertificateConnectedEnvironmentsCertificatesRestClient.CreateUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, patch).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; } catch (Exception e) { @@ -355,7 +359,7 @@ public virtual Response Upd /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -393,8 +397,8 @@ public virtual async Task /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -455,8 +459,8 @@ public virtual Response Add patch.Tags.Add(tag); } patch.Tags[key] = value; - var result = Update(patch, cancellationToken: cancellationToken); - return result; + var result = Update(WaitUntil.Completed, patch, cancellationToken: cancellationToken); + return Response.FromValue(result.Value, result.GetRawResponse()); } } catch (Exception e) @@ -479,7 +483,7 @@ public virtual Response Add /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -512,8 +516,8 @@ public virtual async Task /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -569,8 +573,8 @@ public virtual Response Set var current = Get(cancellationToken: cancellationToken).Value.Data; var patch = new ContainerAppCertificatePatch(); patch.Tags.ReplaceWith(tags); - var result = Update(patch, cancellationToken: cancellationToken); - return result; + var result = Update(WaitUntil.Completed, patch, cancellationToken: cancellationToken); + return Response.FromValue(result.Value, result.GetRawResponse()); } } catch (Exception e) @@ -593,7 +597,7 @@ public virtual Response Set /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -629,8 +633,8 @@ public virtual async Task /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -689,8 +693,8 @@ public virtual Response Rem patch.Tags.Add(tag); } patch.Tags.Remove(key); - var result = Update(patch, cancellationToken: cancellationToken); - return result; + var result = Update(WaitUntil.Completed, patch, cancellationToken: cancellationToken); + return Response.FromValue(result.Value, result.GetRawResponse()); } } catch (Exception e) diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/ContainerAppConnectedEnvironmentCollection.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/ContainerAppConnectedEnvironmentCollection.cs index 397e52ebc1e0..4cc66c68f4d5 100644 --- a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/ContainerAppConnectedEnvironmentCollection.cs +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/ContainerAppConnectedEnvironmentCollection.cs @@ -65,7 +65,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -114,7 +114,7 @@ public virtual async Task /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -163,7 +163,7 @@ public virtual ArmOperation CreateOrUp /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -208,7 +208,7 @@ public virtual async Task> Ge /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -253,7 +253,7 @@ public virtual Response Get(string con /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -283,7 +283,7 @@ public virtual AsyncPageable GetAllAsy /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -313,7 +313,7 @@ public virtual Pageable GetAll(Cancell /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -356,7 +356,7 @@ public virtual async Task> ExistsAsync(string connectedEnvironmen /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -399,7 +399,7 @@ public virtual Response Exists(string connectedEnvironmentName, Cancellati /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -444,7 +444,7 @@ public virtual async Task /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/ContainerAppConnectedEnvironmentDaprComponentResource.Serialization.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/ContainerAppConnectedEnvironmentDaprComponentResource.Serialization.cs deleted file mode 100644 index 889d0d188cd2..000000000000 --- a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/ContainerAppConnectedEnvironmentDaprComponentResource.Serialization.cs +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Text.Json; - -namespace Azure.ResourceManager.AppContainers -{ - public partial class ContainerAppConnectedEnvironmentDaprComponentResource : IJsonModel - { - private static ContainerAppDaprComponentData s_dataDeserializationInstance; - private static ContainerAppDaprComponentData DataDeserializationInstance => s_dataDeserializationInstance ??= new(); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); - - ContainerAppDaprComponentData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)DataDeserializationInstance).Create(ref reader, options); - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options, AzureResourceManagerAppContainersContext.Default); - - ContainerAppDaprComponentData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options, AzureResourceManagerAppContainersContext.Default); - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)DataDeserializationInstance).GetFormatFromOptions(options); - } -} diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/ContainerAppConnectedEnvironmentResource.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/ContainerAppConnectedEnvironmentResource.cs index 4f6530b4efdb..009b2d4dc06c 100644 --- a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/ContainerAppConnectedEnvironmentResource.cs +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/ContainerAppConnectedEnvironmentResource.cs @@ -6,6 +6,7 @@ #nullable disable using System; +using System.Collections.Generic; using System.Globalization; using System.Threading; using System.Threading.Tasks; @@ -109,7 +110,7 @@ public virtual ContainerAppConnectedEnvironmentCertificateCollection GetContaine /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -140,7 +141,7 @@ public virtual async Task /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -158,11 +159,11 @@ public virtual Response Get return GetContainerAppConnectedEnvironmentCertificates().Get(certificateName, cancellationToken); } - /// Gets a collection of ContainerAppConnectedEnvironmentDaprComponentResources in the ContainerAppConnectedEnvironment. - /// An object representing collection of ContainerAppConnectedEnvironmentDaprComponentResources and their operations over a ContainerAppConnectedEnvironmentDaprComponentResource. - public virtual ContainerAppConnectedEnvironmentDaprComponentCollection GetContainerAppConnectedEnvironmentDaprComponents() + /// Gets a collection of ConnectedEnvironmentDaprComponentResources in the ContainerAppConnectedEnvironment. + /// An object representing collection of ConnectedEnvironmentDaprComponentResources and their operations over a ConnectedEnvironmentDaprComponentResource. + public virtual ConnectedEnvironmentDaprComponentCollection GetConnectedEnvironmentDaprComponents() { - return GetCachedClient(client => new ContainerAppConnectedEnvironmentDaprComponentCollection(client, Id)); + return GetCachedClient(client => new ConnectedEnvironmentDaprComponentCollection(client, Id)); } /// @@ -178,11 +179,11 @@ public virtual ContainerAppConnectedEnvironmentDaprComponentCollection GetContai /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource - /// + /// /// /// /// @@ -191,9 +192,9 @@ public virtual ContainerAppConnectedEnvironmentDaprComponentCollection GetContai /// is null. /// is an empty string, and was expected to be non-empty. [ForwardsClientCalls] - public virtual async Task> GetContainerAppConnectedEnvironmentDaprComponentAsync(string componentName, CancellationToken cancellationToken = default) + public virtual async Task> GetConnectedEnvironmentDaprComponentAsync(string componentName, CancellationToken cancellationToken = default) { - return await GetContainerAppConnectedEnvironmentDaprComponents().GetAsync(componentName, cancellationToken).ConfigureAwait(false); + return await GetConnectedEnvironmentDaprComponents().GetAsync(componentName, cancellationToken).ConfigureAwait(false); } /// @@ -209,11 +210,11 @@ public virtual async Task /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource - /// + /// /// /// /// @@ -222,9 +223,9 @@ public virtual async Task is null. /// is an empty string, and was expected to be non-empty. [ForwardsClientCalls] - public virtual Response GetContainerAppConnectedEnvironmentDaprComponent(string componentName, CancellationToken cancellationToken = default) + public virtual Response GetConnectedEnvironmentDaprComponent(string componentName, CancellationToken cancellationToken = default) { - return GetContainerAppConnectedEnvironmentDaprComponents().Get(componentName, cancellationToken); + return GetConnectedEnvironmentDaprComponents().Get(componentName, cancellationToken); } /// Gets a collection of ContainerAppConnectedEnvironmentStorageResources in the ContainerAppConnectedEnvironment. @@ -247,7 +248,7 @@ public virtual ContainerAppConnectedEnvironmentStorageCollection GetContainerApp /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -278,7 +279,7 @@ public virtual async Task /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -309,7 +310,7 @@ public virtual Response GetCont /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -349,7 +350,7 @@ public virtual async Task> Ge /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -389,7 +390,7 @@ public virtual Response Get(Cancellati /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -431,7 +432,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -473,7 +474,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -481,14 +482,18 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// + /// Configuration details of the connectedEnvironment. /// The cancellation token to use. - public virtual async Task> UpdateAsync(CancellationToken cancellationToken = default) + /// is null. + public virtual async Task> UpdateAsync(ContainerAppConnectedEnvironmentPatch patch, CancellationToken cancellationToken = default) { + Argument.AssertNotNull(patch, nameof(patch)); + using var scope = _containerAppConnectedEnvironmentConnectedEnvironmentsClientDiagnostics.CreateScope("ContainerAppConnectedEnvironmentResource.Update"); scope.Start(); try { - var response = await _containerAppConnectedEnvironmentConnectedEnvironmentsRestClient.UpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + var response = await _containerAppConnectedEnvironmentConnectedEnvironmentsRestClient.UpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, patch, cancellationToken).ConfigureAwait(false); return Response.FromValue(new ContainerAppConnectedEnvironmentResource(Client, response.Value), response.GetRawResponse()); } catch (Exception e) @@ -511,7 +516,7 @@ public virtual async Task> Up /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -519,14 +524,18 @@ public virtual async Task> Up /// /// /// + /// Configuration details of the connectedEnvironment. /// The cancellation token to use. - public virtual Response Update(CancellationToken cancellationToken = default) + /// is null. + public virtual Response Update(ContainerAppConnectedEnvironmentPatch patch, CancellationToken cancellationToken = default) { + Argument.AssertNotNull(patch, nameof(patch)); + using var scope = _containerAppConnectedEnvironmentConnectedEnvironmentsClientDiagnostics.CreateScope("ContainerAppConnectedEnvironmentResource.Update"); scope.Start(); try { - var response = _containerAppConnectedEnvironmentConnectedEnvironmentsRestClient.Update(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + var response = _containerAppConnectedEnvironmentConnectedEnvironmentsRestClient.Update(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, patch, cancellationToken); return Response.FromValue(new ContainerAppConnectedEnvironmentResource(Client, response.Value), response.GetRawResponse()); } catch (Exception e) @@ -549,7 +558,7 @@ public virtual Response Update(Cancell /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -591,7 +600,7 @@ public virtual async Task> CheckNam /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -619,5 +628,363 @@ public virtual Response CheckNameAvailabilit throw; } } + + /// + /// Add a tag to the current resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/connectedEnvironments/{connectedEnvironmentName} + /// + /// + /// Operation Id + /// ConnectedEnvironments_Get + /// + /// + /// Default Api Version + /// 2025-02-02-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// 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 = _containerAppConnectedEnvironmentConnectedEnvironmentsClientDiagnostics.CreateScope("ContainerAppConnectedEnvironmentResource.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 _containerAppConnectedEnvironmentConnectedEnvironmentsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + return Response.FromValue(new ContainerAppConnectedEnvironmentResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; + var patch = new ContainerAppConnectedEnvironmentPatch(); + foreach (var tag in current.Tags) + { + patch.Tags.Add(tag); + } + patch.Tags[key] = value; + var result = await UpdateAsync(patch, cancellationToken: cancellationToken).ConfigureAwait(false); + return result; + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Add a tag to the current resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/connectedEnvironments/{connectedEnvironmentName} + /// + /// + /// Operation Id + /// ConnectedEnvironments_Get + /// + /// + /// Default Api Version + /// 2025-02-02-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// 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 = _containerAppConnectedEnvironmentConnectedEnvironmentsClientDiagnostics.CreateScope("ContainerAppConnectedEnvironmentResource.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 = _containerAppConnectedEnvironmentConnectedEnvironmentsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + return Response.FromValue(new ContainerAppConnectedEnvironmentResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = Get(cancellationToken: cancellationToken).Value.Data; + var patch = new ContainerAppConnectedEnvironmentPatch(); + foreach (var tag in current.Tags) + { + patch.Tags.Add(tag); + } + patch.Tags[key] = value; + var result = Update(patch, cancellationToken: cancellationToken); + return result; + } + } + 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.App/connectedEnvironments/{connectedEnvironmentName} + /// + /// + /// Operation Id + /// ConnectedEnvironments_Get + /// + /// + /// Default Api Version + /// 2025-02-02-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// 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 = _containerAppConnectedEnvironmentConnectedEnvironmentsClientDiagnostics.CreateScope("ContainerAppConnectedEnvironmentResource.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 _containerAppConnectedEnvironmentConnectedEnvironmentsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + return Response.FromValue(new ContainerAppConnectedEnvironmentResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; + var patch = new ContainerAppConnectedEnvironmentPatch(); + patch.Tags.ReplaceWith(tags); + var result = await UpdateAsync(patch, cancellationToken: cancellationToken).ConfigureAwait(false); + return result; + } + } + 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.App/connectedEnvironments/{connectedEnvironmentName} + /// + /// + /// Operation Id + /// ConnectedEnvironments_Get + /// + /// + /// Default Api Version + /// 2025-02-02-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// 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 = _containerAppConnectedEnvironmentConnectedEnvironmentsClientDiagnostics.CreateScope("ContainerAppConnectedEnvironmentResource.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 = _containerAppConnectedEnvironmentConnectedEnvironmentsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + return Response.FromValue(new ContainerAppConnectedEnvironmentResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = Get(cancellationToken: cancellationToken).Value.Data; + var patch = new ContainerAppConnectedEnvironmentPatch(); + patch.Tags.ReplaceWith(tags); + var result = Update(patch, cancellationToken: cancellationToken); + return result; + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Removes a tag by key from the resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/connectedEnvironments/{connectedEnvironmentName} + /// + /// + /// Operation Id + /// ConnectedEnvironments_Get + /// + /// + /// Default Api Version + /// 2025-02-02-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// 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 = _containerAppConnectedEnvironmentConnectedEnvironmentsClientDiagnostics.CreateScope("ContainerAppConnectedEnvironmentResource.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 _containerAppConnectedEnvironmentConnectedEnvironmentsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + return Response.FromValue(new ContainerAppConnectedEnvironmentResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; + var patch = new ContainerAppConnectedEnvironmentPatch(); + foreach (var tag in current.Tags) + { + patch.Tags.Add(tag); + } + patch.Tags.Remove(key); + var result = await UpdateAsync(patch, cancellationToken: cancellationToken).ConfigureAwait(false); + return result; + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Removes a tag by key from the resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/connectedEnvironments/{connectedEnvironmentName} + /// + /// + /// Operation Id + /// ConnectedEnvironments_Get + /// + /// + /// Default Api Version + /// 2025-02-02-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// 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 = _containerAppConnectedEnvironmentConnectedEnvironmentsClientDiagnostics.CreateScope("ContainerAppConnectedEnvironmentResource.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 = _containerAppConnectedEnvironmentConnectedEnvironmentsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + return Response.FromValue(new ContainerAppConnectedEnvironmentResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = Get(cancellationToken: cancellationToken).Value.Data; + var patch = new ContainerAppConnectedEnvironmentPatch(); + foreach (var tag in current.Tags) + { + patch.Tags.Add(tag); + } + patch.Tags.Remove(key); + var result = Update(patch, cancellationToken: cancellationToken); + return result; + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } } } diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/ContainerAppConnectedEnvironmentStorageCollection.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/ContainerAppConnectedEnvironmentStorageCollection.cs index 9bab76eaf91a..8c66cde3ef64 100644 --- a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/ContainerAppConnectedEnvironmentStorageCollection.cs +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/ContainerAppConnectedEnvironmentStorageCollection.cs @@ -64,7 +64,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -88,9 +88,7 @@ public virtual async Task(Response.FromValue(new ContainerAppConnectedEnvironmentStorageResource(Client, response), response.GetRawResponse()), rehydrationToken); + var operation = new AppContainersArmOperation(new ContainerAppConnectedEnvironmentStorageOperationSource(Client), _containerAppConnectedEnvironmentStorageConnectedEnvironmentsStoragesClientDiagnostics, Pipeline, _containerAppConnectedEnvironmentStorageConnectedEnvironmentsStoragesRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, storageName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); if (waitUntil == WaitUntil.Completed) await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); return operation; @@ -115,7 +113,7 @@ public virtual async Task /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -139,9 +137,7 @@ public virtual ArmOperation Cre try { var response = _containerAppConnectedEnvironmentStorageConnectedEnvironmentsStoragesRestClient.CreateOrUpdate(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, storageName, data, cancellationToken); - var uri = _containerAppConnectedEnvironmentStorageConnectedEnvironmentsStoragesRestClient.CreateCreateOrUpdateRequestUri(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, storageName, data); - var rehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(RequestMethod.Put, uri.ToUri(), uri.ToString(), "None", null, OperationFinalStateVia.OriginalUri.ToString()); - var operation = new AppContainersArmOperation(Response.FromValue(new ContainerAppConnectedEnvironmentStorageResource(Client, response), response.GetRawResponse()), rehydrationToken); + var operation = new AppContainersArmOperation(new ContainerAppConnectedEnvironmentStorageOperationSource(Client), _containerAppConnectedEnvironmentStorageConnectedEnvironmentsStoragesClientDiagnostics, Pipeline, _containerAppConnectedEnvironmentStorageConnectedEnvironmentsStoragesRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, storageName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); if (waitUntil == WaitUntil.Completed) operation.WaitForCompletion(cancellationToken); return operation; @@ -166,7 +162,7 @@ public virtual ArmOperation Cre /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -211,7 +207,7 @@ public virtual async Task /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -256,7 +252,7 @@ public virtual Response Get(str /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -285,7 +281,7 @@ public virtual AsyncPageable Ge /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -314,7 +310,7 @@ public virtual Pageable GetAll( /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -357,7 +353,7 @@ public virtual async Task> ExistsAsync(string storageName, Cancel /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -400,7 +396,7 @@ public virtual Response Exists(string storageName, CancellationToken cance /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -445,7 +441,7 @@ public virtual async Task /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/ContainerAppConnectedEnvironmentStorageData.Serialization.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/ContainerAppConnectedEnvironmentStorageData.Serialization.cs index 88e3a23d432e..581f245c9dd0 100644 --- a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/ContainerAppConnectedEnvironmentStorageData.Serialization.cs +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/ContainerAppConnectedEnvironmentStorageData.Serialization.cs @@ -156,14 +156,11 @@ private BinaryData SerializeBicep(ModelReaderWriterOptions options) } } - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue("ConnectedEnvironmentStorageAzureFile", out propertyOverride); + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Properties), out propertyOverride); if (hasPropertyOverride) { builder.Append(" properties: "); - builder.AppendLine("{"); - builder.Append(" azureFile: "); builder.AppendLine(propertyOverride); - builder.AppendLine(" }"); } else { diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/ContainerAppConnectedEnvironmentStorageData.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/ContainerAppConnectedEnvironmentStorageData.cs index 0f1473cb391e..f53a973b39fb 100644 --- a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/ContainerAppConnectedEnvironmentStorageData.cs +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/ContainerAppConnectedEnvironmentStorageData.cs @@ -70,18 +70,7 @@ internal ContainerAppConnectedEnvironmentStorageData(ResourceIdentifier id, stri } /// Storage properties. - internal ConnectedEnvironmentStorageProperties Properties { get; set; } - /// Azure file properties. - [WirePath("properties.azureFile")] - public ContainerAppAzureFileProperties ConnectedEnvironmentStorageAzureFile - { - get => Properties is null ? default : Properties.AzureFile; - set - { - if (Properties is null) - Properties = new ConnectedEnvironmentStorageProperties(); - Properties.AzureFile = value; - } - } + [WirePath("properties")] + public ConnectedEnvironmentStorageProperties Properties { get; set; } } } diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/ContainerAppConnectedEnvironmentStorageResource.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/ContainerAppConnectedEnvironmentStorageResource.cs index 62d75a0d8141..a6163071a460 100644 --- a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/ContainerAppConnectedEnvironmentStorageResource.cs +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/ContainerAppConnectedEnvironmentStorageResource.cs @@ -101,7 +101,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -141,7 +141,7 @@ public virtual async Task /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -181,7 +181,7 @@ public virtual Response Get(Can /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -198,9 +198,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell try { var response = await _containerAppConnectedEnvironmentStorageConnectedEnvironmentsStoragesRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); - var uri = _containerAppConnectedEnvironmentStorageConnectedEnvironmentsStoragesRestClient.CreateDeleteRequestUri(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name); - var rehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(RequestMethod.Delete, uri.ToUri(), uri.ToString(), "None", null, OperationFinalStateVia.OriginalUri.ToString()); - var operation = new AppContainersArmOperation(response, rehydrationToken); + var operation = new AppContainersArmOperation(_containerAppConnectedEnvironmentStorageConnectedEnvironmentsStoragesClientDiagnostics, Pipeline, _containerAppConnectedEnvironmentStorageConnectedEnvironmentsStoragesRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); if (waitUntil == WaitUntil.Completed) await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); return operation; @@ -225,7 +223,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -242,9 +240,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel try { var response = _containerAppConnectedEnvironmentStorageConnectedEnvironmentsStoragesRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); - var uri = _containerAppConnectedEnvironmentStorageConnectedEnvironmentsStoragesRestClient.CreateDeleteRequestUri(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name); - var rehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(RequestMethod.Delete, uri.ToUri(), uri.ToString(), "None", null, OperationFinalStateVia.OriginalUri.ToString()); - var operation = new AppContainersArmOperation(response, rehydrationToken); + var operation = new AppContainersArmOperation(_containerAppConnectedEnvironmentStorageConnectedEnvironmentsStoragesClientDiagnostics, Pipeline, _containerAppConnectedEnvironmentStorageConnectedEnvironmentsStoragesRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); if (waitUntil == WaitUntil.Completed) operation.WaitForCompletionResponse(cancellationToken); return operation; @@ -269,7 +265,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -290,9 +286,7 @@ public virtual async Task(Response.FromValue(new ContainerAppConnectedEnvironmentStorageResource(Client, response), response.GetRawResponse()), rehydrationToken); + var operation = new AppContainersArmOperation(new ContainerAppConnectedEnvironmentStorageOperationSource(Client), _containerAppConnectedEnvironmentStorageConnectedEnvironmentsStoragesClientDiagnostics, Pipeline, _containerAppConnectedEnvironmentStorageConnectedEnvironmentsStoragesRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); if (waitUntil == WaitUntil.Completed) await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); return operation; @@ -317,7 +311,7 @@ public virtual async Task /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -338,9 +332,7 @@ public virtual ArmOperation Upd try { var response = _containerAppConnectedEnvironmentStorageConnectedEnvironmentsStoragesRestClient.CreateOrUpdate(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, cancellationToken); - var uri = _containerAppConnectedEnvironmentStorageConnectedEnvironmentsStoragesRestClient.CreateCreateOrUpdateRequestUri(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data); - var rehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(RequestMethod.Put, uri.ToUri(), uri.ToString(), "None", null, OperationFinalStateVia.OriginalUri.ToString()); - var operation = new AppContainersArmOperation(Response.FromValue(new ContainerAppConnectedEnvironmentStorageResource(Client, response), response.GetRawResponse()), rehydrationToken); + var operation = new AppContainersArmOperation(new ContainerAppConnectedEnvironmentStorageOperationSource(Client), _containerAppConnectedEnvironmentStorageConnectedEnvironmentsStoragesClientDiagnostics, Pipeline, _containerAppConnectedEnvironmentStorageConnectedEnvironmentsStoragesRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); if (waitUntil == WaitUntil.Completed) operation.WaitForCompletion(cancellationToken); return operation; diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/ContainerAppDaprComponentData.Serialization.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/ContainerAppDaprComponentData.Serialization.cs index bc4fb1e6ab80..9c2db84b5670 100644 --- a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/ContainerAppDaprComponentData.Serialization.cs +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/ContainerAppDaprComponentData.Serialization.cs @@ -96,6 +96,16 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri } writer.WriteEndArray(); } + if (Optional.IsCollectionDefined(ServiceComponentBind)) + { + writer.WritePropertyName("serviceComponentBind"u8); + writer.WriteStartArray(); + foreach (var item in ServiceComponentBind) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } writer.WriteEndObject(); } @@ -131,6 +141,7 @@ internal static ContainerAppDaprComponentData DeserializeContainerAppDaprCompone string secretStoreComponent = default; IList metadata = default; IList scopes = default; + IList serviceComponentBind = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -239,6 +250,20 @@ internal static ContainerAppDaprComponentData DeserializeContainerAppDaprCompone scopes = array; continue; } + if (property0.NameEquals("serviceComponentBind"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property0.Value.EnumerateArray()) + { + array.Add(DaprComponentServiceBinding.DeserializeDaprComponentServiceBinding(item, options)); + } + serviceComponentBind = array; + continue; + } } continue; } @@ -261,6 +286,7 @@ internal static ContainerAppDaprComponentData DeserializeContainerAppDaprCompone secretStoreComponent, metadata ?? new ChangeTrackingList(), scopes ?? new ChangeTrackingList(), + serviceComponentBind ?? new ChangeTrackingList(), serializedAdditionalRawData); } @@ -520,6 +546,29 @@ private BinaryData SerializeBicep(ModelReaderWriterOptions options) } } + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(ServiceComponentBind), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" serviceComponentBind: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsCollectionDefined(ServiceComponentBind)) + { + if (ServiceComponentBind.Any()) + { + builder.Append(" serviceComponentBind: "); + builder.AppendLine("["); + foreach (var item in ServiceComponentBind) + { + BicepSerializationHelpers.AppendChildObject(builder, item, options, 6, true, " serviceComponentBind: "); + } + builder.AppendLine(" ]"); + } + } + } + builder.AppendLine(" }"); builder.AppendLine("}"); return BinaryData.FromString(builder.ToString()); diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/ContainerAppDaprComponentData.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/ContainerAppDaprComponentData.cs index 49fb698e99c3..9b68f1fe1ebb 100644 --- a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/ContainerAppDaprComponentData.cs +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/ContainerAppDaprComponentData.cs @@ -57,6 +57,7 @@ public ContainerAppDaprComponentData() Secrets = new ChangeTrackingList(); Metadata = new ChangeTrackingList(); Scopes = new ChangeTrackingList(); + ServiceComponentBind = new ChangeTrackingList(); } /// Initializes a new instance of . @@ -72,8 +73,9 @@ public ContainerAppDaprComponentData() /// Name of a Dapr component to retrieve component secrets from. /// Component metadata. /// Names of container apps that can use this Dapr component. + /// List of container app services that are bound to the Dapr component. /// Keeps track of any properties unknown to the library. - internal ContainerAppDaprComponentData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, string componentType, string version, bool? ignoreErrors, string initTimeout, IList secrets, string secretStoreComponent, IList metadata, IList scopes, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) + internal ContainerAppDaprComponentData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, string componentType, string version, bool? ignoreErrors, string initTimeout, IList secrets, string secretStoreComponent, IList metadata, IList scopes, IList serviceComponentBind, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) { ComponentType = componentType; Version = version; @@ -83,6 +85,7 @@ internal ContainerAppDaprComponentData(ResourceIdentifier id, string name, Resou SecretStoreComponent = secretStoreComponent; Metadata = metadata; Scopes = scopes; + ServiceComponentBind = serviceComponentBind; _serializedAdditionalRawData = serializedAdditionalRawData; } @@ -110,5 +113,8 @@ internal ContainerAppDaprComponentData(ResourceIdentifier id, string name, Resou /// Names of container apps that can use this Dapr component. [WirePath("properties.scopes")] public IList Scopes { get; } + /// List of container app services that are bound to the Dapr component. + [WirePath("properties.serviceComponentBind")] + public IList ServiceComponentBind { get; } } } diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/ContainerAppData.Serialization.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/ContainerAppData.Serialization.cs index ba8bb0af2450..ef421f0b338a 100644 --- a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/ContainerAppData.Serialization.cs +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/ContainerAppData.Serialization.cs @@ -56,6 +56,11 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri writer.WritePropertyName("managedBy"u8); writer.WriteStringValue(ManagedBy); } + if (Optional.IsDefined(Kind)) + { + writer.WritePropertyName("kind"u8); + writer.WriteStringValue(Kind.Value.ToString()); + } writer.WritePropertyName("properties"u8); writer.WriteStartObject(); if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) @@ -68,6 +73,11 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri writer.WritePropertyName("runningStatus"u8); writer.WriteStringValue(RunningStatus.Value.ToString()); } + if (options.Format != "W" && Optional.IsDefined(DeploymentErrors)) + { + writer.WritePropertyName("deploymentErrors"u8); + writer.WriteStringValue(DeploymentErrors); + } if (Optional.IsDefined(ManagedEnvironmentId)) { writer.WritePropertyName("managedEnvironmentId"u8); @@ -83,6 +93,11 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri writer.WritePropertyName("workloadProfileName"u8); writer.WriteStringValue(WorkloadProfileName); } + if (Optional.IsDefined(PatchingConfiguration)) + { + writer.WritePropertyName("patchingConfiguration"u8); + writer.WriteObjectValue(PatchingConfiguration, options); + } if (options.Format != "W" && Optional.IsDefined(LatestRevisionName)) { writer.WritePropertyName("latestRevisionName"u8); @@ -159,6 +174,7 @@ internal static ContainerAppData DeserializeContainerAppData(JsonElement element ContainerAppExtendedLocation extendedLocation = default; ManagedServiceIdentity identity = default; string managedBy = default; + AppContainersKind? kind = default; IDictionary tags = default; AzureLocation location = default; ResourceIdentifier id = default; @@ -167,9 +183,11 @@ internal static ContainerAppData DeserializeContainerAppData(JsonElement element SystemData systemData = default; ContainerAppProvisioningState? provisioningState = default; ContainerAppRunningStatus? runningStatus = default; + string deploymentErrors = default; ResourceIdentifier managedEnvironmentId = default; ResourceIdentifier environmentId = default; string workloadProfileName = default; + ContainerAppPropertiesPatchingConfiguration patchingConfiguration = default; string latestRevisionName = default; string latestReadyRevisionName = default; string latestRevisionFqdn = default; @@ -206,6 +224,15 @@ internal static ContainerAppData DeserializeContainerAppData(JsonElement element managedBy = property.Value.GetString(); continue; } + if (property.NameEquals("kind"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + kind = new AppContainersKind(property.Value.GetString()); + continue; + } if (property.NameEquals("tags"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -276,6 +303,11 @@ internal static ContainerAppData DeserializeContainerAppData(JsonElement element runningStatus = new ContainerAppRunningStatus(property0.Value.GetString()); continue; } + if (property0.NameEquals("deploymentErrors"u8)) + { + deploymentErrors = property0.Value.GetString(); + continue; + } if (property0.NameEquals("managedEnvironmentId"u8)) { if (property0.Value.ValueKind == JsonValueKind.Null) @@ -299,6 +331,15 @@ internal static ContainerAppData DeserializeContainerAppData(JsonElement element workloadProfileName = property0.Value.GetString(); continue; } + if (property0.NameEquals("patchingConfiguration"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + patchingConfiguration = ContainerAppPropertiesPatchingConfiguration.DeserializeContainerAppPropertiesPatchingConfiguration(property0.Value, options); + continue; + } if (property0.NameEquals("latestRevisionName"u8)) { latestRevisionName = property0.Value.GetString(); @@ -386,11 +427,14 @@ internal static ContainerAppData DeserializeContainerAppData(JsonElement element extendedLocation, identity, managedBy, + kind, provisioningState, runningStatus, + deploymentErrors, managedEnvironmentId, environmentId, workloadProfileName, + patchingConfiguration, latestRevisionName, latestReadyRevisionName, latestRevisionFqdn, @@ -538,6 +582,21 @@ private BinaryData SerializeBicep(ModelReaderWriterOptions options) } } + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Kind), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" kind: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Kind)) + { + builder.Append(" kind: "); + builder.AppendLine($"'{Kind.Value.ToString()}'"); + } + } + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Id), out propertyOverride); if (hasPropertyOverride) { @@ -600,6 +659,29 @@ private BinaryData SerializeBicep(ModelReaderWriterOptions options) } } + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(DeploymentErrors), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" deploymentErrors: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(DeploymentErrors)) + { + builder.Append(" deploymentErrors: "); + if (DeploymentErrors.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{DeploymentErrors}'''"); + } + else + { + builder.AppendLine($"'{DeploymentErrors}'"); + } + } + } + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(ManagedEnvironmentId), out propertyOverride); if (hasPropertyOverride) { @@ -653,6 +735,26 @@ private BinaryData SerializeBicep(ModelReaderWriterOptions options) } } + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue("PatchingMode", out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" patchingConfiguration: "); + builder.AppendLine("{"); + builder.AppendLine(" patchingConfiguration: {"); + builder.Append(" patchingMode: "); + builder.AppendLine(propertyOverride); + builder.AppendLine(" }"); + builder.AppendLine(" }"); + } + else + { + if (Optional.IsDefined(PatchingConfiguration)) + { + builder.Append(" patchingConfiguration: "); + BicepSerializationHelpers.AppendChildObject(builder, PatchingConfiguration, options, 4, false, " patchingConfiguration: "); + } + } + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(LatestRevisionName), out propertyOverride); if (hasPropertyOverride) { diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/ContainerAppData.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/ContainerAppData.cs index 81e8bc1579e8..6467cd0c70a3 100644 --- a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/ContainerAppData.cs +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/ContainerAppData.cs @@ -69,11 +69,14 @@ public ContainerAppData(AzureLocation location) : base(location) /// The complex type of the extended location. /// managed identities for the Container App to interact with other Azure services without maintaining any secrets or credentials in code. /// The fully qualified resource ID of the resource that manages this resource. Indicates if this resource is managed by another Azure resource. If this is present, complete mode deployment will not delete the resource if it is removed from the template since it is managed by another resource. + /// Metadata used to render different experiences for resources of the same type; e.g. WorkflowApp is a kind of Microsoft.App/ContainerApps type. If supported, the resource provider must validate and persist this value. /// Provisioning state of the Container App. /// Running status of the Container App. + /// Any errors that occurred during deployment. /// Deprecated. Resource ID of the Container App's environment. /// Resource ID of environment. /// Workload profile name to pin for container app execution. + /// Container App auto patch configuration. /// Name of the latest revision of the Container App. /// Name of the latest ready revision of the Container App. /// Fully Qualified Domain Name of the latest revision of the Container App. @@ -83,16 +86,19 @@ public ContainerAppData(AzureLocation location) : base(location) /// Outbound IP Addresses for container app. /// The endpoint of the eventstream of the container app. /// Keeps track of any properties unknown to the library. - internal ContainerAppData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, ContainerAppExtendedLocation extendedLocation, ManagedServiceIdentity identity, string managedBy, ContainerAppProvisioningState? provisioningState, ContainerAppRunningStatus? runningStatus, ResourceIdentifier managedEnvironmentId, ResourceIdentifier environmentId, string workloadProfileName, string latestRevisionName, string latestReadyRevisionName, string latestRevisionFqdn, string customDomainVerificationId, ContainerAppConfiguration configuration, ContainerAppTemplate template, IReadOnlyList outboundIPAddressList, Uri eventStreamEndpoint, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) + internal ContainerAppData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, ContainerAppExtendedLocation extendedLocation, ManagedServiceIdentity identity, string managedBy, AppContainersKind? kind, ContainerAppProvisioningState? provisioningState, ContainerAppRunningStatus? runningStatus, string deploymentErrors, ResourceIdentifier managedEnvironmentId, ResourceIdentifier environmentId, string workloadProfileName, ContainerAppPropertiesPatchingConfiguration patchingConfiguration, string latestRevisionName, string latestReadyRevisionName, string latestRevisionFqdn, string customDomainVerificationId, ContainerAppConfiguration configuration, ContainerAppTemplate template, IReadOnlyList outboundIPAddressList, Uri eventStreamEndpoint, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) { ExtendedLocation = extendedLocation; Identity = identity; ManagedBy = managedBy; + Kind = kind; ProvisioningState = provisioningState; RunningStatus = runningStatus; + DeploymentErrors = deploymentErrors; ManagedEnvironmentId = managedEnvironmentId; EnvironmentId = environmentId; WorkloadProfileName = workloadProfileName; + PatchingConfiguration = patchingConfiguration; LatestRevisionName = latestRevisionName; LatestReadyRevisionName = latestReadyRevisionName; LatestRevisionFqdn = latestRevisionFqdn; @@ -118,12 +124,18 @@ internal ContainerAppData() /// The fully qualified resource ID of the resource that manages this resource. Indicates if this resource is managed by another Azure resource. If this is present, complete mode deployment will not delete the resource if it is removed from the template since it is managed by another resource. [WirePath("managedBy")] public string ManagedBy { get; set; } + /// Metadata used to render different experiences for resources of the same type; e.g. WorkflowApp is a kind of Microsoft.App/ContainerApps type. If supported, the resource provider must validate and persist this value. + [WirePath("kind")] + public AppContainersKind? Kind { get; set; } /// Provisioning state of the Container App. [WirePath("properties.provisioningState")] public ContainerAppProvisioningState? ProvisioningState { get; } /// Running status of the Container App. [WirePath("properties.runningStatus")] public ContainerAppRunningStatus? RunningStatus { get; } + /// Any errors that occurred during deployment. + [WirePath("properties.deploymentErrors")] + public string DeploymentErrors { get; } /// Deprecated. Resource ID of the Container App's environment. [WirePath("properties.managedEnvironmentId")] public ResourceIdentifier ManagedEnvironmentId { get; set; } @@ -133,6 +145,21 @@ internal ContainerAppData() /// Workload profile name to pin for container app execution. [WirePath("properties.workloadProfileName")] public string WorkloadProfileName { get; set; } + /// Container App auto patch configuration. + internal ContainerAppPropertiesPatchingConfiguration PatchingConfiguration { get; set; } + /// Patching mode for the container app. Null or default in this field will be interpreted as Automatic by RP. Automatic mode will automatically apply available patches. Manual mode will require the user to manually apply patches. Disabled mode will stop patch detection and auto patching. + [WirePath("properties.patchingConfiguration.patchingMode")] + public PatchingMode? PatchingMode + { + get => PatchingConfiguration is null ? default : PatchingConfiguration.PatchingMode; + set + { + if (PatchingConfiguration is null) + PatchingConfiguration = new ContainerAppPropertiesPatchingConfiguration(); + PatchingConfiguration.PatchingMode = value; + } + } + /// Name of the latest revision of the Container App. [WirePath("properties.latestRevisionName")] public string LatestRevisionName { get; } diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/ContainerAppDetectorCollection.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/ContainerAppDetectorCollection.cs index 9f655648266a..571f0bcb84a8 100644 --- a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/ContainerAppDetectorCollection.cs +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/ContainerAppDetectorCollection.cs @@ -64,7 +64,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -109,7 +109,7 @@ public virtual async Task> GetAsync(strin /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -154,7 +154,7 @@ public virtual Response Get(string detectorName, C /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -184,7 +184,7 @@ public virtual AsyncPageable GetAllAsync(Cancellat /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -214,7 +214,7 @@ public virtual Pageable GetAll(CancellationToken c /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -257,7 +257,7 @@ public virtual async Task> ExistsAsync(string detectorName, Cance /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -300,7 +300,7 @@ public virtual Response Exists(string detectorName, CancellationToken canc /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -345,7 +345,7 @@ public virtual async Task> GetIfE /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/ContainerAppDetectorPropertyResource.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/ContainerAppDetectorPropertyResource.cs index c0cb2d1de50d..231a06a62f8e 100644 --- a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/ContainerAppDetectorPropertyResource.cs +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/ContainerAppDetectorPropertyResource.cs @@ -100,7 +100,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -140,7 +140,7 @@ public virtual async Task> GetAsy /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/ContainerAppDetectorPropertyRevisionCollection.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/ContainerAppDetectorPropertyRevisionCollection.cs index b5d2af847a8a..ad2538a35448 100644 --- a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/ContainerAppDetectorPropertyRevisionCollection.cs +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/ContainerAppDetectorPropertyRevisionCollection.cs @@ -64,7 +64,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -109,7 +109,7 @@ public virtual async Task /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -154,7 +154,7 @@ public virtual Response Get(string /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -185,7 +185,7 @@ public virtual AsyncPageable GetAl /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -216,7 +216,7 @@ public virtual Pageable GetAll(str /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -259,7 +259,7 @@ public virtual async Task> ExistsAsync(string revisionName, Cance /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -302,7 +302,7 @@ public virtual Response Exists(string revisionName, CancellationToken canc /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -347,7 +347,7 @@ public virtual async Task /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/ContainerAppDetectorPropertyRevisionResource.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/ContainerAppDetectorPropertyRevisionResource.cs index 3f99dc5e44ce..4e46d7f69388 100644 --- a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/ContainerAppDetectorPropertyRevisionResource.cs +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/ContainerAppDetectorPropertyRevisionResource.cs @@ -101,7 +101,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -141,7 +141,7 @@ public virtual async Task /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/ContainerAppDetectorResource.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/ContainerAppDetectorResource.cs index c26ef1055930..99d5c874f04c 100644 --- a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/ContainerAppDetectorResource.cs +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/ContainerAppDetectorResource.cs @@ -101,7 +101,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -141,7 +141,7 @@ public virtual async Task> GetAsync(Cance /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/ContainerAppJobCollection.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/ContainerAppJobCollection.cs index 0aa69fa93306..006de5b33555 100644 --- a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/ContainerAppJobCollection.cs +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/ContainerAppJobCollection.cs @@ -65,7 +65,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -114,7 +114,7 @@ public virtual async Task> CreateOrUpdateA /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -163,7 +163,7 @@ public virtual ArmOperation CreateOrUpdate(WaitUntil wa /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -208,7 +208,7 @@ public virtual async Task> GetAsync(string job /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -253,7 +253,7 @@ public virtual Response Get(string jobName, Cancellatio /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -283,7 +283,7 @@ public virtual AsyncPageable GetAllAsync(CancellationTo /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -313,7 +313,7 @@ public virtual Pageable GetAll(CancellationToken cancel /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -356,7 +356,7 @@ public virtual async Task> ExistsAsync(string jobName, Cancellati /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -399,7 +399,7 @@ public virtual Response Exists(string jobName, CancellationToken cancellat /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -444,7 +444,7 @@ public virtual async Task> GetIfExists /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/ContainerAppJobData.Serialization.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/ContainerAppJobData.Serialization.cs index ba737d814eb4..1a0b624698ea 100644 --- a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/ContainerAppJobData.Serialization.cs +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/ContainerAppJobData.Serialization.cs @@ -39,6 +39,11 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri } base.JsonModelWriteCore(writer, options); + if (Optional.IsDefined(ExtendedLocation)) + { + writer.WritePropertyName("extendedLocation"u8); + writer.WriteObjectValue(ExtendedLocation, options); + } if (Optional.IsDefined(Identity)) { writer.WritePropertyName("identity"u8); @@ -52,6 +57,11 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri writer.WritePropertyName("provisioningState"u8); writer.WriteStringValue(ProvisioningState.Value.ToString()); } + if (options.Format != "W" && Optional.IsDefined(RunningState)) + { + writer.WritePropertyName("runningState"u8); + writer.WriteStringValue(RunningState.Value.ToString()); + } if (Optional.IsDefined(EnvironmentId)) { writer.WritePropertyName("environmentId"u8); @@ -110,6 +120,7 @@ internal static ContainerAppJobData DeserializeContainerAppJobData(JsonElement e { return null; } + ContainerAppExtendedLocation extendedLocation = default; ManagedServiceIdentity identity = default; IDictionary tags = default; AzureLocation location = default; @@ -118,6 +129,7 @@ internal static ContainerAppJobData DeserializeContainerAppJobData(JsonElement e ResourceType type = default; SystemData systemData = default; ContainerAppJobProvisioningState? provisioningState = default; + ContainerAppJobRunningState? runningState = default; string environmentId = default; string workloadProfileName = default; ContainerAppJobConfiguration configuration = default; @@ -128,6 +140,15 @@ internal static ContainerAppJobData DeserializeContainerAppJobData(JsonElement e Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { + if (property.NameEquals("extendedLocation"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + extendedLocation = ContainerAppExtendedLocation.DeserializeContainerAppExtendedLocation(property.Value, options); + continue; + } if (property.NameEquals("identity"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -199,6 +220,15 @@ internal static ContainerAppJobData DeserializeContainerAppJobData(JsonElement e provisioningState = new ContainerAppJobProvisioningState(property0.Value.GetString()); continue; } + if (property0.NameEquals("runningState"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + runningState = new ContainerAppJobRunningState(property0.Value.GetString()); + continue; + } if (property0.NameEquals("environmentId"u8)) { environmentId = property0.Value.GetString(); @@ -262,8 +292,10 @@ internal static ContainerAppJobData DeserializeContainerAppJobData(JsonElement e systemData, tags ?? new ChangeTrackingDictionary(), location, + extendedLocation, identity, provisioningState, + runningState, environmentId, workloadProfileName, configuration, @@ -356,6 +388,21 @@ private BinaryData SerializeBicep(ModelReaderWriterOptions options) } } + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(ExtendedLocation), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" extendedLocation: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(ExtendedLocation)) + { + builder.Append(" extendedLocation: "); + BicepSerializationHelpers.AppendChildObject(builder, ExtendedLocation, options, 2, false, " extendedLocation: "); + } + } + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Identity), out propertyOverride); if (hasPropertyOverride) { @@ -418,6 +465,21 @@ private BinaryData SerializeBicep(ModelReaderWriterOptions options) } } + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(RunningState), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" runningState: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(RunningState)) + { + builder.Append(" runningState: "); + builder.AppendLine($"'{RunningState.Value.ToString()}'"); + } + } + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(EnvironmentId), out propertyOverride); if (hasPropertyOverride) { diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/ContainerAppJobData.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/ContainerAppJobData.cs index 40211d2d2de8..9527eaf0bb33 100644 --- a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/ContainerAppJobData.cs +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/ContainerAppJobData.cs @@ -65,8 +65,10 @@ public ContainerAppJobData(AzureLocation location) : base(location) /// The systemData. /// The tags. /// The location. + /// The complex type of the extended location. /// Managed identities needed by a container app job to interact with other Azure services to not maintain any secrets or credentials in code. /// Provisioning state of the Container Apps Job. + /// Current running state of the job. /// Resource ID of environment. /// Workload profile name to pin for container apps job execution. /// Container Apps Job configuration properties. @@ -74,10 +76,12 @@ public ContainerAppJobData(AzureLocation location) : base(location) /// Outbound IP Addresses of a container apps job. /// The endpoint of the eventstream of the container apps job. /// Keeps track of any properties unknown to the library. - internal ContainerAppJobData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, ManagedServiceIdentity identity, ContainerAppJobProvisioningState? provisioningState, string environmentId, string workloadProfileName, ContainerAppJobConfiguration configuration, ContainerAppJobTemplate template, IReadOnlyList outboundIPAddresses, string eventStreamEndpoint, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) + internal ContainerAppJobData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, ContainerAppExtendedLocation extendedLocation, ManagedServiceIdentity identity, ContainerAppJobProvisioningState? provisioningState, ContainerAppJobRunningState? runningState, string environmentId, string workloadProfileName, ContainerAppJobConfiguration configuration, ContainerAppJobTemplate template, IReadOnlyList outboundIPAddresses, string eventStreamEndpoint, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) { + ExtendedLocation = extendedLocation; Identity = identity; ProvisioningState = provisioningState; + RunningState = runningState; EnvironmentId = environmentId; WorkloadProfileName = workloadProfileName; Configuration = configuration; @@ -92,12 +96,18 @@ internal ContainerAppJobData() { } + /// The complex type of the extended location. + [WirePath("extendedLocation")] + public ContainerAppExtendedLocation ExtendedLocation { get; set; } /// Managed identities needed by a container app job to interact with other Azure services to not maintain any secrets or credentials in code. [WirePath("identity")] public ManagedServiceIdentity Identity { get; set; } /// Provisioning state of the Container Apps Job. [WirePath("properties.provisioningState")] public ContainerAppJobProvisioningState? ProvisioningState { get; } + /// Current running state of the job. + [WirePath("properties.runningState")] + public ContainerAppJobRunningState? RunningState { get; } /// Resource ID of environment. [WirePath("properties.environmentId")] public string EnvironmentId { get; set; } diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/ContainerAppJobDetectorCollection.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/ContainerAppJobDetectorCollection.cs index 6b35ce8e567f..e1cce6fe4273 100644 --- a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/ContainerAppJobDetectorCollection.cs +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/ContainerAppJobDetectorCollection.cs @@ -64,7 +64,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -109,7 +109,7 @@ public virtual async Task> GetAsync(st /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -154,7 +154,7 @@ public virtual Response Get(string detectorName /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -184,7 +184,7 @@ public virtual AsyncPageable GetAllAsync(Cancel /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -214,7 +214,7 @@ public virtual Pageable GetAll(CancellationToke /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -257,7 +257,7 @@ public virtual async Task> ExistsAsync(string detectorName, Cance /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -300,7 +300,7 @@ public virtual Response Exists(string detectorName, CancellationToken canc /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -345,7 +345,7 @@ public virtual async Task> Get /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/ContainerAppJobDetectorPropertyCollection.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/ContainerAppJobDetectorPropertyCollection.cs index 6e0a730f1ba8..f102266bae79 100644 --- a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/ContainerAppJobDetectorPropertyCollection.cs +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/ContainerAppJobDetectorPropertyCollection.cs @@ -61,7 +61,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -106,7 +106,7 @@ public virtual async Task> Get /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -151,7 +151,7 @@ public virtual Response Get(string apiN /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -194,7 +194,7 @@ public virtual async Task> ExistsAsync(string apiName, Cancellati /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -237,7 +237,7 @@ public virtual Response Exists(string apiName, CancellationToken cancellat /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -282,7 +282,7 @@ public virtual async Task /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/ContainerAppJobDetectorPropertyResource.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/ContainerAppJobDetectorPropertyResource.cs index b966b5ed9ffd..4f97f609d17a 100644 --- a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/ContainerAppJobDetectorPropertyResource.cs +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/ContainerAppJobDetectorPropertyResource.cs @@ -101,7 +101,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -141,7 +141,7 @@ public virtual async Task> Get /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/ContainerAppJobDetectorResource.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/ContainerAppJobDetectorResource.cs index 835425ad80b2..a4c0a4b3812e 100644 --- a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/ContainerAppJobDetectorResource.cs +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/ContainerAppJobDetectorResource.cs @@ -101,7 +101,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -141,7 +141,7 @@ public virtual async Task> GetAsync(Ca /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/ContainerAppJobExecutionCollection.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/ContainerAppJobExecutionCollection.cs index b9bc4e021241..bfe442ff79e9 100644 --- a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/ContainerAppJobExecutionCollection.cs +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/ContainerAppJobExecutionCollection.cs @@ -69,7 +69,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -114,7 +114,7 @@ public virtual async Task> GetAsync(s /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -159,7 +159,7 @@ public virtual Response Get(string jobExecutio /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -190,7 +190,7 @@ public virtual AsyncPageable GetAllAsync(strin /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -221,7 +221,7 @@ public virtual Pageable GetAll(string filter = /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -264,7 +264,7 @@ public virtual async Task> ExistsAsync(string jobExecutionName, C /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -307,7 +307,7 @@ public virtual Response Exists(string jobExecutionName, CancellationToken /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -352,7 +352,7 @@ public virtual async Task> Ge /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/ContainerAppJobExecutionData.Serialization.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/ContainerAppJobExecutionData.Serialization.cs index 6bc54e3743e2..6a52cad6185d 100644 --- a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/ContainerAppJobExecutionData.Serialization.cs +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/ContainerAppJobExecutionData.Serialization.cs @@ -60,6 +60,11 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri writer.WritePropertyName("template"u8); writer.WriteObjectValue(Template, options); } + if (Optional.IsDefined(DetailedStatus)) + { + writer.WritePropertyName("detailedStatus"u8); + writer.WriteObjectValue(DetailedStatus, options); + } writer.WriteEndObject(); } @@ -91,6 +96,7 @@ internal static ContainerAppJobExecutionData DeserializeContainerAppJobExecution DateTimeOffset? startTime = default; DateTimeOffset? endTime = default; ContainerAppJobExecutionTemplate template = default; + ExecutionStatus detailedStatus = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -164,6 +170,15 @@ internal static ContainerAppJobExecutionData DeserializeContainerAppJobExecution template = ContainerAppJobExecutionTemplate.DeserializeContainerAppJobExecutionTemplate(property0.Value, options); continue; } + if (property0.NameEquals("detailedStatus"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + detailedStatus = ExecutionStatus.DeserializeExecutionStatus(property0.Value, options); + continue; + } } continue; } @@ -182,6 +197,7 @@ internal static ContainerAppJobExecutionData DeserializeContainerAppJobExecution startTime, endTime, template, + detailedStatus, serializedAdditionalRawData); } @@ -313,6 +329,26 @@ private BinaryData SerializeBicep(ModelReaderWriterOptions options) } } + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue("DetailedStatusReplicas", out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" detailedStatus: "); + builder.AppendLine("{"); + builder.AppendLine(" detailedStatus: {"); + builder.Append(" replicas: "); + builder.AppendLine(propertyOverride); + builder.AppendLine(" }"); + builder.AppendLine(" }"); + } + else + { + if (Optional.IsDefined(DetailedStatus)) + { + builder.Append(" detailedStatus: "); + BicepSerializationHelpers.AppendChildObject(builder, DetailedStatus, options, 4, false, " detailedStatus: "); + } + } + builder.AppendLine(" }"); builder.AppendLine("}"); return BinaryData.FromString(builder.ToString()); diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/ContainerAppJobExecutionData.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/ContainerAppJobExecutionData.cs index a5d30844c2ed..f4f05ddd0e65 100644 --- a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/ContainerAppJobExecutionData.cs +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/ContainerAppJobExecutionData.cs @@ -65,13 +65,15 @@ internal ContainerAppJobExecutionData() /// Job execution start time. /// Job execution end time. /// Job's execution container. + /// Detailed status of the job execution. /// Keeps track of any properties unknown to the library. - internal ContainerAppJobExecutionData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, JobExecutionRunningState? status, DateTimeOffset? startOn, DateTimeOffset? endOn, ContainerAppJobExecutionTemplate template, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) + internal ContainerAppJobExecutionData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, JobExecutionRunningState? status, DateTimeOffset? startOn, DateTimeOffset? endOn, ContainerAppJobExecutionTemplate template, ExecutionStatus detailedStatus, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) { Status = status; StartOn = startOn; EndOn = endOn; Template = template; + DetailedStatus = detailedStatus; _serializedAdditionalRawData = serializedAdditionalRawData; } @@ -87,5 +89,13 @@ internal ContainerAppJobExecutionData(ResourceIdentifier id, string name, Resour /// Job's execution container. [WirePath("properties.template")] public ContainerAppJobExecutionTemplate Template { get; } + /// Detailed status of the job execution. + internal ExecutionStatus DetailedStatus { get; } + /// Replicas in the execution. + [WirePath("properties.detailedStatus.replicas")] + public IReadOnlyList DetailedStatusReplicas + { + get => DetailedStatus?.Replicas; + } } } diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/ContainerAppJobExecutionResource.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/ContainerAppJobExecutionResource.cs index ea5f462f4ae9..b1b8fab245cf 100644 --- a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/ContainerAppJobExecutionResource.cs +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/ContainerAppJobExecutionResource.cs @@ -105,7 +105,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -145,7 +145,7 @@ public virtual async Task> GetAsync(C /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -185,7 +185,7 @@ public virtual Response Get(CancellationToken /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// @@ -223,7 +223,7 @@ public virtual async Task StopExecutionJobAsync(WaitUntil waitUnti /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/ContainerAppJobResource.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/ContainerAppJobResource.cs index ed4ef4b990c8..a74089fe7400 100644 --- a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/ContainerAppJobResource.cs +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/ContainerAppJobResource.cs @@ -111,7 +111,7 @@ public virtual ContainerAppJobDetectorCollection GetContainerAppJobDetectors() /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -142,7 +142,7 @@ public virtual async Task> GetContaine /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -180,7 +180,7 @@ public virtual ContainerAppJobDetectorPropertyCollection GetContainerAppJobDetec /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -211,7 +211,7 @@ public virtual async Task> Get /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -249,7 +249,7 @@ public virtual ContainerAppJobExecutionCollection GetContainerAppJobExecutions() /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -280,7 +280,7 @@ public virtual async Task> GetContain /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -311,7 +311,7 @@ public virtual Response GetContainerAppJobExec /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -351,7 +351,7 @@ public virtual async Task> GetAsync(Cancellati /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -391,7 +391,7 @@ public virtual Response Get(CancellationToken cancellat /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -433,7 +433,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -475,7 +475,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -521,7 +521,7 @@ public virtual async Task> UpdateAsync(Wai /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -567,7 +567,7 @@ public virtual ArmOperation Update(WaitUntil waitUntil, /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -610,7 +610,7 @@ public virtual async Task> StartAsync /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -653,7 +653,7 @@ public virtual ArmOperation Start(WaitUntil waitUn /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -695,7 +695,7 @@ public virtual async Task> StopMultipleE /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -737,7 +737,7 @@ public virtual ArmOperation StopMultipleExecutions(Wa /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -766,7 +766,7 @@ public virtual AsyncPageable GetSecretsAsync(Cancell /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -782,6 +782,174 @@ public virtual Pageable GetSecrets(CancellationToken return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, null, e => ContainerAppWritableSecret.DeserializeContainerAppWritableSecret(e), _containerAppJobJobsClientDiagnostics, Pipeline, "ContainerAppJobResource.GetSecrets", "value", null, cancellationToken); } + /// + /// Resumes a suspended job + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/jobs/{jobName}/resume + /// + /// + /// Operation Id + /// Jobs_Resume + /// + /// + /// Default Api Version + /// 2025-02-02-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// 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> ResumeAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default) + { + using var scope = _containerAppJobJobsClientDiagnostics.CreateScope("ContainerAppJobResource.Resume"); + scope.Start(); + try + { + var response = await _containerAppJobJobsRestClient.ResumeAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + var operation = new AppContainersArmOperation(new ContainerAppJobOperationSource(Client), _containerAppJobJobsClientDiagnostics, Pipeline, _containerAppJobJobsRestClient.CreateResumeRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Resumes a suspended job + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/jobs/{jobName}/resume + /// + /// + /// Operation Id + /// Jobs_Resume + /// + /// + /// Default Api Version + /// 2025-02-02-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// 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 Resume(WaitUntil waitUntil, CancellationToken cancellationToken = default) + { + using var scope = _containerAppJobJobsClientDiagnostics.CreateScope("ContainerAppJobResource.Resume"); + scope.Start(); + try + { + var response = _containerAppJobJobsRestClient.Resume(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + var operation = new AppContainersArmOperation(new ContainerAppJobOperationSource(Client), _containerAppJobJobsClientDiagnostics, Pipeline, _containerAppJobJobsRestClient.CreateResumeRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Suspends a job + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/jobs/{jobName}/suspend + /// + /// + /// Operation Id + /// Jobs_Suspend + /// + /// + /// Default Api Version + /// 2025-02-02-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// 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> SuspendAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default) + { + using var scope = _containerAppJobJobsClientDiagnostics.CreateScope("ContainerAppJobResource.Suspend"); + scope.Start(); + try + { + var response = await _containerAppJobJobsRestClient.SuspendAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + var operation = new AppContainersArmOperation(new ContainerAppJobOperationSource(Client), _containerAppJobJobsClientDiagnostics, Pipeline, _containerAppJobJobsRestClient.CreateSuspendRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Suspends a job + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/jobs/{jobName}/suspend + /// + /// + /// Operation Id + /// Jobs_Suspend + /// + /// + /// Default Api Version + /// 2025-02-02-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// 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 Suspend(WaitUntil waitUntil, CancellationToken cancellationToken = default) + { + using var scope = _containerAppJobJobsClientDiagnostics.CreateScope("ContainerAppJobResource.Suspend"); + scope.Start(); + try + { + var response = _containerAppJobJobsRestClient.Suspend(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + var operation = new AppContainersArmOperation(new ContainerAppJobOperationSource(Client), _containerAppJobJobsClientDiagnostics, Pipeline, _containerAppJobJobsRestClient.CreateSuspendRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + /// /// Add a tag to the current resource. /// @@ -795,7 +963,7 @@ public virtual Pageable GetSecrets(CancellationToken /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -857,7 +1025,7 @@ public virtual async Task> AddTagAsync(string /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -919,7 +1087,7 @@ public virtual Response AddTag(string key, string value /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -976,7 +1144,7 @@ public virtual async Task> SetTagsAsync(IDicti /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -1033,7 +1201,7 @@ public virtual Response SetTags(IDictionary /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -1093,7 +1261,7 @@ public virtual async Task> RemoveTagAsync(stri /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/ContainerAppManagedCertificateCollection.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/ContainerAppManagedCertificateCollection.cs index 05c48fc882c5..d810b1982a18 100644 --- a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/ContainerAppManagedCertificateCollection.cs +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/ContainerAppManagedCertificateCollection.cs @@ -64,7 +64,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -113,7 +113,7 @@ public virtual async Task> /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -162,7 +162,7 @@ public virtual ArmOperation CreateOrUpda /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -207,7 +207,7 @@ public virtual async Task> GetA /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -252,7 +252,7 @@ public virtual Response Get(string manag /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -282,7 +282,7 @@ public virtual AsyncPageable GetAllAsync /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -312,7 +312,7 @@ public virtual Pageable GetAll(Cancellat /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -355,7 +355,7 @@ public virtual async Task> ExistsAsync(string managedCertificateN /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -398,7 +398,7 @@ public virtual Response Exists(string managedCertificateName, Cancellation /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -443,7 +443,7 @@ public virtual async Task /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/ContainerAppManagedCertificateResource.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/ContainerAppManagedCertificateResource.cs index 3b1c21abfbeb..841e317eda89 100644 --- a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/ContainerAppManagedCertificateResource.cs +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/ContainerAppManagedCertificateResource.cs @@ -103,7 +103,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -143,7 +143,7 @@ public virtual async Task> GetA /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -183,7 +183,7 @@ public virtual Response Get(Cancellation /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -227,7 +227,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -271,7 +271,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -313,7 +313,7 @@ public virtual async Task> Upda /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -355,7 +355,7 @@ public virtual Response Update(Container /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -417,7 +417,7 @@ public virtual async Task> AddT /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -479,7 +479,7 @@ public virtual Response AddTag(string ke /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -536,7 +536,7 @@ public virtual async Task> SetT /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -593,7 +593,7 @@ public virtual Response SetTags(IDiction /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -653,7 +653,7 @@ public virtual async Task> Remo /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/ContainerAppManagedEnvironmentCertificateCollection.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/ContainerAppManagedEnvironmentCertificateCollection.cs index bf2fa6f38859..191f711a8330 100644 --- a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/ContainerAppManagedEnvironmentCertificateCollection.cs +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/ContainerAppManagedEnvironmentCertificateCollection.cs @@ -64,7 +64,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -115,7 +115,7 @@ public virtual async Task /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -166,7 +166,7 @@ public virtual ArmOperation C /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -211,7 +211,7 @@ public virtual async Task /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -256,7 +256,7 @@ public virtual Response Get(s /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -286,7 +286,7 @@ public virtual AsyncPageable /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -316,7 +316,7 @@ public virtual Pageable GetAl /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -359,7 +359,7 @@ public virtual async Task> ExistsAsync(string certificateName, Ca /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -402,7 +402,7 @@ public virtual Response Exists(string certificateName, CancellationToken c /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -447,7 +447,7 @@ public virtual async Task /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/ContainerAppManagedEnvironmentCertificateResource.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/ContainerAppManagedEnvironmentCertificateResource.cs index cd8e5bf49f3c..29859e346f68 100644 --- a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/ContainerAppManagedEnvironmentCertificateResource.cs +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/ContainerAppManagedEnvironmentCertificateResource.cs @@ -103,7 +103,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -143,7 +143,7 @@ public virtual async Task /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -183,7 +183,7 @@ public virtual Response Get(C /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -227,7 +227,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -271,7 +271,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -313,7 +313,7 @@ public virtual async Task /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -355,7 +355,7 @@ public virtual Response Updat /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -417,7 +417,7 @@ public virtual async Task /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -479,7 +479,7 @@ public virtual Response AddTa /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -536,7 +536,7 @@ public virtual async Task /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -593,7 +593,7 @@ public virtual Response SetTa /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -653,7 +653,7 @@ public virtual async Task /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/ContainerAppManagedEnvironmentCollection.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/ContainerAppManagedEnvironmentCollection.cs index faa86f727886..651251f7e1b9 100644 --- a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/ContainerAppManagedEnvironmentCollection.cs +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/ContainerAppManagedEnvironmentCollection.cs @@ -65,7 +65,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -114,7 +114,7 @@ public virtual async Task> /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -163,7 +163,7 @@ public virtual ArmOperation CreateOrUpda /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -208,7 +208,7 @@ public virtual async Task> GetA /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -253,7 +253,7 @@ public virtual Response Get(string envir /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -283,7 +283,7 @@ public virtual AsyncPageable GetAllAsync /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -313,7 +313,7 @@ public virtual Pageable GetAll(Cancellat /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -356,7 +356,7 @@ public virtual async Task> ExistsAsync(string environmentName, Ca /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -399,7 +399,7 @@ public virtual Response Exists(string environmentName, CancellationToken c /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -444,7 +444,7 @@ public virtual async Task /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/ContainerAppManagedEnvironmentDaprComponentCollection.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/ContainerAppManagedEnvironmentDaprComponentCollection.cs index 7aaf0b08b791..80c7e0ba0079 100644 --- a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/ContainerAppManagedEnvironmentDaprComponentCollection.cs +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/ContainerAppManagedEnvironmentDaprComponentCollection.cs @@ -64,7 +64,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -115,7 +115,7 @@ public virtual async Task /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -166,7 +166,7 @@ public virtual ArmOperation /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -211,7 +211,7 @@ public virtual async Task /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -256,7 +256,7 @@ public virtual Response Get /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -286,7 +286,7 @@ public virtual AsyncPageable /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -316,7 +316,7 @@ public virtual Pageable Get /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -359,7 +359,7 @@ public virtual async Task> ExistsAsync(string componentName, Canc /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -402,7 +402,7 @@ public virtual Response Exists(string componentName, CancellationToken can /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -447,7 +447,7 @@ public virtual async Task /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/ContainerAppManagedEnvironmentDaprComponentResource.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/ContainerAppManagedEnvironmentDaprComponentResource.cs index 440467a5ae26..8fb9daed466e 100644 --- a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/ContainerAppManagedEnvironmentDaprComponentResource.cs +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/ContainerAppManagedEnvironmentDaprComponentResource.cs @@ -90,6 +90,75 @@ internal static void ValidateResourceId(ResourceIdentifier id) throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceType), nameof(id)); } + /// Gets a collection of DaprComponentResiliencyPolicyResources in the ContainerAppManagedEnvironmentDaprComponent. + /// An object representing collection of DaprComponentResiliencyPolicyResources and their operations over a DaprComponentResiliencyPolicyResource. + public virtual DaprComponentResiliencyPolicyCollection GetDaprComponentResiliencyPolicies() + { + return GetCachedClient(client => new DaprComponentResiliencyPolicyCollection(client, Id)); + } + + /// + /// Get a Dapr component resiliency policy. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/daprComponents/{componentName}/resiliencyPolicies/{name} + /// + /// + /// Operation Id + /// DaprComponentResiliencyPolicies_Get + /// + /// + /// Default Api Version + /// 2025-02-02-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the Dapr Component Resiliency Policy. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetDaprComponentResiliencyPolicyAsync(string name, CancellationToken cancellationToken = default) + { + return await GetDaprComponentResiliencyPolicies().GetAsync(name, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get a Dapr component resiliency policy. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/daprComponents/{componentName}/resiliencyPolicies/{name} + /// + /// + /// Operation Id + /// DaprComponentResiliencyPolicies_Get + /// + /// + /// Default Api Version + /// 2025-02-02-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the Dapr Component Resiliency Policy. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetDaprComponentResiliencyPolicy(string name, CancellationToken cancellationToken = default) + { + return GetDaprComponentResiliencyPolicies().Get(name, cancellationToken); + } + /// /// Get a dapr component. /// @@ -103,7 +172,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -143,7 +212,7 @@ public virtual async Task /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -183,7 +252,7 @@ public virtual Response Get /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -227,7 +296,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -271,7 +340,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -319,7 +388,7 @@ public virtual async Task /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -367,7 +436,7 @@ public virtual ArmOperation /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -396,7 +465,7 @@ public virtual AsyncPageable GetSecretsAsync(Cancellatio /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/ContainerAppManagedEnvironmentData.Serialization.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/ContainerAppManagedEnvironmentData.Serialization.cs index 6d0980906bc3..aacaab49dd13 100644 --- a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/ContainerAppManagedEnvironmentData.Serialization.cs +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/ContainerAppManagedEnvironmentData.Serialization.cs @@ -83,6 +83,11 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri writer.WritePropertyName("defaultDomain"u8); writer.WriteStringValue(DefaultDomain); } + if (options.Format != "W" && Optional.IsDefined(PrivateLinkDefaultDomain)) + { + writer.WritePropertyName("privateLinkDefaultDomain"u8); + writer.WriteStringValue(PrivateLinkDefaultDomain); + } if (options.Format != "W" && Optional.IsDefined(StaticIP)) { writer.WritePropertyName("staticIp"u8); @@ -93,11 +98,31 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri writer.WritePropertyName("appLogsConfiguration"u8); writer.WriteObjectValue(AppLogsConfiguration, options); } + if (Optional.IsDefined(AppInsightsConfiguration)) + { + writer.WritePropertyName("appInsightsConfiguration"u8); + writer.WriteObjectValue(AppInsightsConfiguration, options); + } + if (Optional.IsDefined(OpenTelemetryConfiguration)) + { + writer.WritePropertyName("openTelemetryConfiguration"u8); + writer.WriteObjectValue(OpenTelemetryConfiguration, options); + } if (Optional.IsDefined(IsZoneRedundant)) { writer.WritePropertyName("zoneRedundant"u8); writer.WriteBooleanValue(IsZoneRedundant.Value); } + if (Optional.IsCollectionDefined(AvailabilityZones)) + { + writer.WritePropertyName("availabilityZones"u8); + writer.WriteStartArray(); + foreach (var item in AvailabilityZones) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } if (Optional.IsDefined(CustomDomainConfiguration)) { writer.WritePropertyName("customDomainConfiguration"u8); @@ -143,6 +168,31 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri writer.WritePropertyName("peerTrafficConfiguration"u8); writer.WriteObjectValue(PeerTrafficConfiguration, options); } + if (Optional.IsDefined(IngressConfiguration)) + { + writer.WritePropertyName("ingressConfiguration"u8); + writer.WriteObjectValue(IngressConfiguration, options); + } + if (options.Format != "W" && Optional.IsCollectionDefined(PrivateEndpointConnections)) + { + writer.WritePropertyName("privateEndpointConnections"u8); + writer.WriteStartArray(); + foreach (var item in PrivateEndpointConnections) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(PublicNetworkAccess)) + { + writer.WritePropertyName("publicNetworkAccess"u8); + writer.WriteStringValue(PublicNetworkAccess.Value.ToString()); + } + if (Optional.IsDefined(DiskEncryptionConfiguration)) + { + writer.WritePropertyName("diskEncryptionConfiguration"u8); + writer.WriteObjectValue(DiskEncryptionConfiguration, options); + } writer.WriteEndObject(); } @@ -180,9 +230,13 @@ internal static ContainerAppManagedEnvironmentData DeserializeContainerAppManage ContainerAppVnetConfiguration vnetConfiguration = default; string deploymentErrors = default; string defaultDomain = default; + string privateLinkDefaultDomain = default; IPAddress staticIP = default; ContainerAppLogsConfiguration appLogsConfiguration = default; + AppInsightsConfiguration appInsightsConfiguration = default; + OpenTelemetryConfiguration openTelemetryConfiguration = default; bool? zoneRedundant = default; + IList availabilityZones = default; ContainerAppCustomDomainConfiguration customDomainConfiguration = default; string eventStreamEndpoint = default; IList workloadProfiles = default; @@ -191,6 +245,10 @@ internal static ContainerAppManagedEnvironmentData DeserializeContainerAppManage string infrastructureResourceGroup = default; ManagedEnvironmentPropertiesPeerAuthentication peerAuthentication = default; ManagedEnvironmentPropertiesPeerTrafficConfiguration peerTrafficConfiguration = default; + IngressConfiguration ingressConfiguration = default; + IReadOnlyList privateEndpointConnections = default; + PublicNetworkAccess? publicNetworkAccess = default; + DiskEncryptionConfiguration diskEncryptionConfiguration = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -300,6 +358,11 @@ internal static ContainerAppManagedEnvironmentData DeserializeContainerAppManage defaultDomain = property0.Value.GetString(); continue; } + if (property0.NameEquals("privateLinkDefaultDomain"u8)) + { + privateLinkDefaultDomain = property0.Value.GetString(); + continue; + } if (property0.NameEquals("staticIp"u8)) { if (property0.Value.ValueKind == JsonValueKind.Null) @@ -318,6 +381,24 @@ internal static ContainerAppManagedEnvironmentData DeserializeContainerAppManage appLogsConfiguration = ContainerAppLogsConfiguration.DeserializeContainerAppLogsConfiguration(property0.Value, options); continue; } + if (property0.NameEquals("appInsightsConfiguration"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + appInsightsConfiguration = AppInsightsConfiguration.DeserializeAppInsightsConfiguration(property0.Value, options); + continue; + } + if (property0.NameEquals("openTelemetryConfiguration"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + openTelemetryConfiguration = OpenTelemetryConfiguration.DeserializeOpenTelemetryConfiguration(property0.Value, options); + continue; + } if (property0.NameEquals("zoneRedundant"u8)) { if (property0.Value.ValueKind == JsonValueKind.Null) @@ -327,6 +408,20 @@ internal static ContainerAppManagedEnvironmentData DeserializeContainerAppManage zoneRedundant = property0.Value.GetBoolean(); continue; } + if (property0.NameEquals("availabilityZones"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property0.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + availabilityZones = array; + continue; + } if (property0.NameEquals("customDomainConfiguration"u8)) { if (property0.Value.ValueKind == JsonValueKind.Null) @@ -396,6 +491,47 @@ internal static ContainerAppManagedEnvironmentData DeserializeContainerAppManage peerTrafficConfiguration = ManagedEnvironmentPropertiesPeerTrafficConfiguration.DeserializeManagedEnvironmentPropertiesPeerTrafficConfiguration(property0.Value, options); continue; } + if (property0.NameEquals("ingressConfiguration"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + ingressConfiguration = IngressConfiguration.DeserializeIngressConfiguration(property0.Value, options); + continue; + } + if (property0.NameEquals("privateEndpointConnections"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property0.Value.EnumerateArray()) + { + array.Add(AppContainersPrivateEndpointConnectionData.DeserializeAppContainersPrivateEndpointConnectionData(item, options)); + } + privateEndpointConnections = array; + continue; + } + if (property0.NameEquals("publicNetworkAccess"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + publicNetworkAccess = new PublicNetworkAccess(property0.Value.GetString()); + continue; + } + if (property0.NameEquals("diskEncryptionConfiguration"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + diskEncryptionConfiguration = DiskEncryptionConfiguration.DeserializeDiskEncryptionConfiguration(property0.Value, options); + continue; + } } continue; } @@ -420,9 +556,13 @@ internal static ContainerAppManagedEnvironmentData DeserializeContainerAppManage vnetConfiguration, deploymentErrors, defaultDomain, + privateLinkDefaultDomain, staticIP, appLogsConfiguration, + appInsightsConfiguration, + openTelemetryConfiguration, zoneRedundant, + availabilityZones ?? new ChangeTrackingList(), customDomainConfiguration, eventStreamEndpoint, workloadProfiles ?? new ChangeTrackingList(), @@ -431,6 +571,10 @@ internal static ContainerAppManagedEnvironmentData DeserializeContainerAppManage infrastructureResourceGroup, peerAuthentication, peerTrafficConfiguration, + ingressConfiguration, + privateEndpointConnections ?? new ChangeTrackingList(), + publicNetworkAccess, + diskEncryptionConfiguration, serializedAdditionalRawData); } @@ -709,6 +853,29 @@ private BinaryData SerializeBicep(ModelReaderWriterOptions options) } } + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(PrivateLinkDefaultDomain), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" privateLinkDefaultDomain: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(PrivateLinkDefaultDomain)) + { + builder.Append(" privateLinkDefaultDomain: "); + if (PrivateLinkDefaultDomain.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{PrivateLinkDefaultDomain}'''"); + } + else + { + builder.AppendLine($"'{PrivateLinkDefaultDomain}'"); + } + } + } + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(StaticIP), out propertyOverride); if (hasPropertyOverride) { @@ -739,6 +906,41 @@ private BinaryData SerializeBicep(ModelReaderWriterOptions options) } } + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue("AppInsightsConnectionString", out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" appInsightsConfiguration: "); + builder.AppendLine("{"); + builder.AppendLine(" appInsightsConfiguration: {"); + builder.Append(" connectionString: "); + builder.AppendLine(propertyOverride); + builder.AppendLine(" }"); + builder.AppendLine(" }"); + } + else + { + if (Optional.IsDefined(AppInsightsConfiguration)) + { + builder.Append(" appInsightsConfiguration: "); + BicepSerializationHelpers.AppendChildObject(builder, AppInsightsConfiguration, options, 4, false, " appInsightsConfiguration: "); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(OpenTelemetryConfiguration), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" openTelemetryConfiguration: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(OpenTelemetryConfiguration)) + { + builder.Append(" openTelemetryConfiguration: "); + BicepSerializationHelpers.AppendChildObject(builder, OpenTelemetryConfiguration, options, 4, false, " openTelemetryConfiguration: "); + } + } + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(IsZoneRedundant), out propertyOverride); if (hasPropertyOverride) { @@ -755,6 +957,42 @@ private BinaryData SerializeBicep(ModelReaderWriterOptions options) } } + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(AvailabilityZones), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" availabilityZones: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsCollectionDefined(AvailabilityZones)) + { + if (AvailabilityZones.Any()) + { + builder.Append(" availabilityZones: "); + builder.AppendLine("["); + foreach (var item in AvailabilityZones) + { + if (item == null) + { + builder.Append("null"); + continue; + } + if (item.Contains(Environment.NewLine)) + { + builder.AppendLine(" '''"); + builder.AppendLine($"{item}'''"); + } + else + { + builder.AppendLine($" '{item}'"); + } + } + builder.AppendLine(" ]"); + } + } + } + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(CustomDomainConfiguration), out propertyOverride); if (hasPropertyOverride) { @@ -923,6 +1161,79 @@ private BinaryData SerializeBicep(ModelReaderWriterOptions options) } } + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(IngressConfiguration), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" ingressConfiguration: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(IngressConfiguration)) + { + builder.Append(" ingressConfiguration: "); + BicepSerializationHelpers.AppendChildObject(builder, IngressConfiguration, options, 4, false, " ingressConfiguration: "); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(PrivateEndpointConnections), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" privateEndpointConnections: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsCollectionDefined(PrivateEndpointConnections)) + { + if (PrivateEndpointConnections.Any()) + { + builder.Append(" privateEndpointConnections: "); + builder.AppendLine("["); + foreach (var item in PrivateEndpointConnections) + { + BicepSerializationHelpers.AppendChildObject(builder, item, options, 6, true, " privateEndpointConnections: "); + } + builder.AppendLine(" ]"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(PublicNetworkAccess), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" publicNetworkAccess: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(PublicNetworkAccess)) + { + builder.Append(" publicNetworkAccess: "); + builder.AppendLine($"'{PublicNetworkAccess.Value.ToString()}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue("DiskEncryptionKeyVaultConfiguration", out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" diskEncryptionConfiguration: "); + builder.AppendLine("{"); + builder.AppendLine(" diskEncryptionConfiguration: {"); + builder.Append(" keyVaultConfiguration: "); + builder.AppendLine(propertyOverride); + builder.AppendLine(" }"); + builder.AppendLine(" }"); + } + else + { + if (Optional.IsDefined(DiskEncryptionConfiguration)) + { + builder.Append(" diskEncryptionConfiguration: "); + BicepSerializationHelpers.AppendChildObject(builder, DiskEncryptionConfiguration, options, 4, false, " diskEncryptionConfiguration: "); + } + } + builder.AppendLine(" }"); builder.AppendLine("}"); return BinaryData.FromString(builder.ToString()); diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/ContainerAppManagedEnvironmentData.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/ContainerAppManagedEnvironmentData.cs index ed081bbc255a..d873927adf7c 100644 --- a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/ContainerAppManagedEnvironmentData.cs +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/ContainerAppManagedEnvironmentData.cs @@ -56,7 +56,9 @@ public partial class ContainerAppManagedEnvironmentData : TrackedResourceData /// The location. public ContainerAppManagedEnvironmentData(AzureLocation location) : base(location) { + AvailabilityZones = new ChangeTrackingList(); WorkloadProfiles = new ChangeTrackingList(); + PrivateEndpointConnections = new ChangeTrackingList(); } /// Initializes a new instance of . @@ -74,9 +76,13 @@ public ContainerAppManagedEnvironmentData(AzureLocation location) : base(locatio /// Vnet configuration for the environment. /// Any errors that occurred during deployment or deployment validation. /// Default Domain Name for the cluster. + /// Private Link Default Domain Name for the environment. /// Static IP of the Environment. /// Cluster configuration which enables the log daemon to export app logs to configured destination. + /// Environment level Application Insights configuration. + /// Environment Open Telemetry configuration. /// Whether or not this Managed Environment is zone-redundant. + /// The list of availability zones to use for managed environment. /// Custom domain configuration for the environment. /// The endpoint of the eventstream of the Environment. /// Workload profiles configured for the Managed Environment. @@ -85,8 +91,12 @@ public ContainerAppManagedEnvironmentData(AzureLocation location) : base(locatio /// Name of the platform-managed resource group created for the Managed Environment to host infrastructure resources. If a subnet ID is provided, this resource group will be created in the same subscription as the subnet. /// Peer authentication settings for the Managed Environment. /// Peer traffic settings for the Managed Environment. + /// Ingress configuration for the Managed Environment. + /// Private endpoint connections to the resource. + /// Property to allow or block all public traffic. Allowed Values: 'Enabled', 'Disabled'. + /// Disk encryption configuration for the Managed Environment. /// Keeps track of any properties unknown to the library. - internal ContainerAppManagedEnvironmentData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, string kind, ManagedServiceIdentity identity, ContainerAppEnvironmentProvisioningState? provisioningState, string daprAIInstrumentationKey, string daprAIConnectionString, ContainerAppVnetConfiguration vnetConfiguration, string deploymentErrors, string defaultDomain, IPAddress staticIP, ContainerAppLogsConfiguration appLogsConfiguration, bool? isZoneRedundant, ContainerAppCustomDomainConfiguration customDomainConfiguration, string eventStreamEndpoint, IList workloadProfiles, KedaConfiguration kedaConfiguration, DaprConfiguration daprConfiguration, string infrastructureResourceGroup, ManagedEnvironmentPropertiesPeerAuthentication peerAuthentication, ManagedEnvironmentPropertiesPeerTrafficConfiguration peerTrafficConfiguration, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) + internal ContainerAppManagedEnvironmentData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, string kind, ManagedServiceIdentity identity, ContainerAppEnvironmentProvisioningState? provisioningState, string daprAIInstrumentationKey, string daprAIConnectionString, ContainerAppVnetConfiguration vnetConfiguration, string deploymentErrors, string defaultDomain, string privateLinkDefaultDomain, IPAddress staticIP, ContainerAppLogsConfiguration appLogsConfiguration, AppInsightsConfiguration appInsightsConfiguration, OpenTelemetryConfiguration openTelemetryConfiguration, bool? isZoneRedundant, IList availabilityZones, ContainerAppCustomDomainConfiguration customDomainConfiguration, string eventStreamEndpoint, IList workloadProfiles, KedaConfiguration kedaConfiguration, DaprConfiguration daprConfiguration, string infrastructureResourceGroup, ManagedEnvironmentPropertiesPeerAuthentication peerAuthentication, ManagedEnvironmentPropertiesPeerTrafficConfiguration peerTrafficConfiguration, IngressConfiguration ingressConfiguration, IReadOnlyList privateEndpointConnections, PublicNetworkAccess? publicNetworkAccess, DiskEncryptionConfiguration diskEncryptionConfiguration, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) { Kind = kind; Identity = identity; @@ -96,9 +106,13 @@ internal ContainerAppManagedEnvironmentData(ResourceIdentifier id, string name, VnetConfiguration = vnetConfiguration; DeploymentErrors = deploymentErrors; DefaultDomain = defaultDomain; + PrivateLinkDefaultDomain = privateLinkDefaultDomain; StaticIP = staticIP; AppLogsConfiguration = appLogsConfiguration; + AppInsightsConfiguration = appInsightsConfiguration; + OpenTelemetryConfiguration = openTelemetryConfiguration; IsZoneRedundant = isZoneRedundant; + AvailabilityZones = availabilityZones; CustomDomainConfiguration = customDomainConfiguration; EventStreamEndpoint = eventStreamEndpoint; WorkloadProfiles = workloadProfiles; @@ -107,6 +121,10 @@ internal ContainerAppManagedEnvironmentData(ResourceIdentifier id, string name, InfrastructureResourceGroup = infrastructureResourceGroup; PeerAuthentication = peerAuthentication; PeerTrafficConfiguration = peerTrafficConfiguration; + IngressConfiguration = ingressConfiguration; + PrivateEndpointConnections = privateEndpointConnections; + PublicNetworkAccess = publicNetworkAccess; + DiskEncryptionConfiguration = diskEncryptionConfiguration; _serializedAdditionalRawData = serializedAdditionalRawData; } @@ -139,15 +157,39 @@ internal ContainerAppManagedEnvironmentData() /// Default Domain Name for the cluster. [WirePath("properties.defaultDomain")] public string DefaultDomain { get; } + /// Private Link Default Domain Name for the environment. + [WirePath("properties.privateLinkDefaultDomain")] + public string PrivateLinkDefaultDomain { get; } /// Static IP of the Environment. [WirePath("properties.staticIp")] public IPAddress StaticIP { get; } /// Cluster configuration which enables the log daemon to export app logs to configured destination. [WirePath("properties.appLogsConfiguration")] public ContainerAppLogsConfiguration AppLogsConfiguration { get; set; } + /// Environment level Application Insights configuration. + internal AppInsightsConfiguration AppInsightsConfiguration { get; set; } + /// Application Insights connection string. + [WirePath("properties.appInsightsConfiguration.connectionString")] + public string AppInsightsConnectionString + { + get => AppInsightsConfiguration is null ? default : AppInsightsConfiguration.ConnectionString; + set + { + if (AppInsightsConfiguration is null) + AppInsightsConfiguration = new AppInsightsConfiguration(); + AppInsightsConfiguration.ConnectionString = value; + } + } + + /// Environment Open Telemetry configuration. + [WirePath("properties.openTelemetryConfiguration")] + public OpenTelemetryConfiguration OpenTelemetryConfiguration { get; set; } /// Whether or not this Managed Environment is zone-redundant. [WirePath("properties.zoneRedundant")] public bool? IsZoneRedundant { get; set; } + /// The list of availability zones to use for managed environment. + [WirePath("properties.availabilityZones")] + public IList AvailabilityZones { get; } /// Custom domain configuration for the environment. [WirePath("properties.customDomainConfiguration")] public ContainerAppCustomDomainConfiguration CustomDomainConfiguration { get; set; } @@ -207,5 +249,29 @@ public bool? IsEnabled PeerTrafficConfiguration.IsEnabled = value; } } + + /// Ingress configuration for the Managed Environment. + [WirePath("properties.ingressConfiguration")] + public IngressConfiguration IngressConfiguration { get; set; } + /// Private endpoint connections to the resource. + [WirePath("properties.privateEndpointConnections")] + public IReadOnlyList PrivateEndpointConnections { get; } + /// Property to allow or block all public traffic. Allowed Values: 'Enabled', 'Disabled'. + [WirePath("properties.publicNetworkAccess")] + public PublicNetworkAccess? PublicNetworkAccess { get; set; } + /// Disk encryption configuration for the Managed Environment. + internal DiskEncryptionConfiguration DiskEncryptionConfiguration { get; set; } + /// The Key Vault that contains your key to use for disk encryption. The Key Vault must be in the same region as the Managed Environment. + [WirePath("properties.diskEncryptionConfiguration.keyVaultConfiguration")] + public DiskEncryptionConfigurationKeyVaultConfiguration DiskEncryptionKeyVaultConfiguration + { + get => DiskEncryptionConfiguration is null ? default : DiskEncryptionConfiguration.KeyVaultConfiguration; + set + { + if (DiskEncryptionConfiguration is null) + DiskEncryptionConfiguration = new DiskEncryptionConfiguration(); + DiskEncryptionConfiguration.KeyVaultConfiguration = value; + } + } } } diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/ContainerAppManagedEnvironmentDetectorCollection.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/ContainerAppManagedEnvironmentDetectorCollection.cs index 264df6d0d9ca..d4ed443c6c40 100644 --- a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/ContainerAppManagedEnvironmentDetectorCollection.cs +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/ContainerAppManagedEnvironmentDetectorCollection.cs @@ -64,7 +64,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -109,7 +109,7 @@ public virtual async Task /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -154,7 +154,7 @@ public virtual Response Get(stri /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -183,7 +183,7 @@ public virtual AsyncPageable Get /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -212,7 +212,7 @@ public virtual Pageable GetAll(C /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -255,7 +255,7 @@ public virtual async Task> ExistsAsync(string detectorName, Cance /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -298,7 +298,7 @@ public virtual Response Exists(string detectorName, CancellationToken canc /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -343,7 +343,7 @@ public virtual async Task /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/ContainerAppManagedEnvironmentDetectorResource.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/ContainerAppManagedEnvironmentDetectorResource.cs index e8dd1db7bbed..5820120164da 100644 --- a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/ContainerAppManagedEnvironmentDetectorResource.cs +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/ContainerAppManagedEnvironmentDetectorResource.cs @@ -101,7 +101,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -141,7 +141,7 @@ public virtual async Task /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/ContainerAppManagedEnvironmentDetectorResourcePropertyResource.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/ContainerAppManagedEnvironmentDetectorResourcePropertyResource.cs index 1882f220fd4f..fcf009bfad02 100644 --- a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/ContainerAppManagedEnvironmentDetectorResourcePropertyResource.cs +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/ContainerAppManagedEnvironmentDetectorResourcePropertyResource.cs @@ -100,7 +100,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -140,7 +140,7 @@ public virtual async Task /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/ContainerAppManagedEnvironmentResource.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/ContainerAppManagedEnvironmentResource.cs index e37796212554..5b2f251b8ec2 100644 --- a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/ContainerAppManagedEnvironmentResource.cs +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/ContainerAppManagedEnvironmentResource.cs @@ -40,6 +40,8 @@ public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, private readonly ManagedEnvironmentsRestOperations _containerAppManagedEnvironmentManagedEnvironmentsRestClient; private readonly ClientDiagnostics _namespacesClientDiagnostics; private readonly NamespacesRestOperations _namespacesRestClient; + private readonly ClientDiagnostics _managedEnvironmentPrivateLinkResourcesClientDiagnostics; + private readonly ManagedEnvironmentPrivateLinkResourcesRestOperations _managedEnvironmentPrivateLinkResourcesRestClient; private readonly ClientDiagnostics _managedEnvironmentUsagesClientDiagnostics; private readonly ManagedEnvironmentUsagesRestOperations _managedEnvironmentUsagesRestClient; private readonly ContainerAppManagedEnvironmentData _data; @@ -71,6 +73,8 @@ internal ContainerAppManagedEnvironmentResource(ArmClient client, ResourceIdenti _containerAppManagedEnvironmentManagedEnvironmentsRestClient = new ManagedEnvironmentsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, containerAppManagedEnvironmentManagedEnvironmentsApiVersion); _namespacesClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.AppContainers", ProviderConstants.DefaultProviderNamespace, Diagnostics); _namespacesRestClient = new NamespacesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint); + _managedEnvironmentPrivateLinkResourcesClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.AppContainers", ProviderConstants.DefaultProviderNamespace, Diagnostics); + _managedEnvironmentPrivateLinkResourcesRestClient = new ManagedEnvironmentPrivateLinkResourcesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint); _managedEnvironmentUsagesClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.AppContainers", ProviderConstants.DefaultProviderNamespace, Diagnostics); _managedEnvironmentUsagesRestClient = new ManagedEnvironmentUsagesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint); #if DEBUG @@ -119,7 +123,7 @@ public virtual ContainerAppManagedEnvironmentCertificateCollection GetContainerA /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -150,7 +154,7 @@ public virtual async Task /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -168,149 +172,149 @@ public virtual Response GetCo return GetContainerAppManagedEnvironmentCertificates().Get(certificateName, cancellationToken); } - /// Gets a collection of ContainerAppManagedEnvironmentDaprComponentResources in the ContainerAppManagedEnvironment. - /// An object representing collection of ContainerAppManagedEnvironmentDaprComponentResources and their operations over a ContainerAppManagedEnvironmentDaprComponentResource. - public virtual ContainerAppManagedEnvironmentDaprComponentCollection GetContainerAppManagedEnvironmentDaprComponents() + /// Gets a collection of ContainerAppManagedEnvironmentDetectorResources in the ContainerAppManagedEnvironment. + /// An object representing collection of ContainerAppManagedEnvironmentDetectorResources and their operations over a ContainerAppManagedEnvironmentDetectorResource. + public virtual ContainerAppManagedEnvironmentDetectorCollection GetContainerAppManagedEnvironmentDetectors() { - return GetCachedClient(client => new ContainerAppManagedEnvironmentDaprComponentCollection(client, Id)); + return GetCachedClient(client => new ContainerAppManagedEnvironmentDetectorCollection(client, Id)); } /// - /// Get a dapr component. + /// Get the diagnostics data for a Managed Environment used to host container apps. /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/daprComponents/{componentName} + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/detectors/{detectorName} /// /// /// Operation Id - /// DaprComponents_Get + /// ManagedEnvironmentDiagnostics_GetDetector /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource - /// + /// /// /// /// - /// Name of the Dapr Component. + /// Name of the Managed Environment detector. /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. + /// is null. + /// is an empty string, and was expected to be non-empty. [ForwardsClientCalls] - public virtual async Task> GetContainerAppManagedEnvironmentDaprComponentAsync(string componentName, CancellationToken cancellationToken = default) + public virtual async Task> GetContainerAppManagedEnvironmentDetectorAsync(string detectorName, CancellationToken cancellationToken = default) { - return await GetContainerAppManagedEnvironmentDaprComponents().GetAsync(componentName, cancellationToken).ConfigureAwait(false); + return await GetContainerAppManagedEnvironmentDetectors().GetAsync(detectorName, cancellationToken).ConfigureAwait(false); } /// - /// Get a dapr component. + /// Get the diagnostics data for a Managed Environment used to host container apps. /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/daprComponents/{componentName} + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/detectors/{detectorName} /// /// /// Operation Id - /// DaprComponents_Get + /// ManagedEnvironmentDiagnostics_GetDetector /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource - /// + /// /// /// /// - /// Name of the Dapr Component. + /// Name of the Managed Environment detector. /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. + /// is null. + /// is an empty string, and was expected to be non-empty. [ForwardsClientCalls] - public virtual Response GetContainerAppManagedEnvironmentDaprComponent(string componentName, CancellationToken cancellationToken = default) + public virtual Response GetContainerAppManagedEnvironmentDetector(string detectorName, CancellationToken cancellationToken = default) { - return GetContainerAppManagedEnvironmentDaprComponents().Get(componentName, cancellationToken); + return GetContainerAppManagedEnvironmentDetectors().Get(detectorName, cancellationToken); } - /// Gets a collection of ContainerAppManagedEnvironmentDetectorResources in the ContainerAppManagedEnvironment. - /// An object representing collection of ContainerAppManagedEnvironmentDetectorResources and their operations over a ContainerAppManagedEnvironmentDetectorResource. - public virtual ContainerAppManagedEnvironmentDetectorCollection GetContainerAppManagedEnvironmentDetectors() + /// Gets an object representing a ContainerAppManagedEnvironmentDetectorResourcePropertyResource along with the instance operations that can be performed on it in the ContainerAppManagedEnvironment. + /// Returns a object. + public virtual ContainerAppManagedEnvironmentDetectorResourcePropertyResource GetContainerAppManagedEnvironmentDetectorResourceProperty() { - return GetCachedClient(client => new ContainerAppManagedEnvironmentDetectorCollection(client, Id)); + return new ContainerAppManagedEnvironmentDetectorResourcePropertyResource(Client, Id.AppendChildResource("detectorProperties", "rootApi")); + } + + /// Gets a collection of DotNetComponentResources in the ContainerAppManagedEnvironment. + /// An object representing collection of DotNetComponentResources and their operations over a DotNetComponentResource. + public virtual DotNetComponentCollection GetDotNetComponents() + { + return GetCachedClient(client => new DotNetComponentCollection(client, Id)); } /// - /// Get the diagnostics data for a Managed Environment used to host container apps. + /// Get a .NET Component. /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/detectors/{detectorName} + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/dotNetComponents/{name} /// /// /// Operation Id - /// ManagedEnvironmentDiagnostics_GetDetector + /// DotNetComponents_Get /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource - /// + /// /// /// /// - /// Name of the Managed Environment detector. + /// Name of the .NET Component. /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. + /// is null. + /// is an empty string, and was expected to be non-empty. [ForwardsClientCalls] - public virtual async Task> GetContainerAppManagedEnvironmentDetectorAsync(string detectorName, CancellationToken cancellationToken = default) + public virtual async Task> GetDotNetComponentAsync(string name, CancellationToken cancellationToken = default) { - return await GetContainerAppManagedEnvironmentDetectors().GetAsync(detectorName, cancellationToken).ConfigureAwait(false); + return await GetDotNetComponents().GetAsync(name, cancellationToken).ConfigureAwait(false); } /// - /// Get the diagnostics data for a Managed Environment used to host container apps. + /// Get a .NET Component. /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/detectors/{detectorName} + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/dotNetComponents/{name} /// /// /// Operation Id - /// ManagedEnvironmentDiagnostics_GetDetector + /// DotNetComponents_Get /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource - /// + /// /// /// /// - /// Name of the Managed Environment detector. + /// Name of the .NET Component. /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. + /// is null. + /// is an empty string, and was expected to be non-empty. [ForwardsClientCalls] - public virtual Response GetContainerAppManagedEnvironmentDetector(string detectorName, CancellationToken cancellationToken = default) + public virtual Response GetDotNetComponent(string name, CancellationToken cancellationToken = default) { - return GetContainerAppManagedEnvironmentDetectors().Get(detectorName, cancellationToken); - } - - /// Gets an object representing a ContainerAppManagedEnvironmentDetectorResourcePropertyResource along with the instance operations that can be performed on it in the ContainerAppManagedEnvironment. - /// Returns a object. - public virtual ContainerAppManagedEnvironmentDetectorResourcePropertyResource GetContainerAppManagedEnvironmentDetectorResourceProperty() - { - return new ContainerAppManagedEnvironmentDetectorResourcePropertyResource(Client, Id.AppendChildResource("detectorProperties", "rootApi")); + return GetDotNetComponents().Get(name, cancellationToken); } /// Gets a collection of JavaComponentResources in the ContainerAppManagedEnvironment. @@ -333,7 +337,7 @@ public virtual JavaComponentCollection GetJavaComponents() /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -364,7 +368,7 @@ public virtual async Task> GetJavaComponentAsync /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -402,7 +406,7 @@ public virtual ContainerAppManagedCertificateCollection GetContainerAppManagedCe /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -433,7 +437,7 @@ public virtual async Task> GetC /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -451,6 +455,351 @@ public virtual Response GetContainerAppM return GetContainerAppManagedCertificates().Get(managedCertificateName, cancellationToken); } + /// Gets a collection of AppContainersPrivateEndpointConnectionResources in the ContainerAppManagedEnvironment. + /// An object representing collection of AppContainersPrivateEndpointConnectionResources and their operations over a AppContainersPrivateEndpointConnectionResource. + public virtual AppContainersPrivateEndpointConnectionCollection GetAppContainersPrivateEndpointConnections() + { + return GetCachedClient(client => new AppContainersPrivateEndpointConnectionCollection(client, Id)); + } + + /// + /// Get a private endpoint connection for a given managed environment. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/privateEndpointConnections/{privateEndpointConnectionName} + /// + /// + /// Operation Id + /// ManagedEnvironmentPrivateEndpointConnections_Get + /// + /// + /// Default Api Version + /// 2025-02-02-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the private endpoint connection associated with the Azure resource. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetAppContainersPrivateEndpointConnectionAsync(string privateEndpointConnectionName, CancellationToken cancellationToken = default) + { + return await GetAppContainersPrivateEndpointConnections().GetAsync(privateEndpointConnectionName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get a private endpoint connection for a given managed environment. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/privateEndpointConnections/{privateEndpointConnectionName} + /// + /// + /// Operation Id + /// ManagedEnvironmentPrivateEndpointConnections_Get + /// + /// + /// Default Api Version + /// 2025-02-02-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the private endpoint connection associated with the Azure resource. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetAppContainersPrivateEndpointConnection(string privateEndpointConnectionName, CancellationToken cancellationToken = default) + { + return GetAppContainersPrivateEndpointConnections().Get(privateEndpointConnectionName, cancellationToken); + } + + /// Gets a collection of ContainerAppManagedEnvironmentDaprComponentResources in the ContainerAppManagedEnvironment. + /// An object representing collection of ContainerAppManagedEnvironmentDaprComponentResources and their operations over a ContainerAppManagedEnvironmentDaprComponentResource. + public virtual ContainerAppManagedEnvironmentDaprComponentCollection GetContainerAppManagedEnvironmentDaprComponents() + { + return GetCachedClient(client => new ContainerAppManagedEnvironmentDaprComponentCollection(client, Id)); + } + + /// + /// Get a dapr component. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/daprComponents/{componentName} + /// + /// + /// Operation Id + /// DaprComponents_Get + /// + /// + /// Default Api Version + /// 2025-02-02-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the Dapr Component. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetContainerAppManagedEnvironmentDaprComponentAsync(string componentName, CancellationToken cancellationToken = default) + { + return await GetContainerAppManagedEnvironmentDaprComponents().GetAsync(componentName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get a dapr component. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/daprComponents/{componentName} + /// + /// + /// Operation Id + /// DaprComponents_Get + /// + /// + /// Default Api Version + /// 2025-02-02-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the Dapr Component. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetContainerAppManagedEnvironmentDaprComponent(string componentName, CancellationToken cancellationToken = default) + { + return GetContainerAppManagedEnvironmentDaprComponents().Get(componentName, cancellationToken); + } + + /// Gets a collection of DaprSubscriptionResources in the ContainerAppManagedEnvironment. + /// An object representing collection of DaprSubscriptionResources and their operations over a DaprSubscriptionResource. + public virtual DaprSubscriptionCollection GetDaprSubscriptions() + { + return GetCachedClient(client => new DaprSubscriptionCollection(client, Id)); + } + + /// + /// Get a dapr subscription. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/daprSubscriptions/{name} + /// + /// + /// Operation Id + /// DaprSubscriptions_Get + /// + /// + /// Default Api Version + /// 2025-02-02-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the Dapr subscription. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetDaprSubscriptionAsync(string name, CancellationToken cancellationToken = default) + { + return await GetDaprSubscriptions().GetAsync(name, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get a dapr subscription. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/daprSubscriptions/{name} + /// + /// + /// Operation Id + /// DaprSubscriptions_Get + /// + /// + /// Default Api Version + /// 2025-02-02-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the Dapr subscription. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetDaprSubscription(string name, CancellationToken cancellationToken = default) + { + return GetDaprSubscriptions().Get(name, cancellationToken); + } + + /// Gets a collection of HttpRouteConfigResources in the ContainerAppManagedEnvironment. + /// An object representing collection of HttpRouteConfigResources and their operations over a HttpRouteConfigResource. + public virtual HttpRouteConfigCollection GetHttpRouteConfigs() + { + return GetCachedClient(client => new HttpRouteConfigCollection(client, Id)); + } + + /// + /// Get the specified Managed Http Route Config. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/httpRouteConfigs/{httpRouteName} + /// + /// + /// Operation Id + /// HttpRouteConfig_Get + /// + /// + /// Default Api Version + /// 2025-02-02-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the Http Route Config Resource. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetHttpRouteConfigAsync(string httpRouteName, CancellationToken cancellationToken = default) + { + return await GetHttpRouteConfigs().GetAsync(httpRouteName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get the specified Managed Http Route Config. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/httpRouteConfigs/{httpRouteName} + /// + /// + /// Operation Id + /// HttpRouteConfig_Get + /// + /// + /// Default Api Version + /// 2025-02-02-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the Http Route Config Resource. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetHttpRouteConfig(string httpRouteName, CancellationToken cancellationToken = default) + { + return GetHttpRouteConfigs().Get(httpRouteName, cancellationToken); + } + + /// Gets a collection of MaintenanceConfigurationResources in the ContainerAppManagedEnvironment. + /// An object representing collection of MaintenanceConfigurationResources and their operations over a MaintenanceConfigurationResource. + public virtual MaintenanceConfigurationResourceCollection GetMaintenanceConfigurationResources() + { + return GetCachedClient(client => new MaintenanceConfigurationResourceCollection(client, Id)); + } + + /// + /// Gets the maintenance configuration of a ManagedEnvironment . + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/maintenanceConfigurations/{configName} + /// + /// + /// Operation Id + /// MaintenanceConfigurations_Get + /// + /// + /// Default Api Version + /// 2025-02-02-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the maintenance configuration. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetMaintenanceConfigurationResourceAsync(string configName, CancellationToken cancellationToken = default) + { + return await GetMaintenanceConfigurationResources().GetAsync(configName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets the maintenance configuration of a ManagedEnvironment . + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/maintenanceConfigurations/{configName} + /// + /// + /// Operation Id + /// MaintenanceConfigurations_Get + /// + /// + /// Default Api Version + /// 2025-02-02-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the maintenance configuration. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetMaintenanceConfigurationResource(string configName, CancellationToken cancellationToken = default) + { + return GetMaintenanceConfigurationResources().Get(configName, cancellationToken); + } + /// Gets a collection of ContainerAppManagedEnvironmentStorageResources in the ContainerAppManagedEnvironment. /// An object representing collection of ContainerAppManagedEnvironmentStorageResources and their operations over a ContainerAppManagedEnvironmentStorageResource. public virtual ContainerAppManagedEnvironmentStorageCollection GetContainerAppManagedEnvironmentStorages() @@ -471,7 +820,7 @@ public virtual ContainerAppManagedEnvironmentStorageCollection GetContainerAppMa /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -502,7 +851,7 @@ public virtual async Task /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -533,7 +882,7 @@ public virtual Response GetContai /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -573,7 +922,7 @@ public virtual async Task> GetA /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -613,7 +962,7 @@ public virtual Response Get(Cancellation /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -655,7 +1004,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -697,7 +1046,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -743,7 +1092,7 @@ public virtual async Task> /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -789,7 +1138,7 @@ public virtual ArmOperation Update(WaitU /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -827,7 +1176,7 @@ public virtual async Task> GetAuthTok /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -865,7 +1214,7 @@ public virtual Response GetAuthToken(Cancellat /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -895,7 +1244,7 @@ public virtual AsyncPageable GetWorkloadProfil /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -925,7 +1274,7 @@ public virtual Pageable GetWorkloadProfileStat /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// @@ -963,7 +1312,7 @@ public virtual async Task> CheckCon /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// @@ -988,6 +1337,58 @@ public virtual Response CheckContainerAppNam } } + /// + /// List private link resources for a given managed environment. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/privateLinkResources + /// + /// + /// Operation Id + /// ManagedEnvironmentPrivateLinkResources_List + /// + /// + /// Default Api Version + /// 2025-02-02-preview + /// + /// + /// + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetManagedEnvironmentPrivateLinkResourcesAsync(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _managedEnvironmentPrivateLinkResourcesRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _managedEnvironmentPrivateLinkResourcesRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => AppContainersPrivateLinkResource.DeserializeAppContainersPrivateLinkResource(e), _managedEnvironmentPrivateLinkResourcesClientDiagnostics, Pipeline, "ContainerAppManagedEnvironmentResource.GetManagedEnvironmentPrivateLinkResources", "value", "nextLink", cancellationToken); + } + + /// + /// List private link resources for a given managed environment. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/privateLinkResources + /// + /// + /// Operation Id + /// ManagedEnvironmentPrivateLinkResources_List + /// + /// + /// Default Api Version + /// 2025-02-02-preview + /// + /// + /// + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetManagedEnvironmentPrivateLinkResources(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _managedEnvironmentPrivateLinkResourcesRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _managedEnvironmentPrivateLinkResourcesRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => AppContainersPrivateLinkResource.DeserializeAppContainersPrivateLinkResource(e), _managedEnvironmentPrivateLinkResourcesClientDiagnostics, Pipeline, "ContainerAppManagedEnvironmentResource.GetManagedEnvironmentPrivateLinkResources", "value", "nextLink", cancellationToken); + } + /// /// Gets the current usage information as well as the limits for environment. /// @@ -1001,7 +1402,7 @@ public virtual Response CheckContainerAppNam /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// @@ -1027,7 +1428,7 @@ public virtual AsyncPageable GetManagedEnvironmentUsagesAsync /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// @@ -1053,7 +1454,7 @@ public virtual Pageable GetManagedEnvironmentUsages(Cancellat /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -1115,7 +1516,7 @@ public virtual async Task> AddT /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -1177,7 +1578,7 @@ public virtual Response AddTag(string ke /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -1234,7 +1635,7 @@ public virtual async Task> SetT /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -1291,7 +1692,7 @@ public virtual Response SetTags(IDiction /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -1351,7 +1752,7 @@ public virtual async Task> Remo /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/ContainerAppManagedEnvironmentStorageCollection.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/ContainerAppManagedEnvironmentStorageCollection.cs index 6932ba4c3c95..8dc8b38af345 100644 --- a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/ContainerAppManagedEnvironmentStorageCollection.cs +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/ContainerAppManagedEnvironmentStorageCollection.cs @@ -64,7 +64,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -115,7 +115,7 @@ public virtual async Task /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -166,7 +166,7 @@ public virtual ArmOperation Creat /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -211,7 +211,7 @@ public virtual async Task /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -256,7 +256,7 @@ public virtual Response Get(strin /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -285,7 +285,7 @@ public virtual AsyncPageable GetA /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -314,7 +314,7 @@ public virtual Pageable GetAll(Ca /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -357,7 +357,7 @@ public virtual async Task> ExistsAsync(string storageName, Cancel /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -400,7 +400,7 @@ public virtual Response Exists(string storageName, CancellationToken cance /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -445,7 +445,7 @@ public virtual async Task /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/ContainerAppManagedEnvironmentStorageResource.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/ContainerAppManagedEnvironmentStorageResource.cs index d069bf6cff96..b0c45910da79 100644 --- a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/ContainerAppManagedEnvironmentStorageResource.cs +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/ContainerAppManagedEnvironmentStorageResource.cs @@ -101,7 +101,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -141,7 +141,7 @@ public virtual async Task /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -181,7 +181,7 @@ public virtual Response Get(Cance /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -225,7 +225,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -269,7 +269,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -317,7 +317,7 @@ public virtual async Task /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/ContainerAppReplicaCollection.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/ContainerAppReplicaCollection.cs index 2d257f7f1c33..ac160d1f03f8 100644 --- a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/ContainerAppReplicaCollection.cs +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/ContainerAppReplicaCollection.cs @@ -64,7 +64,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -109,7 +109,7 @@ public virtual async Task> GetAsync(string /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -154,7 +154,7 @@ public virtual Response Get(string replicaName, Can /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -183,7 +183,7 @@ public virtual AsyncPageable GetAllAsync(Cancellati /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -212,7 +212,7 @@ public virtual Pageable GetAll(CancellationToken ca /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -255,7 +255,7 @@ public virtual async Task> ExistsAsync(string replicaName, Cancel /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -298,7 +298,7 @@ public virtual Response Exists(string replicaName, CancellationToken cance /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -343,7 +343,7 @@ public virtual async Task> GetIfEx /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/ContainerAppReplicaResource.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/ContainerAppReplicaResource.cs index dbb135da7fa4..4adb0c587026 100644 --- a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/ContainerAppReplicaResource.cs +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/ContainerAppReplicaResource.cs @@ -102,7 +102,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -142,7 +142,7 @@ public virtual async Task> GetAsync(Cancel /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/ContainerAppResource.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/ContainerAppResource.cs index 4850d0255e95..160ed5e30c4a 100644 --- a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/ContainerAppResource.cs +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/ContainerAppResource.cs @@ -91,6 +91,75 @@ internal static void ValidateResourceId(ResourceIdentifier id) throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceType), nameof(id)); } + /// Gets a collection of AppResiliencyResources in the ContainerApp. + /// An object representing collection of AppResiliencyResources and their operations over a AppResiliencyResource. + public virtual AppResiliencyCollection GetAppResiliencies() + { + return GetCachedClient(client => new AppResiliencyCollection(client, Id)); + } + + /// + /// Get container app resiliency policy. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{appName}/resiliencyPolicies/{name} + /// + /// + /// Operation Id + /// AppResiliency_Get + /// + /// + /// Default Api Version + /// 2025-02-02-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the resiliency policy. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetAppResiliencyAsync(string name, CancellationToken cancellationToken = default) + { + return await GetAppResiliencies().GetAsync(name, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get container app resiliency policy. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{appName}/resiliencyPolicies/{name} + /// + /// + /// Operation Id + /// AppResiliency_Get + /// + /// + /// Default Api Version + /// 2025-02-02-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the resiliency policy. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetAppResiliency(string name, CancellationToken cancellationToken = default) + { + return GetAppResiliencies().Get(name, cancellationToken); + } + /// Gets a collection of ContainerAppAuthConfigResources in the ContainerApp. /// An object representing collection of ContainerAppAuthConfigResources and their operations over a ContainerAppAuthConfigResource. public virtual ContainerAppAuthConfigCollection GetContainerAppAuthConfigs() @@ -111,7 +180,7 @@ public virtual ContainerAppAuthConfigCollection GetContainerAppAuthConfigs() /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -142,7 +211,7 @@ public virtual async Task> GetContainer /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -167,6 +236,213 @@ public virtual ContainerAppDetectorPropertyResource GetContainerAppDetectorPrope return new ContainerAppDetectorPropertyResource(Client, Id.AppendChildResource("detectorProperties", "rootApi")); } + /// Gets a collection of ContainerAppsBuildResources in the ContainerApp. + /// An object representing collection of ContainerAppsBuildResources and their operations over a ContainerAppsBuildResource. + public virtual ContainerAppsBuildResourceCollection GetContainerAppsBuildResources() + { + return GetCachedClient(client => new ContainerAppsBuildResourceCollection(client, Id)); + } + + /// + /// Get a Container Apps Build resource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/builds/{buildName} + /// + /// + /// Operation Id + /// ContainerAppsBuilds_Get + /// + /// + /// Default Api Version + /// 2025-02-02-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of a build. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetContainerAppsBuildResourceAsync(string buildName, CancellationToken cancellationToken = default) + { + return await GetContainerAppsBuildResources().GetAsync(buildName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get a Container Apps Build resource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/builds/{buildName} + /// + /// + /// Operation Id + /// ContainerAppsBuilds_Get + /// + /// + /// Default Api Version + /// 2025-02-02-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of a build. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetContainerAppsBuildResource(string buildName, CancellationToken cancellationToken = default) + { + return GetContainerAppsBuildResources().Get(buildName, cancellationToken); + } + + /// Gets a collection of LabelHistoryResources in the ContainerApp. + /// An object representing collection of LabelHistoryResources and their operations over a LabelHistoryResource. + public virtual LabelHistoryCollection GetLabelHistories() + { + return GetCachedClient(client => new LabelHistoryCollection(client, Id)); + } + + /// + /// Get the history of a label. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/labelHistory/{labelName} + /// + /// + /// Operation Id + /// ContainerAppsLabelHistory_GetLabelHistory + /// + /// + /// Default Api Version + /// 2025-02-02-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the Container App label. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetLabelHistoryAsync(string labelName, CancellationToken cancellationToken = default) + { + return await GetLabelHistories().GetAsync(labelName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get the history of a label. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/labelHistory/{labelName} + /// + /// + /// Operation Id + /// ContainerAppsLabelHistory_GetLabelHistory + /// + /// + /// Default Api Version + /// 2025-02-02-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the Container App label. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetLabelHistory(string labelName, CancellationToken cancellationToken = default) + { + return GetLabelHistories().Get(labelName, cancellationToken); + } + + /// Gets a collection of ContainerAppsPatchResources in the ContainerApp. + /// An object representing collection of ContainerAppsPatchResources and their operations over a ContainerAppsPatchResource. + public virtual ContainerAppsPatchResourceCollection GetContainerAppsPatchResources() + { + return GetCachedClient(client => new ContainerAppsPatchResourceCollection(client, Id)); + } + + /// + /// Get details for specific Container Apps Patch by patch name. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/patches/{patchName} + /// + /// + /// Operation Id + /// ContainerAppsPatches_Get + /// + /// + /// Default Api Version + /// 2025-02-02-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the patch. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetContainerAppsPatchResourceAsync(string patchName, CancellationToken cancellationToken = default) + { + return await GetContainerAppsPatchResources().GetAsync(patchName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get details for specific Container Apps Patch by patch name. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/patches/{patchName} + /// + /// + /// Operation Id + /// ContainerAppsPatches_Get + /// + /// + /// Default Api Version + /// 2025-02-02-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the patch. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetContainerAppsPatchResource(string patchName, CancellationToken cancellationToken = default) + { + return GetContainerAppsPatchResources().Get(patchName, cancellationToken); + } + /// Gets a collection of ContainerAppRevisionResources in the ContainerApp. /// An object representing collection of ContainerAppRevisionResources and their operations over a ContainerAppRevisionResource. public virtual ContainerAppRevisionCollection GetContainerAppRevisions() @@ -187,7 +463,7 @@ public virtual ContainerAppRevisionCollection GetContainerAppRevisions() /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -218,7 +494,7 @@ public virtual async Task> GetContainerAp /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -256,7 +532,7 @@ public virtual ContainerAppDetectorPropertyRevisionCollection GetContainerAppDet /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -287,7 +563,7 @@ public virtual async Task /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -325,7 +601,7 @@ public virtual ContainerAppDetectorCollection GetContainerAppDetectors() /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -356,7 +632,7 @@ public virtual async Task> GetContainerAp /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -374,6 +650,75 @@ public virtual Response GetContainerAppDetector(st return GetContainerAppDetectors().Get(detectorName, cancellationToken); } + /// Gets a collection of LogicAppResources in the ContainerApp. + /// An object representing collection of LogicAppResources and their operations over a LogicAppResource. + public virtual LogicAppCollection GetLogicApps() + { + return GetCachedClient(client => new LogicAppCollection(client, Id)); + } + + /// + /// Gets a logic app extension resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/providers/Microsoft.App/logicApps/{logicAppName} + /// + /// + /// Operation Id + /// LogicApps_Get + /// + /// + /// Default Api Version + /// 2025-02-02-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the Logic App, the extension resource. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetLogicAppAsync(string logicAppName, CancellationToken cancellationToken = default) + { + return await GetLogicApps().GetAsync(logicAppName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets a logic app extension resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/providers/Microsoft.App/logicApps/{logicAppName} + /// + /// + /// Operation Id + /// LogicApps_Get + /// + /// + /// Default Api Version + /// 2025-02-02-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the Logic App, the extension resource. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetLogicApp(string logicAppName, CancellationToken cancellationToken = default) + { + return GetLogicApps().Get(logicAppName, cancellationToken); + } + /// Gets a collection of ContainerAppSourceControlResources in the ContainerApp. /// An object representing collection of ContainerAppSourceControlResources and their operations over a ContainerAppSourceControlResource. public virtual ContainerAppSourceControlCollection GetContainerAppSourceControls() @@ -394,7 +739,7 @@ public virtual ContainerAppSourceControlCollection GetContainerAppSourceControls /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -425,7 +770,7 @@ public virtual async Task> GetContai /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -456,7 +801,7 @@ public virtual Response GetContainerAppSource /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -496,7 +841,7 @@ public virtual async Task> GetAsync(CancellationT /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -536,7 +881,7 @@ public virtual Response Get(CancellationToken cancellation /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -578,7 +923,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -620,7 +965,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -666,7 +1011,7 @@ public virtual async Task> UpdateAsync(WaitUn /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -712,7 +1057,7 @@ public virtual ArmOperation Update(WaitUntil waitUntil, Co /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -751,7 +1096,7 @@ public virtual async Task> Ge /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -790,7 +1135,7 @@ public virtual Response GetCustomHostN /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -819,7 +1164,7 @@ public virtual AsyncPageable GetSecretsAsync(CancellationTok /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -848,7 +1193,7 @@ public virtual Pageable GetSecrets(CancellationToken cancell /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -886,7 +1231,7 @@ public virtual async Task> GetAuthTokenAsync(Can /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -924,7 +1269,7 @@ public virtual Response GetAuthToken(CancellationToken ca /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -966,7 +1311,7 @@ public virtual async Task> StartAsync(WaitUnt /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -1008,7 +1353,7 @@ public virtual ArmOperation Start(WaitUntil waitUntil, Can /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -1050,7 +1395,7 @@ public virtual async Task> StopAsync(WaitUnti /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -1092,7 +1437,7 @@ public virtual ArmOperation Stop(WaitUntil waitUntil, Canc /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -1154,7 +1499,7 @@ public virtual async Task> AddTagAsync(string key /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -1216,7 +1561,7 @@ public virtual Response AddTag(string key, string value, C /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -1273,7 +1618,7 @@ public virtual async Task> SetTagsAsync(IDictiona /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -1330,7 +1675,7 @@ public virtual Response SetTags(IDictionary /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -1390,7 +1735,7 @@ public virtual async Task> RemoveTagAsync(string /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/ContainerAppRevisionCollection.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/ContainerAppRevisionCollection.cs index 1da5537a7403..8efcf4701298 100644 --- a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/ContainerAppRevisionCollection.cs +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/ContainerAppRevisionCollection.cs @@ -64,7 +64,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -109,7 +109,7 @@ public virtual async Task> GetAsync(strin /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -154,7 +154,7 @@ public virtual Response Get(string revisionName, C /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -185,7 +185,7 @@ public virtual AsyncPageable GetAllAsync(string fi /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -216,7 +216,7 @@ public virtual Pageable GetAll(string filter = nul /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -259,7 +259,7 @@ public virtual async Task> ExistsAsync(string revisionName, Cance /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -302,7 +302,7 @@ public virtual Response Exists(string revisionName, CancellationToken canc /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -347,7 +347,7 @@ public virtual async Task> GetIfE /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/ContainerAppRevisionData.Serialization.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/ContainerAppRevisionData.Serialization.cs index 0232ec742a3c..e43075e2dd3a 100644 --- a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/ContainerAppRevisionData.Serialization.cs +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/ContainerAppRevisionData.Serialization.cs @@ -8,6 +8,7 @@ using System; using System.ClientModel.Primitives; using System.Collections.Generic; +using System.Linq; using System.Text; using System.Text.Json; using Azure.Core; @@ -75,6 +76,16 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri writer.WritePropertyName("trafficWeight"u8); writer.WriteNumberValue(TrafficWeight.Value); } + if (options.Format != "W" && Optional.IsCollectionDefined(Labels)) + { + writer.WritePropertyName("labels"u8); + writer.WriteStartArray(); + foreach (var item in Labels) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } if (options.Format != "W" && Optional.IsDefined(ProvisioningError)) { writer.WritePropertyName("provisioningError"u8); @@ -129,6 +140,7 @@ internal static ContainerAppRevisionData DeserializeContainerAppRevisionData(Jso bool? active = default; int? replicas = default; int? trafficWeight = default; + IReadOnlyList labels = default; string provisioningError = default; ContainerAppRevisionHealthState? healthState = default; ContainerAppRevisionProvisioningState? provisioningState = default; @@ -229,6 +241,20 @@ internal static ContainerAppRevisionData DeserializeContainerAppRevisionData(Jso trafficWeight = property0.Value.GetInt32(); continue; } + if (property0.NameEquals("labels"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property0.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + labels = array; + continue; + } if (property0.NameEquals("provisioningError"u8)) { provisioningError = property0.Value.GetString(); @@ -282,6 +308,7 @@ internal static ContainerAppRevisionData DeserializeContainerAppRevisionData(Jso active, replicas, trafficWeight, + labels ?? new ChangeTrackingList(), provisioningError, healthState, provisioningState, @@ -471,6 +498,42 @@ private BinaryData SerializeBicep(ModelReaderWriterOptions options) } } + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Labels), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" labels: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsCollectionDefined(Labels)) + { + if (Labels.Any()) + { + builder.Append(" labels: "); + builder.AppendLine("["); + foreach (var item in Labels) + { + if (item == null) + { + builder.Append("null"); + continue; + } + if (item.Contains(Environment.NewLine)) + { + builder.AppendLine(" '''"); + builder.AppendLine($"{item}'''"); + } + else + { + builder.AppendLine($" '{item}'"); + } + } + builder.AppendLine(" ]"); + } + } + } + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(ProvisioningError), out propertyOverride); if (hasPropertyOverride) { diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/ContainerAppRevisionData.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/ContainerAppRevisionData.cs index 9cf0c8c6b17a..f7154d0406f3 100644 --- a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/ContainerAppRevisionData.cs +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/ContainerAppRevisionData.cs @@ -54,6 +54,7 @@ public partial class ContainerAppRevisionData : ResourceData /// Initializes a new instance of . public ContainerAppRevisionData() { + Labels = new ChangeTrackingList(); } /// Initializes a new instance of . @@ -75,12 +76,13 @@ public ContainerAppRevisionData() /// Boolean describing if the Revision is Active. /// Number of pods currently running for this revision. /// Traffic weight assigned to this revision. + /// List of labels assigned to this revision. /// Optional Field - Platform Error Message. /// Current health State of the revision. /// Current provisioning State of the revision. /// Current running state of the revision. /// Keeps track of any properties unknown to the library. - internal ContainerAppRevisionData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, DateTimeOffset? createdOn, DateTimeOffset? lastActiveOn, string fqdn, ContainerAppTemplate template, bool? isActive, int? replicas, int? trafficWeight, string provisioningError, ContainerAppRevisionHealthState? healthState, ContainerAppRevisionProvisioningState? provisioningState, RevisionRunningState? runningState, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) + internal ContainerAppRevisionData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, DateTimeOffset? createdOn, DateTimeOffset? lastActiveOn, string fqdn, ContainerAppTemplate template, bool? isActive, int? replicas, int? trafficWeight, IReadOnlyList labels, string provisioningError, ContainerAppRevisionHealthState? healthState, ContainerAppRevisionProvisioningState? provisioningState, RevisionRunningState? runningState, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) { CreatedOn = createdOn; LastActiveOn = lastActiveOn; @@ -89,6 +91,7 @@ internal ContainerAppRevisionData(ResourceIdentifier id, string name, ResourceTy IsActive = isActive; Replicas = replicas; TrafficWeight = trafficWeight; + Labels = labels; ProvisioningError = provisioningError; HealthState = healthState; ProvisioningState = provisioningState; @@ -124,6 +127,9 @@ internal ContainerAppRevisionData(ResourceIdentifier id, string name, ResourceTy /// Traffic weight assigned to this revision. [WirePath("properties.trafficWeight")] public int? TrafficWeight { get; } + /// List of labels assigned to this revision. + [WirePath("properties.labels")] + public IReadOnlyList Labels { get; } /// Optional Field - Platform Error Message. [WirePath("properties.provisioningError")] public string ProvisioningError { get; } diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/ContainerAppRevisionResource.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/ContainerAppRevisionResource.cs index 21b9cb8bfa5a..ac497114b1d6 100644 --- a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/ContainerAppRevisionResource.cs +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/ContainerAppRevisionResource.cs @@ -35,6 +35,8 @@ public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, private readonly ClientDiagnostics _containerAppRevisionContainerAppsRevisionsClientDiagnostics; private readonly ContainerAppsRevisionsRestOperations _containerAppRevisionContainerAppsRevisionsRestClient; + private readonly ClientDiagnostics _functionsExtensionClientDiagnostics; + private readonly FunctionsExtensionRestOperations _functionsExtensionRestClient; private readonly ContainerAppRevisionData _data; /// Gets the resource type for the operations. @@ -62,6 +64,8 @@ internal ContainerAppRevisionResource(ArmClient client, ResourceIdentifier id) : _containerAppRevisionContainerAppsRevisionsClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.AppContainers", ResourceType.Namespace, Diagnostics); TryGetApiVersion(ResourceType, out string containerAppRevisionContainerAppsRevisionsApiVersion); _containerAppRevisionContainerAppsRevisionsRestClient = new ContainerAppsRevisionsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, containerAppRevisionContainerAppsRevisionsApiVersion); + _functionsExtensionClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.AppContainers", ProviderConstants.DefaultProviderNamespace, Diagnostics); + _functionsExtensionRestClient = new FunctionsExtensionRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint); #if DEBUG ValidateResourceId(Id); #endif @@ -108,7 +112,7 @@ public virtual ContainerAppReplicaCollection GetContainerAppReplicas() /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -139,7 +143,7 @@ public virtual async Task> GetContainerApp /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -170,7 +174,7 @@ public virtual Response GetContainerAppReplica(stri /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -210,7 +214,7 @@ public virtual async Task> GetAsync(Cance /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -250,7 +254,7 @@ public virtual Response Get(CancellationToken canc /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -288,7 +292,7 @@ public virtual async Task ActivateRevisionAsync(CancellationToken canc /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -326,7 +330,7 @@ public virtual Response ActivateRevision(CancellationToken cancellationToken = d /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -364,7 +368,7 @@ public virtual async Task DeactivateRevisionAsync(CancellationToken ca /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -402,7 +406,7 @@ public virtual Response DeactivateRevision(CancellationToken cancellationToken = /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -440,7 +444,7 @@ public virtual async Task RestartRevisionAsync(CancellationToken cance /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -464,5 +468,83 @@ public virtual Response RestartRevision(CancellationToken cancellationToken = de throw; } } + + /// + /// Proxies a Functions host call to the function app backed by the container app. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/revisions/{revisionName}/providers/Microsoft.App/functions/{functionAppName}/invoke + /// + /// + /// Operation Id + /// FunctionsExtension_InvokeFunctionsHost + /// + /// + /// Default Api Version + /// 2025-02-02-preview + /// + /// + /// + /// Name of the Function App, the extension resource. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> InvokeFunctionsHostFunctionsExtensionAsync(string functionAppName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(functionAppName, nameof(functionAppName)); + + using var scope = _functionsExtensionClientDiagnostics.CreateScope("ContainerAppRevisionResource.InvokeFunctionsHostFunctionsExtension"); + scope.Start(); + try + { + var response = await _functionsExtensionRestClient.InvokeFunctionsHostAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, functionAppName, cancellationToken).ConfigureAwait(false); + return response; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Proxies a Functions host call to the function app backed by the container app. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/revisions/{revisionName}/providers/Microsoft.App/functions/{functionAppName}/invoke + /// + /// + /// Operation Id + /// FunctionsExtension_InvokeFunctionsHost + /// + /// + /// Default Api Version + /// 2025-02-02-preview + /// + /// + /// + /// Name of the Function App, the extension resource. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response InvokeFunctionsHostFunctionsExtension(string functionAppName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(functionAppName, nameof(functionAppName)); + + using var scope = _functionsExtensionClientDiagnostics.CreateScope("ContainerAppRevisionResource.InvokeFunctionsHostFunctionsExtension"); + scope.Start(); + try + { + var response = _functionsExtensionRestClient.InvokeFunctionsHost(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, functionAppName, cancellationToken); + return response; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } } } diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/ContainerAppSourceControlCollection.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/ContainerAppSourceControlCollection.cs index 1515b4d54ea3..0b9d281d16f8 100644 --- a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/ContainerAppSourceControlCollection.cs +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/ContainerAppSourceControlCollection.cs @@ -64,7 +64,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -75,10 +75,11 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// 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 SourceControl. /// Properties used to create a Container App SourceControl. + /// Github personal access token used for SourceControl. /// 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 sourceControlName, ContainerAppSourceControlData data, CancellationToken cancellationToken = default) + public virtual async Task> CreateOrUpdateAsync(WaitUntil waitUntil, string sourceControlName, ContainerAppSourceControlData data, string xMsGitHubAuxiliary = null, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(sourceControlName, nameof(sourceControlName)); Argument.AssertNotNull(data, nameof(data)); @@ -87,8 +88,8 @@ public virtual async Task> Creat scope.Start(); try { - var response = await _containerAppSourceControlContainerAppsSourceControlsRestClient.CreateOrUpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, sourceControlName, data, cancellationToken).ConfigureAwait(false); - var operation = new AppContainersArmOperation(new ContainerAppSourceControlOperationSource(Client), _containerAppSourceControlContainerAppsSourceControlsClientDiagnostics, Pipeline, _containerAppSourceControlContainerAppsSourceControlsRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, sourceControlName, data).Request, response, OperationFinalStateVia.Location); + var response = await _containerAppSourceControlContainerAppsSourceControlsRestClient.CreateOrUpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, sourceControlName, data, xMsGitHubAuxiliary, cancellationToken).ConfigureAwait(false); + var operation = new AppContainersArmOperation(new ContainerAppSourceControlOperationSource(Client), _containerAppSourceControlContainerAppsSourceControlsClientDiagnostics, Pipeline, _containerAppSourceControlContainerAppsSourceControlsRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, sourceControlName, data, xMsGitHubAuxiliary).Request, response, OperationFinalStateVia.Location); if (waitUntil == WaitUntil.Completed) await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); return operation; @@ -113,7 +114,7 @@ public virtual async Task> Creat /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -124,10 +125,11 @@ public virtual async Task> Creat /// 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 SourceControl. /// Properties used to create a Container App SourceControl. + /// Github personal access token used for SourceControl. /// 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 sourceControlName, ContainerAppSourceControlData data, CancellationToken cancellationToken = default) + public virtual ArmOperation CreateOrUpdate(WaitUntil waitUntil, string sourceControlName, ContainerAppSourceControlData data, string xMsGitHubAuxiliary = null, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(sourceControlName, nameof(sourceControlName)); Argument.AssertNotNull(data, nameof(data)); @@ -136,8 +138,8 @@ public virtual ArmOperation CreateOrUpdate(Wa scope.Start(); try { - var response = _containerAppSourceControlContainerAppsSourceControlsRestClient.CreateOrUpdate(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, sourceControlName, data, cancellationToken); - var operation = new AppContainersArmOperation(new ContainerAppSourceControlOperationSource(Client), _containerAppSourceControlContainerAppsSourceControlsClientDiagnostics, Pipeline, _containerAppSourceControlContainerAppsSourceControlsRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, sourceControlName, data).Request, response, OperationFinalStateVia.Location); + var response = _containerAppSourceControlContainerAppsSourceControlsRestClient.CreateOrUpdate(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, sourceControlName, data, xMsGitHubAuxiliary, cancellationToken); + var operation = new AppContainersArmOperation(new ContainerAppSourceControlOperationSource(Client), _containerAppSourceControlContainerAppsSourceControlsClientDiagnostics, Pipeline, _containerAppSourceControlContainerAppsSourceControlsRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, sourceControlName, data, xMsGitHubAuxiliary).Request, response, OperationFinalStateVia.Location); if (waitUntil == WaitUntil.Completed) operation.WaitForCompletion(cancellationToken); return operation; @@ -162,7 +164,7 @@ public virtual ArmOperation CreateOrUpdate(Wa /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -207,7 +209,7 @@ public virtual async Task> GetAsync( /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -252,7 +254,7 @@ public virtual Response Get(string sourceCont /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -282,7 +284,7 @@ public virtual AsyncPageable GetAllAsync(Canc /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -312,7 +314,7 @@ public virtual Pageable GetAll(CancellationTo /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -355,7 +357,7 @@ public virtual async Task> ExistsAsync(string sourceControlName, /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -398,7 +400,7 @@ public virtual Response Exists(string sourceControlName, CancellationToken /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -443,7 +445,7 @@ public virtual async Task> G /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/ContainerAppSourceControlResource.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/ContainerAppSourceControlResource.cs index 6df1895b0299..8a3291d05d9d 100644 --- a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/ContainerAppSourceControlResource.cs +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/ContainerAppSourceControlResource.cs @@ -101,7 +101,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -141,7 +141,7 @@ public virtual async Task> GetAsync( /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -181,7 +181,7 @@ public virtual Response Get(CancellationToken /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -190,15 +190,18 @@ public virtual Response Get(CancellationToken /// /// /// 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. + /// Github personal access token used for SourceControl. + /// Ignore Workflow Deletion Failure. + /// Delete workflow. /// The cancellation token to use. - public virtual async Task DeleteAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default) + public virtual async Task DeleteAsync(WaitUntil waitUntil, string xMsGitHubAuxiliary = null, bool? ignoreWorkflowDeletionFailure = null, bool? deleteWorkflow = null, CancellationToken cancellationToken = default) { using var scope = _containerAppSourceControlContainerAppsSourceControlsClientDiagnostics.CreateScope("ContainerAppSourceControlResource.Delete"); scope.Start(); try { - var response = await _containerAppSourceControlContainerAppsSourceControlsRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); - var operation = new AppContainersArmOperation(_containerAppSourceControlContainerAppsSourceControlsClientDiagnostics, Pipeline, _containerAppSourceControlContainerAppsSourceControlsRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); + var response = await _containerAppSourceControlContainerAppsSourceControlsRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, xMsGitHubAuxiliary, ignoreWorkflowDeletionFailure, deleteWorkflow, cancellationToken).ConfigureAwait(false); + var operation = new AppContainersArmOperation(_containerAppSourceControlContainerAppsSourceControlsClientDiagnostics, Pipeline, _containerAppSourceControlContainerAppsSourceControlsRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, xMsGitHubAuxiliary, ignoreWorkflowDeletionFailure, deleteWorkflow).Request, response, OperationFinalStateVia.Location); if (waitUntil == WaitUntil.Completed) await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); return operation; @@ -223,7 +226,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -232,15 +235,18 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// 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. + /// Github personal access token used for SourceControl. + /// Ignore Workflow Deletion Failure. + /// Delete workflow. /// The cancellation token to use. - public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancellationToken = default) + public virtual ArmOperation Delete(WaitUntil waitUntil, string xMsGitHubAuxiliary = null, bool? ignoreWorkflowDeletionFailure = null, bool? deleteWorkflow = null, CancellationToken cancellationToken = default) { using var scope = _containerAppSourceControlContainerAppsSourceControlsClientDiagnostics.CreateScope("ContainerAppSourceControlResource.Delete"); scope.Start(); try { - var response = _containerAppSourceControlContainerAppsSourceControlsRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); - var operation = new AppContainersArmOperation(_containerAppSourceControlContainerAppsSourceControlsClientDiagnostics, Pipeline, _containerAppSourceControlContainerAppsSourceControlsRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); + var response = _containerAppSourceControlContainerAppsSourceControlsRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, xMsGitHubAuxiliary, ignoreWorkflowDeletionFailure, deleteWorkflow, cancellationToken); + var operation = new AppContainersArmOperation(_containerAppSourceControlContainerAppsSourceControlsClientDiagnostics, Pipeline, _containerAppSourceControlContainerAppsSourceControlsRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, xMsGitHubAuxiliary, ignoreWorkflowDeletionFailure, deleteWorkflow).Request, response, OperationFinalStateVia.Location); if (waitUntil == WaitUntil.Completed) operation.WaitForCompletionResponse(cancellationToken); return operation; @@ -265,7 +271,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -275,9 +281,10 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// 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. /// Properties used to create a Container App SourceControl. + /// Github personal access token used for SourceControl. /// The cancellation token to use. /// is null. - public virtual async Task> UpdateAsync(WaitUntil waitUntil, ContainerAppSourceControlData data, CancellationToken cancellationToken = default) + public virtual async Task> UpdateAsync(WaitUntil waitUntil, ContainerAppSourceControlData data, string xMsGitHubAuxiliary = null, CancellationToken cancellationToken = default) { Argument.AssertNotNull(data, nameof(data)); @@ -285,8 +292,8 @@ public virtual async Task> Updat scope.Start(); try { - var response = await _containerAppSourceControlContainerAppsSourceControlsRestClient.CreateOrUpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, cancellationToken).ConfigureAwait(false); - var operation = new AppContainersArmOperation(new ContainerAppSourceControlOperationSource(Client), _containerAppSourceControlContainerAppsSourceControlsClientDiagnostics, Pipeline, _containerAppSourceControlContainerAppsSourceControlsRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data).Request, response, OperationFinalStateVia.Location); + var response = await _containerAppSourceControlContainerAppsSourceControlsRestClient.CreateOrUpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, xMsGitHubAuxiliary, cancellationToken).ConfigureAwait(false); + var operation = new AppContainersArmOperation(new ContainerAppSourceControlOperationSource(Client), _containerAppSourceControlContainerAppsSourceControlsClientDiagnostics, Pipeline, _containerAppSourceControlContainerAppsSourceControlsRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, xMsGitHubAuxiliary).Request, response, OperationFinalStateVia.Location); if (waitUntil == WaitUntil.Completed) await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); return operation; @@ -311,7 +318,7 @@ public virtual async Task> Updat /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -321,9 +328,10 @@ public virtual async Task> Updat /// /// 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. /// Properties used to create a Container App SourceControl. + /// Github personal access token used for SourceControl. /// The cancellation token to use. /// is null. - public virtual ArmOperation Update(WaitUntil waitUntil, ContainerAppSourceControlData data, CancellationToken cancellationToken = default) + public virtual ArmOperation Update(WaitUntil waitUntil, ContainerAppSourceControlData data, string xMsGitHubAuxiliary = null, CancellationToken cancellationToken = default) { Argument.AssertNotNull(data, nameof(data)); @@ -331,8 +339,8 @@ public virtual ArmOperation Update(WaitUntil scope.Start(); try { - var response = _containerAppSourceControlContainerAppsSourceControlsRestClient.CreateOrUpdate(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, cancellationToken); - var operation = new AppContainersArmOperation(new ContainerAppSourceControlOperationSource(Client), _containerAppSourceControlContainerAppsSourceControlsClientDiagnostics, Pipeline, _containerAppSourceControlContainerAppsSourceControlsRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data).Request, response, OperationFinalStateVia.Location); + var response = _containerAppSourceControlContainerAppsSourceControlsRestClient.CreateOrUpdate(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, xMsGitHubAuxiliary, cancellationToken); + var operation = new AppContainersArmOperation(new ContainerAppSourceControlOperationSource(Client), _containerAppSourceControlContainerAppsSourceControlsClientDiagnostics, Pipeline, _containerAppSourceControlContainerAppsSourceControlsRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, xMsGitHubAuxiliary).Request, response, OperationFinalStateVia.Location); if (waitUntil == WaitUntil.Completed) operation.WaitForCompletion(cancellationToken); return operation; diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/ContainerAppsBuildResource.Serialization.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/ContainerAppsBuildResource.Serialization.cs new file mode 100644 index 000000000000..b1bc19c41e41 --- /dev/null +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/ContainerAppsBuildResource.Serialization.cs @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; + +namespace Azure.ResourceManager.AppContainers +{ + public partial class ContainerAppsBuildResource : IJsonModel + { + private static ContainerAppsBuildResourceData s_dataDeserializationInstance; + private static ContainerAppsBuildResourceData DataDeserializationInstance => s_dataDeserializationInstance ??= new(); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); + + ContainerAppsBuildResourceData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)DataDeserializationInstance).Create(ref reader, options); + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options, AzureResourceManagerAppContainersContext.Default); + + ContainerAppsBuildResourceData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options, AzureResourceManagerAppContainersContext.Default); + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)DataDeserializationInstance).GetFormatFromOptions(options); + } +} diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/ContainerAppsBuildResource.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/ContainerAppsBuildResource.cs new file mode 100644 index 000000000000..1e19e4a51feb --- /dev/null +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/ContainerAppsBuildResource.cs @@ -0,0 +1,255 @@ +// 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.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.AppContainers +{ + /// + /// A Class representing a ContainerAppsBuildResource 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 GetContainerAppsBuildResource method. + /// Otherwise you can get one from its parent resource using the GetContainerAppsBuildResource method. + /// + public partial class ContainerAppsBuildResource : ArmResource + { + /// Generate the resource identifier of a instance. + /// The subscriptionId. + /// The resourceGroupName. + /// The containerAppName. + /// The buildName. + public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string containerAppName, string buildName) + { + var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/builds/{buildName}"; + return new ResourceIdentifier(resourceId); + } + + private readonly ClientDiagnostics _containerAppsBuildResourceContainerAppsBuildsClientDiagnostics; + private readonly ContainerAppsBuildsRestOperations _containerAppsBuildResourceContainerAppsBuildsRestClient; + private readonly ContainerAppsBuildResourceData _data; + + /// Gets the resource type for the operations. + public static readonly ResourceType ResourceType = "Microsoft.App/containerApps/builds"; + + /// Initializes a new instance of the class for mocking. + protected ContainerAppsBuildResource() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The resource that is the target of operations. + internal ContainerAppsBuildResource(ArmClient client, ContainerAppsBuildResourceData 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 ContainerAppsBuildResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _containerAppsBuildResourceContainerAppsBuildsClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.AppContainers", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string containerAppsBuildResourceContainerAppsBuildsApiVersion); + _containerAppsBuildResourceContainerAppsBuildsRestClient = new ContainerAppsBuildsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, containerAppsBuildResourceContainerAppsBuildsApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + /// 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 ContainerAppsBuildResourceData 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 a Container Apps Build resource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/builds/{buildName} + /// + /// + /// Operation Id + /// ContainerAppsBuilds_Get + /// + /// + /// Default Api Version + /// 2025-02-02-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + { + using var scope = _containerAppsBuildResourceContainerAppsBuildsClientDiagnostics.CreateScope("ContainerAppsBuildResource.Get"); + scope.Start(); + try + { + var response = await _containerAppsBuildResourceContainerAppsBuildsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new ContainerAppsBuildResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a Container Apps Build resource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/builds/{buildName} + /// + /// + /// Operation Id + /// ContainerAppsBuilds_Get + /// + /// + /// Default Api Version + /// 2025-02-02-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual Response Get(CancellationToken cancellationToken = default) + { + using var scope = _containerAppsBuildResourceContainerAppsBuildsClientDiagnostics.CreateScope("ContainerAppsBuildResource.Get"); + scope.Start(); + try + { + var response = _containerAppsBuildResourceContainerAppsBuildsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new ContainerAppsBuildResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Delete a Container Apps Build resource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/builds/{buildName} + /// + /// + /// Operation Id + /// ContainerAppsBuilds_Delete + /// + /// + /// Default Api Version + /// 2025-02-02-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// 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 = _containerAppsBuildResourceContainerAppsBuildsClientDiagnostics.CreateScope("ContainerAppsBuildResource.Delete"); + scope.Start(); + try + { + var response = await _containerAppsBuildResourceContainerAppsBuildsRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + var operation = new AppContainersArmOperation(_containerAppsBuildResourceContainerAppsBuildsClientDiagnostics, Pipeline, _containerAppsBuildResourceContainerAppsBuildsRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, 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; + } + } + + /// + /// Delete a Container Apps Build resource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/builds/{buildName} + /// + /// + /// Operation Id + /// ContainerAppsBuilds_Delete + /// + /// + /// Default Api Version + /// 2025-02-02-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// 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 = _containerAppsBuildResourceContainerAppsBuildsClientDiagnostics.CreateScope("ContainerAppsBuildResource.Delete"); + scope.Start(); + try + { + var response = _containerAppsBuildResourceContainerAppsBuildsRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + var operation = new AppContainersArmOperation(_containerAppsBuildResourceContainerAppsBuildsClientDiagnostics, Pipeline, _containerAppsBuildResourceContainerAppsBuildsRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletionResponse(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/ContainerAppsBuildResourceCollection.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/ContainerAppsBuildResourceCollection.cs new file mode 100644 index 000000000000..3a18ac5d50d1 --- /dev/null +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/ContainerAppsBuildResourceCollection.cs @@ -0,0 +1,400 @@ +// 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 Autorest.CSharp.Core; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.AppContainers +{ + /// + /// 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 GetContainerAppsBuildResources method from an instance of . + /// + public partial class ContainerAppsBuildResourceCollection : ArmCollection, IEnumerable, IAsyncEnumerable + { + private readonly ClientDiagnostics _containerAppsBuildResourceContainerAppsBuildsClientDiagnostics; + private readonly ContainerAppsBuildsRestOperations _containerAppsBuildResourceContainerAppsBuildsRestClient; + private readonly ClientDiagnostics _containerAppsBuildResourceContainerAppsBuildsByContainerAppClientDiagnostics; + private readonly ContainerAppsBuildsByContainerAppRestOperations _containerAppsBuildResourceContainerAppsBuildsByContainerAppRestClient; + + /// Initializes a new instance of the class for mocking. + protected ContainerAppsBuildResourceCollection() + { + } + + /// 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 ContainerAppsBuildResourceCollection(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _containerAppsBuildResourceContainerAppsBuildsClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.AppContainers", ContainerAppsBuildResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ContainerAppsBuildResource.ResourceType, out string containerAppsBuildResourceContainerAppsBuildsApiVersion); + _containerAppsBuildResourceContainerAppsBuildsRestClient = new ContainerAppsBuildsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, containerAppsBuildResourceContainerAppsBuildsApiVersion); + _containerAppsBuildResourceContainerAppsBuildsByContainerAppClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.AppContainers", ContainerAppsBuildResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ContainerAppsBuildResource.ResourceType, out string containerAppsBuildResourceContainerAppsBuildsByContainerAppApiVersion); + _containerAppsBuildResourceContainerAppsBuildsByContainerAppRestClient = new ContainerAppsBuildsByContainerAppRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, containerAppsBuildResourceContainerAppsBuildsByContainerAppApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != ContainerAppResource.ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ContainerAppResource.ResourceType), nameof(id)); + } + + /// + /// Get a Container Apps Build resource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/builds/{buildName} + /// + /// + /// Operation Id + /// ContainerAppsBuilds_Get + /// + /// + /// Default Api Version + /// 2025-02-02-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of a build. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetAsync(string buildName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(buildName, nameof(buildName)); + + using var scope = _containerAppsBuildResourceContainerAppsBuildsClientDiagnostics.CreateScope("ContainerAppsBuildResourceCollection.Get"); + scope.Start(); + try + { + var response = await _containerAppsBuildResourceContainerAppsBuildsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, buildName, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new ContainerAppsBuildResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a Container Apps Build resource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/builds/{buildName} + /// + /// + /// Operation Id + /// ContainerAppsBuilds_Get + /// + /// + /// Default Api Version + /// 2025-02-02-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of a build. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Get(string buildName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(buildName, nameof(buildName)); + + using var scope = _containerAppsBuildResourceContainerAppsBuildsClientDiagnostics.CreateScope("ContainerAppsBuildResourceCollection.Get"); + scope.Start(); + try + { + var response = _containerAppsBuildResourceContainerAppsBuildsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, buildName, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new ContainerAppsBuildResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// List Container Apps Build resources by Container App + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/builds + /// + /// + /// Operation Id + /// ContainerAppsBuildsByContainerApp_List + /// + /// + /// Default Api Version + /// 2025-02-02-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// 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) => _containerAppsBuildResourceContainerAppsBuildsByContainerAppRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _containerAppsBuildResourceContainerAppsBuildsByContainerAppRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new ContainerAppsBuildResource(Client, ContainerAppsBuildResourceData.DeserializeContainerAppsBuildResourceData(e)), _containerAppsBuildResourceContainerAppsBuildsByContainerAppClientDiagnostics, Pipeline, "ContainerAppsBuildResourceCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// List Container Apps Build resources by Container App + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/builds + /// + /// + /// Operation Id + /// ContainerAppsBuildsByContainerApp_List + /// + /// + /// Default Api Version + /// 2025-02-02-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// 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) => _containerAppsBuildResourceContainerAppsBuildsByContainerAppRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _containerAppsBuildResourceContainerAppsBuildsByContainerAppRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new ContainerAppsBuildResource(Client, ContainerAppsBuildResourceData.DeserializeContainerAppsBuildResourceData(e)), _containerAppsBuildResourceContainerAppsBuildsByContainerAppClientDiagnostics, Pipeline, "ContainerAppsBuildResourceCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/builds/{buildName} + /// + /// + /// Operation Id + /// ContainerAppsBuilds_Get + /// + /// + /// Default Api Version + /// 2025-02-02-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of a build. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> ExistsAsync(string buildName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(buildName, nameof(buildName)); + + using var scope = _containerAppsBuildResourceContainerAppsBuildsClientDiagnostics.CreateScope("ContainerAppsBuildResourceCollection.Exists"); + scope.Start(); + try + { + var response = await _containerAppsBuildResourceContainerAppsBuildsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, buildName, 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.App/containerApps/{containerAppName}/builds/{buildName} + /// + /// + /// Operation Id + /// ContainerAppsBuilds_Get + /// + /// + /// Default Api Version + /// 2025-02-02-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of a build. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Exists(string buildName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(buildName, nameof(buildName)); + + using var scope = _containerAppsBuildResourceContainerAppsBuildsClientDiagnostics.CreateScope("ContainerAppsBuildResourceCollection.Exists"); + scope.Start(); + try + { + var response = _containerAppsBuildResourceContainerAppsBuildsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, buildName, cancellationToken: cancellationToken); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/builds/{buildName} + /// + /// + /// Operation Id + /// ContainerAppsBuilds_Get + /// + /// + /// Default Api Version + /// 2025-02-02-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of a build. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetIfExistsAsync(string buildName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(buildName, nameof(buildName)); + + using var scope = _containerAppsBuildResourceContainerAppsBuildsClientDiagnostics.CreateScope("ContainerAppsBuildResourceCollection.GetIfExists"); + scope.Start(); + try + { + var response = await _containerAppsBuildResourceContainerAppsBuildsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, buildName, cancellationToken: cancellationToken).ConfigureAwait(false); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new ContainerAppsBuildResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/builds/{buildName} + /// + /// + /// Operation Id + /// ContainerAppsBuilds_Get + /// + /// + /// Default Api Version + /// 2025-02-02-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of a build. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual NullableResponse GetIfExists(string buildName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(buildName, nameof(buildName)); + + using var scope = _containerAppsBuildResourceContainerAppsBuildsClientDiagnostics.CreateScope("ContainerAppsBuildResourceCollection.GetIfExists"); + scope.Start(); + try + { + var response = _containerAppsBuildResourceContainerAppsBuildsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, buildName, cancellationToken: cancellationToken); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new ContainerAppsBuildResource(Client, response.Value), 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/containerapps/Azure.ResourceManager.AppContainers/src/Generated/ContainerAppsBuildResourceData.Serialization.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/ContainerAppsBuildResourceData.Serialization.cs new file mode 100644 index 000000000000..bd115925fecf --- /dev/null +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/ContainerAppsBuildResourceData.Serialization.cs @@ -0,0 +1,387 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text; +using System.Text.Json; +using Azure.Core; +using Azure.ResourceManager.AppContainers.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.AppContainers +{ + public partial class ContainerAppsBuildResourceData : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ContainerAppsBuildResourceData)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + writer.WritePropertyName("properties"u8); + writer.WriteStartObject(); + if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) + { + writer.WritePropertyName("provisioningState"u8); + writer.WriteStringValue(ProvisioningState.Value.ToString()); + } + if (options.Format != "W" && Optional.IsDefined(BuildStatus)) + { + writer.WritePropertyName("buildStatus"u8); + writer.WriteStringValue(BuildStatus.Value.ToString()); + } + if (options.Format != "W" && Optional.IsDefined(DestinationContainerRegistry)) + { + writer.WritePropertyName("destinationContainerRegistry"u8); + writer.WriteObjectValue(DestinationContainerRegistry, options); + } + if (options.Format != "W" && Optional.IsDefined(Configuration)) + { + writer.WritePropertyName("configuration"u8); + writer.WriteObjectValue(Configuration, options); + } + if (options.Format != "W" && Optional.IsDefined(LogStreamEndpoint)) + { + writer.WritePropertyName("logStreamEndpoint"u8); + writer.WriteStringValue(LogStreamEndpoint); + } + writer.WriteEndObject(); + } + + ContainerAppsBuildResourceData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ContainerAppsBuildResourceData)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeContainerAppsBuildResourceData(document.RootElement, options); + } + + internal static ContainerAppsBuildResourceData DeserializeContainerAppsBuildResourceData(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ResourceIdentifier id = default; + string name = default; + ResourceType type = default; + SystemData systemData = default; + ContainerAppBuildProvisioningState? provisioningState = default; + ContainerAppBuildStatus? buildStatus = default; + ContainerRegistryWithCustomImage destinationContainerRegistry = default; + ContainerAppsBuildConfiguration configuration = default; + string logStreamEndpoint = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + 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.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + systemData = JsonSerializer.Deserialize(property.Value.GetRawText()); + continue; + } + if (property.NameEquals("properties"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + foreach (var property0 in property.Value.EnumerateObject()) + { + if (property0.NameEquals("provisioningState"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + provisioningState = new ContainerAppBuildProvisioningState(property0.Value.GetString()); + continue; + } + if (property0.NameEquals("buildStatus"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + buildStatus = new ContainerAppBuildStatus(property0.Value.GetString()); + continue; + } + if (property0.NameEquals("destinationContainerRegistry"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + destinationContainerRegistry = ContainerRegistryWithCustomImage.DeserializeContainerRegistryWithCustomImage(property0.Value, options); + continue; + } + if (property0.NameEquals("configuration"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + configuration = ContainerAppsBuildConfiguration.DeserializeContainerAppsBuildConfiguration(property0.Value, options); + continue; + } + if (property0.NameEquals("logStreamEndpoint"u8)) + { + logStreamEndpoint = property0.Value.GetString(); + continue; + } + } + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ContainerAppsBuildResourceData( + id, + name, + type, + systemData, + provisioningState, + buildStatus, + destinationContainerRegistry, + configuration, + logStreamEndpoint, + serializedAdditionalRawData); + } + + private BinaryData SerializeBicep(ModelReaderWriterOptions options) + { + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Name), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" name: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Name)) + { + builder.Append(" name: "); + if (Name.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{Name}'''"); + } + else + { + builder.AppendLine($"'{Name}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Id), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" id: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Id)) + { + builder.Append(" id: "); + builder.AppendLine($"'{Id.ToString()}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(SystemData), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" systemData: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(SystemData)) + { + builder.Append(" systemData: "); + builder.AppendLine($"'{SystemData.ToString()}'"); + } + } + + builder.Append(" properties:"); + builder.AppendLine(" {"); + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(ProvisioningState), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" provisioningState: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(ProvisioningState)) + { + builder.Append(" provisioningState: "); + builder.AppendLine($"'{ProvisioningState.Value.ToString()}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(BuildStatus), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" buildStatus: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(BuildStatus)) + { + builder.Append(" buildStatus: "); + builder.AppendLine($"'{BuildStatus.Value.ToString()}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(DestinationContainerRegistry), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" destinationContainerRegistry: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(DestinationContainerRegistry)) + { + builder.Append(" destinationContainerRegistry: "); + BicepSerializationHelpers.AppendChildObject(builder, DestinationContainerRegistry, options, 4, false, " destinationContainerRegistry: "); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Configuration), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" configuration: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Configuration)) + { + builder.Append(" configuration: "); + BicepSerializationHelpers.AppendChildObject(builder, Configuration, options, 4, false, " configuration: "); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(LogStreamEndpoint), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" logStreamEndpoint: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(LogStreamEndpoint)) + { + builder.Append(" logStreamEndpoint: "); + if (LogStreamEndpoint.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{LogStreamEndpoint}'''"); + } + else + { + builder.AppendLine($"'{LogStreamEndpoint}'"); + } + } + } + + builder.AppendLine(" }"); + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerAppContainersContext.Default); + case "bicep": + return SerializeBicep(options); + default: + throw new FormatException($"The model {nameof(ContainerAppsBuildResourceData)} does not support writing '{options.Format}' format."); + } + } + + ContainerAppsBuildResourceData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeContainerAppsBuildResourceData(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ContainerAppsBuildResourceData)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/ContainerAppsBuildResourceData.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/ContainerAppsBuildResourceData.cs new file mode 100644 index 000000000000..f2f8897cbccd --- /dev/null +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/ContainerAppsBuildResourceData.cs @@ -0,0 +1,96 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; +using Azure.ResourceManager.AppContainers.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.AppContainers +{ + /// + /// A class representing the ContainerAppsBuildResource data model. + /// Information pertaining to an individual build. + /// + public partial class ContainerAppsBuildResourceData : ResourceData + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public ContainerAppsBuildResourceData() + { + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// Build provisioning state. + /// Status of the build once it has been provisioned. + /// Container registry that the final image will be uploaded to. + /// Configuration of the build. + /// Endpoint from which the build logs can be streamed. + /// Keeps track of any properties unknown to the library. + internal ContainerAppsBuildResourceData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, ContainerAppBuildProvisioningState? provisioningState, ContainerAppBuildStatus? buildStatus, ContainerRegistryWithCustomImage destinationContainerRegistry, ContainerAppsBuildConfiguration configuration, string logStreamEndpoint, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) + { + ProvisioningState = provisioningState; + BuildStatus = buildStatus; + DestinationContainerRegistry = destinationContainerRegistry; + Configuration = configuration; + LogStreamEndpoint = logStreamEndpoint; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Build provisioning state. + [WirePath("properties.provisioningState")] + public ContainerAppBuildProvisioningState? ProvisioningState { get; } + /// Status of the build once it has been provisioned. + [WirePath("properties.buildStatus")] + public ContainerAppBuildStatus? BuildStatus { get; } + /// Container registry that the final image will be uploaded to. + [WirePath("properties.destinationContainerRegistry")] + public ContainerRegistryWithCustomImage DestinationContainerRegistry { get; } + /// Configuration of the build. + [WirePath("properties.configuration")] + public ContainerAppsBuildConfiguration Configuration { get; } + /// Endpoint from which the build logs can be streamed. + [WirePath("properties.logStreamEndpoint")] + public string LogStreamEndpoint { get; } + } +} diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/ContainerAppsPatchResource.Serialization.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/ContainerAppsPatchResource.Serialization.cs new file mode 100644 index 000000000000..39b26f6b1254 --- /dev/null +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/ContainerAppsPatchResource.Serialization.cs @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; + +namespace Azure.ResourceManager.AppContainers +{ + public partial class ContainerAppsPatchResource : IJsonModel + { + private static ContainerAppsPatchResourceData s_dataDeserializationInstance; + private static ContainerAppsPatchResourceData DataDeserializationInstance => s_dataDeserializationInstance ??= new(); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); + + ContainerAppsPatchResourceData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)DataDeserializationInstance).Create(ref reader, options); + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options, AzureResourceManagerAppContainersContext.Default); + + ContainerAppsPatchResourceData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options, AzureResourceManagerAppContainersContext.Default); + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)DataDeserializationInstance).GetFormatFromOptions(options); + } +} diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/ContainerAppsPatchResource.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/ContainerAppsPatchResource.cs new file mode 100644 index 000000000000..43eff6a16bf8 --- /dev/null +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/ContainerAppsPatchResource.cs @@ -0,0 +1,432 @@ +// 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.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.AppContainers.Models; + +namespace Azure.ResourceManager.AppContainers +{ + /// + /// A Class representing a ContainerAppsPatchResource 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 GetContainerAppsPatchResource method. + /// Otherwise you can get one from its parent resource using the GetContainerAppsPatchResource method. + /// + public partial class ContainerAppsPatchResource : ArmResource + { + /// Generate the resource identifier of a instance. + /// The subscriptionId. + /// The resourceGroupName. + /// The containerAppName. + /// The patchName. + public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string containerAppName, string patchName) + { + var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/patches/{patchName}"; + return new ResourceIdentifier(resourceId); + } + + private readonly ClientDiagnostics _containerAppsPatchResourceContainerAppsPatchesClientDiagnostics; + private readonly ContainerAppsPatchesRestOperations _containerAppsPatchResourceContainerAppsPatchesRestClient; + private readonly ContainerAppsPatchResourceData _data; + + /// Gets the resource type for the operations. + public static readonly ResourceType ResourceType = "Microsoft.App/containerApps/patches"; + + /// Initializes a new instance of the class for mocking. + protected ContainerAppsPatchResource() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The resource that is the target of operations. + internal ContainerAppsPatchResource(ArmClient client, ContainerAppsPatchResourceData 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 ContainerAppsPatchResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _containerAppsPatchResourceContainerAppsPatchesClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.AppContainers", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string containerAppsPatchResourceContainerAppsPatchesApiVersion); + _containerAppsPatchResourceContainerAppsPatchesRestClient = new ContainerAppsPatchesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, containerAppsPatchResourceContainerAppsPatchesApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + /// 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 ContainerAppsPatchResourceData 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 details for specific Container Apps Patch by patch name. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/patches/{patchName} + /// + /// + /// Operation Id + /// ContainerAppsPatches_Get + /// + /// + /// Default Api Version + /// 2025-02-02-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + { + using var scope = _containerAppsPatchResourceContainerAppsPatchesClientDiagnostics.CreateScope("ContainerAppsPatchResource.Get"); + scope.Start(); + try + { + var response = await _containerAppsPatchResourceContainerAppsPatchesRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new ContainerAppsPatchResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get details for specific Container Apps Patch by patch name. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/patches/{patchName} + /// + /// + /// Operation Id + /// ContainerAppsPatches_Get + /// + /// + /// Default Api Version + /// 2025-02-02-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual Response Get(CancellationToken cancellationToken = default) + { + using var scope = _containerAppsPatchResourceContainerAppsPatchesClientDiagnostics.CreateScope("ContainerAppsPatchResource.Get"); + scope.Start(); + try + { + var response = _containerAppsPatchResourceContainerAppsPatchesRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new ContainerAppsPatchResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Delete specific Container Apps Patch by patch name. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/patches/{patchName} + /// + /// + /// Operation Id + /// ContainerAppsPatches_Delete + /// + /// + /// Default Api Version + /// 2025-02-02-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// 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 = _containerAppsPatchResourceContainerAppsPatchesClientDiagnostics.CreateScope("ContainerAppsPatchResource.Delete"); + scope.Start(); + try + { + var response = await _containerAppsPatchResourceContainerAppsPatchesRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + var operation = new AppContainersArmOperation(_containerAppsPatchResourceContainerAppsPatchesClientDiagnostics, Pipeline, _containerAppsPatchResourceContainerAppsPatchesRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, 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; + } + } + + /// + /// Delete specific Container Apps Patch by patch name. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/patches/{patchName} + /// + /// + /// Operation Id + /// ContainerAppsPatches_Delete + /// + /// + /// Default Api Version + /// 2025-02-02-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// 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 = _containerAppsPatchResourceContainerAppsPatchesClientDiagnostics.CreateScope("ContainerAppsPatchResource.Delete"); + scope.Start(); + try + { + var response = _containerAppsPatchResourceContainerAppsPatchesRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + var operation = new AppContainersArmOperation(_containerAppsPatchResourceContainerAppsPatchesClientDiagnostics, Pipeline, _containerAppsPatchResourceContainerAppsPatchesRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletionResponse(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Configure the Container Apps Patch skip option by patch name. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/patches/{patchName}/skipConfig + /// + /// + /// Operation Id + /// ContainerAppsPatches_SkipConfigure + /// + /// + /// Default Api Version + /// 2025-02-02-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// 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. + /// Configure patcher to skip a patch or not. + /// The cancellation token to use. + /// is null. + public virtual async Task SkipConfigureAsync(WaitUntil waitUntil, PatchSkipConfig patchSkipConfig, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(patchSkipConfig, nameof(patchSkipConfig)); + + using var scope = _containerAppsPatchResourceContainerAppsPatchesClientDiagnostics.CreateScope("ContainerAppsPatchResource.SkipConfigure"); + scope.Start(); + try + { + var response = await _containerAppsPatchResourceContainerAppsPatchesRestClient.SkipConfigureAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, patchSkipConfig, cancellationToken).ConfigureAwait(false); + var operation = new AppContainersArmOperation(_containerAppsPatchResourceContainerAppsPatchesClientDiagnostics, Pipeline, _containerAppsPatchResourceContainerAppsPatchesRestClient.CreateSkipConfigureRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, patchSkipConfig).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Configure the Container Apps Patch skip option by patch name. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/patches/{patchName}/skipConfig + /// + /// + /// Operation Id + /// ContainerAppsPatches_SkipConfigure + /// + /// + /// Default Api Version + /// 2025-02-02-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// 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. + /// Configure patcher to skip a patch or not. + /// The cancellation token to use. + /// is null. + public virtual ArmOperation SkipConfigure(WaitUntil waitUntil, PatchSkipConfig patchSkipConfig, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(patchSkipConfig, nameof(patchSkipConfig)); + + using var scope = _containerAppsPatchResourceContainerAppsPatchesClientDiagnostics.CreateScope("ContainerAppsPatchResource.SkipConfigure"); + scope.Start(); + try + { + var response = _containerAppsPatchResourceContainerAppsPatchesRestClient.SkipConfigure(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, patchSkipConfig, cancellationToken); + var operation = new AppContainersArmOperation(_containerAppsPatchResourceContainerAppsPatchesClientDiagnostics, Pipeline, _containerAppsPatchResourceContainerAppsPatchesRestClient.CreateSkipConfigureRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, patchSkipConfig).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletionResponse(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Apply a Container Apps Patch resource with patch name. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/patches/{patchName}/apply + /// + /// + /// Operation Id + /// ContainerAppsPatches_Apply + /// + /// + /// Default Api Version + /// 2025-02-02-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// 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> ApplyAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default) + { + using var scope = _containerAppsPatchResourceContainerAppsPatchesClientDiagnostics.CreateScope("ContainerAppsPatchResource.Apply"); + scope.Start(); + try + { + var response = await _containerAppsPatchResourceContainerAppsPatchesRestClient.ApplyAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + var operation = new AppContainersArmOperation(new ContainerAppsPatchResourceOperationSource(Client), _containerAppsPatchResourceContainerAppsPatchesClientDiagnostics, Pipeline, _containerAppsPatchResourceContainerAppsPatchesRestClient.CreateApplyRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Apply a Container Apps Patch resource with patch name. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/patches/{patchName}/apply + /// + /// + /// Operation Id + /// ContainerAppsPatches_Apply + /// + /// + /// Default Api Version + /// 2025-02-02-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// 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 Apply(WaitUntil waitUntil, CancellationToken cancellationToken = default) + { + using var scope = _containerAppsPatchResourceContainerAppsPatchesClientDiagnostics.CreateScope("ContainerAppsPatchResource.Apply"); + scope.Start(); + try + { + var response = _containerAppsPatchResourceContainerAppsPatchesRestClient.Apply(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + var operation = new AppContainersArmOperation(new ContainerAppsPatchResourceOperationSource(Client), _containerAppsPatchResourceContainerAppsPatchesClientDiagnostics, Pipeline, _containerAppsPatchResourceContainerAppsPatchesRestClient.CreateApplyRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/ContainerAppsPatchResourceCollection.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/ContainerAppsPatchResourceCollection.cs new file mode 100644 index 000000000000..65f801e6cb9d --- /dev/null +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/ContainerAppsPatchResourceCollection.cs @@ -0,0 +1,397 @@ +// 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 Autorest.CSharp.Core; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.AppContainers +{ + /// + /// 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 GetContainerAppsPatchResources method from an instance of . + /// + public partial class ContainerAppsPatchResourceCollection : ArmCollection, IEnumerable, IAsyncEnumerable + { + private readonly ClientDiagnostics _containerAppsPatchResourceContainerAppsPatchesClientDiagnostics; + private readonly ContainerAppsPatchesRestOperations _containerAppsPatchResourceContainerAppsPatchesRestClient; + + /// Initializes a new instance of the class for mocking. + protected ContainerAppsPatchResourceCollection() + { + } + + /// 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 ContainerAppsPatchResourceCollection(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _containerAppsPatchResourceContainerAppsPatchesClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.AppContainers", ContainerAppsPatchResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ContainerAppsPatchResource.ResourceType, out string containerAppsPatchResourceContainerAppsPatchesApiVersion); + _containerAppsPatchResourceContainerAppsPatchesRestClient = new ContainerAppsPatchesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, containerAppsPatchResourceContainerAppsPatchesApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != ContainerAppResource.ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ContainerAppResource.ResourceType), nameof(id)); + } + + /// + /// Get details for specific Container Apps Patch by patch name. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/patches/{patchName} + /// + /// + /// Operation Id + /// ContainerAppsPatches_Get + /// + /// + /// Default Api Version + /// 2025-02-02-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the patch. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetAsync(string patchName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(patchName, nameof(patchName)); + + using var scope = _containerAppsPatchResourceContainerAppsPatchesClientDiagnostics.CreateScope("ContainerAppsPatchResourceCollection.Get"); + scope.Start(); + try + { + var response = await _containerAppsPatchResourceContainerAppsPatchesRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, patchName, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new ContainerAppsPatchResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get details for specific Container Apps Patch by patch name. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/patches/{patchName} + /// + /// + /// Operation Id + /// ContainerAppsPatches_Get + /// + /// + /// Default Api Version + /// 2025-02-02-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the patch. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Get(string patchName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(patchName, nameof(patchName)); + + using var scope = _containerAppsPatchResourceContainerAppsPatchesClientDiagnostics.CreateScope("ContainerAppsPatchResourceCollection.Get"); + scope.Start(); + try + { + var response = _containerAppsPatchResourceContainerAppsPatchesRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, patchName, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new ContainerAppsPatchResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// List Container Apps Patch resources by ContainerApp. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/patches + /// + /// + /// Operation Id + /// ContainerAppsPatches_ListByContainerApp + /// + /// + /// Default Api Version + /// 2025-02-02-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The filter to apply on the operation. For example, $filter=properties/patchApplyStatus eq 'Succeeded'. + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetAllAsync(string filter = null, CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _containerAppsPatchResourceContainerAppsPatchesRestClient.CreateListByContainerAppRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, filter); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _containerAppsPatchResourceContainerAppsPatchesRestClient.CreateListByContainerAppNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name, filter); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new ContainerAppsPatchResource(Client, ContainerAppsPatchResourceData.DeserializeContainerAppsPatchResourceData(e)), _containerAppsPatchResourceContainerAppsPatchesClientDiagnostics, Pipeline, "ContainerAppsPatchResourceCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// List Container Apps Patch resources by ContainerApp. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/patches + /// + /// + /// Operation Id + /// ContainerAppsPatches_ListByContainerApp + /// + /// + /// Default Api Version + /// 2025-02-02-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The filter to apply on the operation. For example, $filter=properties/patchApplyStatus eq 'Succeeded'. + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetAll(string filter = null, CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _containerAppsPatchResourceContainerAppsPatchesRestClient.CreateListByContainerAppRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, filter); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _containerAppsPatchResourceContainerAppsPatchesRestClient.CreateListByContainerAppNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name, filter); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new ContainerAppsPatchResource(Client, ContainerAppsPatchResourceData.DeserializeContainerAppsPatchResourceData(e)), _containerAppsPatchResourceContainerAppsPatchesClientDiagnostics, Pipeline, "ContainerAppsPatchResourceCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/patches/{patchName} + /// + /// + /// Operation Id + /// ContainerAppsPatches_Get + /// + /// + /// Default Api Version + /// 2025-02-02-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the patch. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> ExistsAsync(string patchName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(patchName, nameof(patchName)); + + using var scope = _containerAppsPatchResourceContainerAppsPatchesClientDiagnostics.CreateScope("ContainerAppsPatchResourceCollection.Exists"); + scope.Start(); + try + { + var response = await _containerAppsPatchResourceContainerAppsPatchesRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, patchName, 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.App/containerApps/{containerAppName}/patches/{patchName} + /// + /// + /// Operation Id + /// ContainerAppsPatches_Get + /// + /// + /// Default Api Version + /// 2025-02-02-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the patch. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Exists(string patchName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(patchName, nameof(patchName)); + + using var scope = _containerAppsPatchResourceContainerAppsPatchesClientDiagnostics.CreateScope("ContainerAppsPatchResourceCollection.Exists"); + scope.Start(); + try + { + var response = _containerAppsPatchResourceContainerAppsPatchesRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, patchName, cancellationToken: cancellationToken); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/patches/{patchName} + /// + /// + /// Operation Id + /// ContainerAppsPatches_Get + /// + /// + /// Default Api Version + /// 2025-02-02-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the patch. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetIfExistsAsync(string patchName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(patchName, nameof(patchName)); + + using var scope = _containerAppsPatchResourceContainerAppsPatchesClientDiagnostics.CreateScope("ContainerAppsPatchResourceCollection.GetIfExists"); + scope.Start(); + try + { + var response = await _containerAppsPatchResourceContainerAppsPatchesRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, patchName, cancellationToken: cancellationToken).ConfigureAwait(false); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new ContainerAppsPatchResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/patches/{patchName} + /// + /// + /// Operation Id + /// ContainerAppsPatches_Get + /// + /// + /// Default Api Version + /// 2025-02-02-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the patch. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual NullableResponse GetIfExists(string patchName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(patchName, nameof(patchName)); + + using var scope = _containerAppsPatchResourceContainerAppsPatchesClientDiagnostics.CreateScope("ContainerAppsPatchResourceCollection.GetIfExists"); + scope.Start(); + try + { + var response = _containerAppsPatchResourceContainerAppsPatchesRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, patchName, cancellationToken: cancellationToken); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new ContainerAppsPatchResource(Client, response.Value), 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/containerapps/Azure.ResourceManager.AppContainers/src/Generated/ContainerAppsPatchResourceData.Serialization.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/ContainerAppsPatchResourceData.Serialization.cs new file mode 100644 index 000000000000..a648b9878a8a --- /dev/null +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/ContainerAppsPatchResourceData.Serialization.cs @@ -0,0 +1,241 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text; +using System.Text.Json; +using Azure.Core; +using Azure.ResourceManager.AppContainers.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.AppContainers +{ + public partial class ContainerAppsPatchResourceData : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ContainerAppsPatchResourceData)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + if (options.Format != "W" && Optional.IsDefined(Properties)) + { + writer.WritePropertyName("properties"u8); + writer.WriteObjectValue(Properties, options); + } + } + + ContainerAppsPatchResourceData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ContainerAppsPatchResourceData)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeContainerAppsPatchResourceData(document.RootElement, options); + } + + internal static ContainerAppsPatchResourceData DeserializeContainerAppsPatchResourceData(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + PatchProperties properties = default; + ResourceIdentifier id = default; + string name = default; + ResourceType type = default; + SystemData systemData = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("properties"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + properties = PatchProperties.DeserializePatchProperties(property.Value, options); + 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.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + systemData = JsonSerializer.Deserialize(property.Value.GetRawText()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ContainerAppsPatchResourceData( + id, + name, + type, + systemData, + properties, + serializedAdditionalRawData); + } + + private BinaryData SerializeBicep(ModelReaderWriterOptions options) + { + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Name), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" name: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Name)) + { + builder.Append(" name: "); + if (Name.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{Name}'''"); + } + else + { + builder.AppendLine($"'{Name}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Properties), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" properties: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Properties)) + { + builder.Append(" properties: "); + BicepSerializationHelpers.AppendChildObject(builder, Properties, options, 2, false, " properties: "); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Id), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" id: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Id)) + { + builder.Append(" id: "); + builder.AppendLine($"'{Id.ToString()}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(SystemData), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" systemData: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(SystemData)) + { + builder.Append(" systemData: "); + builder.AppendLine($"'{SystemData.ToString()}'"); + } + } + + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerAppContainersContext.Default); + case "bicep": + return SerializeBicep(options); + default: + throw new FormatException($"The model {nameof(ContainerAppsPatchResourceData)} does not support writing '{options.Format}' format."); + } + } + + ContainerAppsPatchResourceData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeContainerAppsPatchResourceData(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ContainerAppsPatchResourceData)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/ContainerAppsPatchResourceData.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/ContainerAppsPatchResourceData.cs new file mode 100644 index 000000000000..de808fc9f362 --- /dev/null +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/ContainerAppsPatchResourceData.cs @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; +using Azure.ResourceManager.AppContainers.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.AppContainers +{ + /// + /// A class representing the ContainerAppsPatchResource data model. + /// Container App Patch + /// + public partial class ContainerAppsPatchResourceData : ResourceData + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public ContainerAppsPatchResourceData() + { + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// Properties that describes current states of the patch resource. + /// Keeps track of any properties unknown to the library. + internal ContainerAppsPatchResourceData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, PatchProperties properties, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) + { + Properties = properties; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Properties that describes current states of the patch resource. + [WirePath("properties")] + public PatchProperties Properties { get; } + } +} diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/DaprComponentResiliencyPolicyCollection.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/DaprComponentResiliencyPolicyCollection.cs new file mode 100644 index 000000000000..f00d2346c052 --- /dev/null +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/DaprComponentResiliencyPolicyCollection.cs @@ -0,0 +1,497 @@ +// 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 Autorest.CSharp.Core; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.AppContainers +{ + /// + /// 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 GetDaprComponentResiliencyPolicies method from an instance of . + /// + public partial class DaprComponentResiliencyPolicyCollection : ArmCollection, IEnumerable, IAsyncEnumerable + { + private readonly ClientDiagnostics _daprComponentResiliencyPolicyClientDiagnostics; + private readonly DaprComponentResiliencyPoliciesRestOperations _daprComponentResiliencyPolicyRestClient; + + /// Initializes a new instance of the class for mocking. + protected DaprComponentResiliencyPolicyCollection() + { + } + + /// 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 DaprComponentResiliencyPolicyCollection(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _daprComponentResiliencyPolicyClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.AppContainers", DaprComponentResiliencyPolicyResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(DaprComponentResiliencyPolicyResource.ResourceType, out string daprComponentResiliencyPolicyApiVersion); + _daprComponentResiliencyPolicyRestClient = new DaprComponentResiliencyPoliciesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, daprComponentResiliencyPolicyApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != ContainerAppManagedEnvironmentDaprComponentResource.ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ContainerAppManagedEnvironmentDaprComponentResource.ResourceType), nameof(id)); + } + + /// + /// Creates or updates a resiliency policy for a Dapr component. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/daprComponents/{componentName}/resiliencyPolicies/{name} + /// + /// + /// Operation Id + /// DaprComponentResiliencyPolicies_CreateOrUpdate + /// + /// + /// Default Api Version + /// 2025-02-02-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// 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 Dapr Component Resiliency Policy. + /// Configuration details of the Dapr Component Resiliency Policy. + /// 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, DaprComponentResiliencyPolicyData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(name, nameof(name)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _daprComponentResiliencyPolicyClientDiagnostics.CreateScope("DaprComponentResiliencyPolicyCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = await _daprComponentResiliencyPolicyRestClient.CreateOrUpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, name, data, cancellationToken).ConfigureAwait(false); + var uri = _daprComponentResiliencyPolicyRestClient.CreateCreateOrUpdateRequestUri(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, name, data); + var rehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(RequestMethod.Put, uri.ToUri(), uri.ToString(), "None", null, OperationFinalStateVia.OriginalUri.ToString()); + var operation = new AppContainersArmOperation(Response.FromValue(new DaprComponentResiliencyPolicyResource(Client, response), response.GetRawResponse()), rehydrationToken); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Creates or updates a resiliency policy for a Dapr component. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/daprComponents/{componentName}/resiliencyPolicies/{name} + /// + /// + /// Operation Id + /// DaprComponentResiliencyPolicies_CreateOrUpdate + /// + /// + /// Default Api Version + /// 2025-02-02-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// 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 Dapr Component Resiliency Policy. + /// Configuration details of the Dapr Component Resiliency Policy. + /// 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, DaprComponentResiliencyPolicyData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(name, nameof(name)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _daprComponentResiliencyPolicyClientDiagnostics.CreateScope("DaprComponentResiliencyPolicyCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = _daprComponentResiliencyPolicyRestClient.CreateOrUpdate(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, name, data, cancellationToken); + var uri = _daprComponentResiliencyPolicyRestClient.CreateCreateOrUpdateRequestUri(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, name, data); + var rehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(RequestMethod.Put, uri.ToUri(), uri.ToString(), "None", null, OperationFinalStateVia.OriginalUri.ToString()); + var operation = new AppContainersArmOperation(Response.FromValue(new DaprComponentResiliencyPolicyResource(Client, response), response.GetRawResponse()), rehydrationToken); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a Dapr component resiliency policy. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/daprComponents/{componentName}/resiliencyPolicies/{name} + /// + /// + /// Operation Id + /// DaprComponentResiliencyPolicies_Get + /// + /// + /// Default Api Version + /// 2025-02-02-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the Dapr Component Resiliency Policy. + /// 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 = _daprComponentResiliencyPolicyClientDiagnostics.CreateScope("DaprComponentResiliencyPolicyCollection.Get"); + scope.Start(); + try + { + var response = await _daprComponentResiliencyPolicyRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, name, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new DaprComponentResiliencyPolicyResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a Dapr component resiliency policy. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/daprComponents/{componentName}/resiliencyPolicies/{name} + /// + /// + /// Operation Id + /// DaprComponentResiliencyPolicies_Get + /// + /// + /// Default Api Version + /// 2025-02-02-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the Dapr Component Resiliency Policy. + /// 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 = _daprComponentResiliencyPolicyClientDiagnostics.CreateScope("DaprComponentResiliencyPolicyCollection.Get"); + scope.Start(); + try + { + var response = _daprComponentResiliencyPolicyRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, name, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new DaprComponentResiliencyPolicyResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get the resiliency policies for a Dapr component. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/daprComponents/{componentName}/resiliencyPolicies + /// + /// + /// Operation Id + /// DaprComponentResiliencyPolicies_List + /// + /// + /// Default Api Version + /// 2025-02-02-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// 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) => _daprComponentResiliencyPolicyRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _daprComponentResiliencyPolicyRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new DaprComponentResiliencyPolicyResource(Client, DaprComponentResiliencyPolicyData.DeserializeDaprComponentResiliencyPolicyData(e)), _daprComponentResiliencyPolicyClientDiagnostics, Pipeline, "DaprComponentResiliencyPolicyCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Get the resiliency policies for a Dapr component. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/daprComponents/{componentName}/resiliencyPolicies + /// + /// + /// Operation Id + /// DaprComponentResiliencyPolicies_List + /// + /// + /// Default Api Version + /// 2025-02-02-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// 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) => _daprComponentResiliencyPolicyRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _daprComponentResiliencyPolicyRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new DaprComponentResiliencyPolicyResource(Client, DaprComponentResiliencyPolicyData.DeserializeDaprComponentResiliencyPolicyData(e)), _daprComponentResiliencyPolicyClientDiagnostics, Pipeline, "DaprComponentResiliencyPolicyCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/daprComponents/{componentName}/resiliencyPolicies/{name} + /// + /// + /// Operation Id + /// DaprComponentResiliencyPolicies_Get + /// + /// + /// Default Api Version + /// 2025-02-02-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the Dapr Component Resiliency Policy. + /// 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 = _daprComponentResiliencyPolicyClientDiagnostics.CreateScope("DaprComponentResiliencyPolicyCollection.Exists"); + scope.Start(); + try + { + var response = await _daprComponentResiliencyPolicyRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, 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.App/managedEnvironments/{environmentName}/daprComponents/{componentName}/resiliencyPolicies/{name} + /// + /// + /// Operation Id + /// DaprComponentResiliencyPolicies_Get + /// + /// + /// Default Api Version + /// 2025-02-02-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the Dapr Component Resiliency Policy. + /// 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 = _daprComponentResiliencyPolicyClientDiagnostics.CreateScope("DaprComponentResiliencyPolicyCollection.Exists"); + scope.Start(); + try + { + var response = _daprComponentResiliencyPolicyRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, name, cancellationToken: cancellationToken); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/daprComponents/{componentName}/resiliencyPolicies/{name} + /// + /// + /// Operation Id + /// DaprComponentResiliencyPolicies_Get + /// + /// + /// Default Api Version + /// 2025-02-02-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the Dapr Component Resiliency Policy. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetIfExistsAsync(string name, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(name, nameof(name)); + + using var scope = _daprComponentResiliencyPolicyClientDiagnostics.CreateScope("DaprComponentResiliencyPolicyCollection.GetIfExists"); + scope.Start(); + try + { + var response = await _daprComponentResiliencyPolicyRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, name, cancellationToken: cancellationToken).ConfigureAwait(false); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new DaprComponentResiliencyPolicyResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/daprComponents/{componentName}/resiliencyPolicies/{name} + /// + /// + /// Operation Id + /// DaprComponentResiliencyPolicies_Get + /// + /// + /// Default Api Version + /// 2025-02-02-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the Dapr Component Resiliency Policy. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual NullableResponse GetIfExists(string name, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(name, nameof(name)); + + using var scope = _daprComponentResiliencyPolicyClientDiagnostics.CreateScope("DaprComponentResiliencyPolicyCollection.GetIfExists"); + scope.Start(); + try + { + var response = _daprComponentResiliencyPolicyRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, name, cancellationToken: cancellationToken); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new DaprComponentResiliencyPolicyResource(Client, response.Value), 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/containerapps/Azure.ResourceManager.AppContainers/src/Generated/DaprComponentResiliencyPolicyData.Serialization.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/DaprComponentResiliencyPolicyData.Serialization.cs new file mode 100644 index 000000000000..d12547b362d8 --- /dev/null +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/DaprComponentResiliencyPolicyData.Serialization.cs @@ -0,0 +1,290 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text; +using System.Text.Json; +using Azure.Core; +using Azure.ResourceManager.AppContainers.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.AppContainers +{ + public partial class DaprComponentResiliencyPolicyData : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DaprComponentResiliencyPolicyData)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + writer.WritePropertyName("properties"u8); + writer.WriteStartObject(); + if (Optional.IsDefined(InboundPolicy)) + { + writer.WritePropertyName("inboundPolicy"u8); + writer.WriteObjectValue(InboundPolicy, options); + } + if (Optional.IsDefined(OutboundPolicy)) + { + writer.WritePropertyName("outboundPolicy"u8); + writer.WriteObjectValue(OutboundPolicy, options); + } + writer.WriteEndObject(); + } + + DaprComponentResiliencyPolicyData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DaprComponentResiliencyPolicyData)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDaprComponentResiliencyPolicyData(document.RootElement, options); + } + + internal static DaprComponentResiliencyPolicyData DeserializeDaprComponentResiliencyPolicyData(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ResourceIdentifier id = default; + string name = default; + ResourceType type = default; + SystemData systemData = default; + DaprComponentResiliencyPolicyConfiguration inboundPolicy = default; + DaprComponentResiliencyPolicyConfiguration outboundPolicy = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + 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.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + systemData = JsonSerializer.Deserialize(property.Value.GetRawText()); + continue; + } + if (property.NameEquals("properties"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + foreach (var property0 in property.Value.EnumerateObject()) + { + if (property0.NameEquals("inboundPolicy"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + inboundPolicy = DaprComponentResiliencyPolicyConfiguration.DeserializeDaprComponentResiliencyPolicyConfiguration(property0.Value, options); + continue; + } + if (property0.NameEquals("outboundPolicy"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + outboundPolicy = DaprComponentResiliencyPolicyConfiguration.DeserializeDaprComponentResiliencyPolicyConfiguration(property0.Value, options); + continue; + } + } + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DaprComponentResiliencyPolicyData( + id, + name, + type, + systemData, + inboundPolicy, + outboundPolicy, + serializedAdditionalRawData); + } + + private BinaryData SerializeBicep(ModelReaderWriterOptions options) + { + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Name), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" name: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Name)) + { + builder.Append(" name: "); + if (Name.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{Name}'''"); + } + else + { + builder.AppendLine($"'{Name}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Id), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" id: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Id)) + { + builder.Append(" id: "); + builder.AppendLine($"'{Id.ToString()}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(SystemData), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" systemData: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(SystemData)) + { + builder.Append(" systemData: "); + builder.AppendLine($"'{SystemData.ToString()}'"); + } + } + + builder.Append(" properties:"); + builder.AppendLine(" {"); + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(InboundPolicy), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" inboundPolicy: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(InboundPolicy)) + { + builder.Append(" inboundPolicy: "); + BicepSerializationHelpers.AppendChildObject(builder, InboundPolicy, options, 4, false, " inboundPolicy: "); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(OutboundPolicy), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" outboundPolicy: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(OutboundPolicy)) + { + builder.Append(" outboundPolicy: "); + BicepSerializationHelpers.AppendChildObject(builder, OutboundPolicy, options, 4, false, " outboundPolicy: "); + } + } + + builder.AppendLine(" }"); + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerAppContainersContext.Default); + case "bicep": + return SerializeBicep(options); + default: + throw new FormatException($"The model {nameof(DaprComponentResiliencyPolicyData)} does not support writing '{options.Format}' format."); + } + } + + DaprComponentResiliencyPolicyData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeDaprComponentResiliencyPolicyData(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DaprComponentResiliencyPolicyData)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/DaprComponentResiliencyPolicyData.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/DaprComponentResiliencyPolicyData.cs new file mode 100644 index 000000000000..786a53e79f89 --- /dev/null +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/DaprComponentResiliencyPolicyData.cs @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; +using Azure.ResourceManager.AppContainers.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.AppContainers +{ + /// + /// A class representing the DaprComponentResiliencyPolicy data model. + /// Dapr Component Resiliency Policy. + /// + public partial class DaprComponentResiliencyPolicyData : ResourceData + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public DaprComponentResiliencyPolicyData() + { + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The optional inbound component resiliency policy configuration. + /// The optional outbound component resiliency policy configuration. + /// Keeps track of any properties unknown to the library. + internal DaprComponentResiliencyPolicyData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, DaprComponentResiliencyPolicyConfiguration inboundPolicy, DaprComponentResiliencyPolicyConfiguration outboundPolicy, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) + { + InboundPolicy = inboundPolicy; + OutboundPolicy = outboundPolicy; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The optional inbound component resiliency policy configuration. + [WirePath("properties.inboundPolicy")] + public DaprComponentResiliencyPolicyConfiguration InboundPolicy { get; set; } + /// The optional outbound component resiliency policy configuration. + [WirePath("properties.outboundPolicy")] + public DaprComponentResiliencyPolicyConfiguration OutboundPolicy { get; set; } + } +} diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/DaprComponentResiliencyPolicyResource.Serialization.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/DaprComponentResiliencyPolicyResource.Serialization.cs new file mode 100644 index 000000000000..185ebf77ca43 --- /dev/null +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/DaprComponentResiliencyPolicyResource.Serialization.cs @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; + +namespace Azure.ResourceManager.AppContainers +{ + public partial class DaprComponentResiliencyPolicyResource : IJsonModel + { + private static DaprComponentResiliencyPolicyData s_dataDeserializationInstance; + private static DaprComponentResiliencyPolicyData DataDeserializationInstance => s_dataDeserializationInstance ??= new(); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); + + DaprComponentResiliencyPolicyData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)DataDeserializationInstance).Create(ref reader, options); + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options, AzureResourceManagerAppContainersContext.Default); + + DaprComponentResiliencyPolicyData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options, AzureResourceManagerAppContainersContext.Default); + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)DataDeserializationInstance).GetFormatFromOptions(options); + } +} diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/DaprComponentResiliencyPolicyResource.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/DaprComponentResiliencyPolicyResource.cs new file mode 100644 index 000000000000..e6d6521dc5fe --- /dev/null +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/DaprComponentResiliencyPolicyResource.cs @@ -0,0 +1,356 @@ +// 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.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.AppContainers +{ + /// + /// A Class representing a DaprComponentResiliencyPolicy 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 GetDaprComponentResiliencyPolicyResource method. + /// Otherwise you can get one from its parent resource using the GetDaprComponentResiliencyPolicy method. + /// + public partial class DaprComponentResiliencyPolicyResource : ArmResource + { + /// Generate the resource identifier of a instance. + /// The subscriptionId. + /// The resourceGroupName. + /// The environmentName. + /// The componentName. + /// The name. + public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string environmentName, string componentName, string name) + { + var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/daprComponents/{componentName}/resiliencyPolicies/{name}"; + return new ResourceIdentifier(resourceId); + } + + private readonly ClientDiagnostics _daprComponentResiliencyPolicyClientDiagnostics; + private readonly DaprComponentResiliencyPoliciesRestOperations _daprComponentResiliencyPolicyRestClient; + private readonly DaprComponentResiliencyPolicyData _data; + + /// Gets the resource type for the operations. + public static readonly ResourceType ResourceType = "Microsoft.App/managedEnvironments/daprComponents/resiliencyPolicies"; + + /// Initializes a new instance of the class for mocking. + protected DaprComponentResiliencyPolicyResource() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The resource that is the target of operations. + internal DaprComponentResiliencyPolicyResource(ArmClient client, DaprComponentResiliencyPolicyData 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 DaprComponentResiliencyPolicyResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _daprComponentResiliencyPolicyClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.AppContainers", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string daprComponentResiliencyPolicyApiVersion); + _daprComponentResiliencyPolicyRestClient = new DaprComponentResiliencyPoliciesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, daprComponentResiliencyPolicyApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + /// 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 DaprComponentResiliencyPolicyData 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 a Dapr component resiliency policy. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/daprComponents/{componentName}/resiliencyPolicies/{name} + /// + /// + /// Operation Id + /// DaprComponentResiliencyPolicies_Get + /// + /// + /// Default Api Version + /// 2025-02-02-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + { + using var scope = _daprComponentResiliencyPolicyClientDiagnostics.CreateScope("DaprComponentResiliencyPolicyResource.Get"); + scope.Start(); + try + { + var response = await _daprComponentResiliencyPolicyRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new DaprComponentResiliencyPolicyResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a Dapr component resiliency policy. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/daprComponents/{componentName}/resiliencyPolicies/{name} + /// + /// + /// Operation Id + /// DaprComponentResiliencyPolicies_Get + /// + /// + /// Default Api Version + /// 2025-02-02-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual Response Get(CancellationToken cancellationToken = default) + { + using var scope = _daprComponentResiliencyPolicyClientDiagnostics.CreateScope("DaprComponentResiliencyPolicyResource.Get"); + scope.Start(); + try + { + var response = _daprComponentResiliencyPolicyRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new DaprComponentResiliencyPolicyResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Delete a resiliency policy for a Dapr component. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/daprComponents/{componentName}/resiliencyPolicies/{name} + /// + /// + /// Operation Id + /// DaprComponentResiliencyPolicies_Delete + /// + /// + /// Default Api Version + /// 2025-02-02-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// 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 = _daprComponentResiliencyPolicyClientDiagnostics.CreateScope("DaprComponentResiliencyPolicyResource.Delete"); + scope.Start(); + try + { + var response = await _daprComponentResiliencyPolicyRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + var uri = _daprComponentResiliencyPolicyRestClient.CreateDeleteRequestUri(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name); + var rehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(RequestMethod.Delete, uri.ToUri(), uri.ToString(), "None", null, OperationFinalStateVia.OriginalUri.ToString()); + var operation = new AppContainersArmOperation(response, rehydrationToken); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Delete a resiliency policy for a Dapr component. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/daprComponents/{componentName}/resiliencyPolicies/{name} + /// + /// + /// Operation Id + /// DaprComponentResiliencyPolicies_Delete + /// + /// + /// Default Api Version + /// 2025-02-02-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// 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 = _daprComponentResiliencyPolicyClientDiagnostics.CreateScope("DaprComponentResiliencyPolicyResource.Delete"); + scope.Start(); + try + { + var response = _daprComponentResiliencyPolicyRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken); + var uri = _daprComponentResiliencyPolicyRestClient.CreateDeleteRequestUri(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name); + var rehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(RequestMethod.Delete, uri.ToUri(), uri.ToString(), "None", null, OperationFinalStateVia.OriginalUri.ToString()); + var operation = new AppContainersArmOperation(response, rehydrationToken); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletionResponse(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Creates or updates a resiliency policy for a Dapr component. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/daprComponents/{componentName}/resiliencyPolicies/{name} + /// + /// + /// Operation Id + /// DaprComponentResiliencyPolicies_CreateOrUpdate + /// + /// + /// Default Api Version + /// 2025-02-02-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// 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. + /// Configuration details of the Dapr Component Resiliency Policy. + /// The cancellation token to use. + /// is null. + public virtual async Task> UpdateAsync(WaitUntil waitUntil, DaprComponentResiliencyPolicyData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _daprComponentResiliencyPolicyClientDiagnostics.CreateScope("DaprComponentResiliencyPolicyResource.Update"); + scope.Start(); + try + { + var response = await _daprComponentResiliencyPolicyRestClient.CreateOrUpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, data, cancellationToken).ConfigureAwait(false); + var uri = _daprComponentResiliencyPolicyRestClient.CreateCreateOrUpdateRequestUri(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, data); + var rehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(RequestMethod.Put, uri.ToUri(), uri.ToString(), "None", null, OperationFinalStateVia.OriginalUri.ToString()); + var operation = new AppContainersArmOperation(Response.FromValue(new DaprComponentResiliencyPolicyResource(Client, response), response.GetRawResponse()), rehydrationToken); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Creates or updates a resiliency policy for a Dapr component. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/daprComponents/{componentName}/resiliencyPolicies/{name} + /// + /// + /// Operation Id + /// DaprComponentResiliencyPolicies_CreateOrUpdate + /// + /// + /// Default Api Version + /// 2025-02-02-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// 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. + /// Configuration details of the Dapr Component Resiliency Policy. + /// The cancellation token to use. + /// is null. + public virtual ArmOperation Update(WaitUntil waitUntil, DaprComponentResiliencyPolicyData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _daprComponentResiliencyPolicyClientDiagnostics.CreateScope("DaprComponentResiliencyPolicyResource.Update"); + scope.Start(); + try + { + var response = _daprComponentResiliencyPolicyRestClient.CreateOrUpdate(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, data, cancellationToken); + var uri = _daprComponentResiliencyPolicyRestClient.CreateCreateOrUpdateRequestUri(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, data); + var rehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(RequestMethod.Put, uri.ToUri(), uri.ToString(), "None", null, OperationFinalStateVia.OriginalUri.ToString()); + var operation = new AppContainersArmOperation(Response.FromValue(new DaprComponentResiliencyPolicyResource(Client, response), response.GetRawResponse()), rehydrationToken); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/DaprSubscriptionCollection.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/DaprSubscriptionCollection.cs new file mode 100644 index 000000000000..1361f73fc0bb --- /dev/null +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/DaprSubscriptionCollection.cs @@ -0,0 +1,497 @@ +// 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 Autorest.CSharp.Core; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.AppContainers +{ + /// + /// 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 GetDaprSubscriptions method from an instance of . + /// + public partial class DaprSubscriptionCollection : ArmCollection, IEnumerable, IAsyncEnumerable + { + private readonly ClientDiagnostics _daprSubscriptionClientDiagnostics; + private readonly DaprSubscriptionsRestOperations _daprSubscriptionRestClient; + + /// Initializes a new instance of the class for mocking. + protected DaprSubscriptionCollection() + { + } + + /// 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 DaprSubscriptionCollection(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _daprSubscriptionClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.AppContainers", DaprSubscriptionResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(DaprSubscriptionResource.ResourceType, out string daprSubscriptionApiVersion); + _daprSubscriptionRestClient = new DaprSubscriptionsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, daprSubscriptionApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != ContainerAppManagedEnvironmentResource.ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ContainerAppManagedEnvironmentResource.ResourceType), nameof(id)); + } + + /// + /// Creates or updates a Dapr subscription in a Managed Environment. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/daprSubscriptions/{name} + /// + /// + /// Operation Id + /// DaprSubscriptions_CreateOrUpdate + /// + /// + /// Default Api Version + /// 2025-02-02-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// 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 Dapr subscription. + /// Configuration details of the Dapr subscription. + /// 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, DaprSubscriptionData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(name, nameof(name)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _daprSubscriptionClientDiagnostics.CreateScope("DaprSubscriptionCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = await _daprSubscriptionRestClient.CreateOrUpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, name, data, cancellationToken).ConfigureAwait(false); + var uri = _daprSubscriptionRestClient.CreateCreateOrUpdateRequestUri(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, name, data); + var rehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(RequestMethod.Put, uri.ToUri(), uri.ToString(), "None", null, OperationFinalStateVia.OriginalUri.ToString()); + var operation = new AppContainersArmOperation(Response.FromValue(new DaprSubscriptionResource(Client, response), response.GetRawResponse()), rehydrationToken); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Creates or updates a Dapr subscription in a Managed Environment. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/daprSubscriptions/{name} + /// + /// + /// Operation Id + /// DaprSubscriptions_CreateOrUpdate + /// + /// + /// Default Api Version + /// 2025-02-02-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// 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 Dapr subscription. + /// Configuration details of the Dapr subscription. + /// 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, DaprSubscriptionData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(name, nameof(name)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _daprSubscriptionClientDiagnostics.CreateScope("DaprSubscriptionCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = _daprSubscriptionRestClient.CreateOrUpdate(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, name, data, cancellationToken); + var uri = _daprSubscriptionRestClient.CreateCreateOrUpdateRequestUri(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, name, data); + var rehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(RequestMethod.Put, uri.ToUri(), uri.ToString(), "None", null, OperationFinalStateVia.OriginalUri.ToString()); + var operation = new AppContainersArmOperation(Response.FromValue(new DaprSubscriptionResource(Client, response), response.GetRawResponse()), rehydrationToken); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a dapr subscription. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/daprSubscriptions/{name} + /// + /// + /// Operation Id + /// DaprSubscriptions_Get + /// + /// + /// Default Api Version + /// 2025-02-02-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the Dapr subscription. + /// 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 = _daprSubscriptionClientDiagnostics.CreateScope("DaprSubscriptionCollection.Get"); + scope.Start(); + try + { + var response = await _daprSubscriptionRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, name, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new DaprSubscriptionResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a dapr subscription. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/daprSubscriptions/{name} + /// + /// + /// Operation Id + /// DaprSubscriptions_Get + /// + /// + /// Default Api Version + /// 2025-02-02-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the Dapr subscription. + /// 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 = _daprSubscriptionClientDiagnostics.CreateScope("DaprSubscriptionCollection.Get"); + scope.Start(); + try + { + var response = _daprSubscriptionRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, name, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new DaprSubscriptionResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get the Dapr subscriptions for a managed environment. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/daprSubscriptions + /// + /// + /// Operation Id + /// DaprSubscriptions_List + /// + /// + /// Default Api Version + /// 2025-02-02-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// 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) => _daprSubscriptionRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _daprSubscriptionRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new DaprSubscriptionResource(Client, DaprSubscriptionData.DeserializeDaprSubscriptionData(e)), _daprSubscriptionClientDiagnostics, Pipeline, "DaprSubscriptionCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Get the Dapr subscriptions for a managed environment. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/daprSubscriptions + /// + /// + /// Operation Id + /// DaprSubscriptions_List + /// + /// + /// Default Api Version + /// 2025-02-02-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// 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) => _daprSubscriptionRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _daprSubscriptionRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new DaprSubscriptionResource(Client, DaprSubscriptionData.DeserializeDaprSubscriptionData(e)), _daprSubscriptionClientDiagnostics, Pipeline, "DaprSubscriptionCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/daprSubscriptions/{name} + /// + /// + /// Operation Id + /// DaprSubscriptions_Get + /// + /// + /// Default Api Version + /// 2025-02-02-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the Dapr subscription. + /// 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 = _daprSubscriptionClientDiagnostics.CreateScope("DaprSubscriptionCollection.Exists"); + scope.Start(); + try + { + var response = await _daprSubscriptionRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, 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.App/managedEnvironments/{environmentName}/daprSubscriptions/{name} + /// + /// + /// Operation Id + /// DaprSubscriptions_Get + /// + /// + /// Default Api Version + /// 2025-02-02-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the Dapr subscription. + /// 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 = _daprSubscriptionClientDiagnostics.CreateScope("DaprSubscriptionCollection.Exists"); + scope.Start(); + try + { + var response = _daprSubscriptionRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, name, cancellationToken: cancellationToken); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/daprSubscriptions/{name} + /// + /// + /// Operation Id + /// DaprSubscriptions_Get + /// + /// + /// Default Api Version + /// 2025-02-02-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the Dapr subscription. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetIfExistsAsync(string name, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(name, nameof(name)); + + using var scope = _daprSubscriptionClientDiagnostics.CreateScope("DaprSubscriptionCollection.GetIfExists"); + scope.Start(); + try + { + var response = await _daprSubscriptionRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, name, cancellationToken: cancellationToken).ConfigureAwait(false); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new DaprSubscriptionResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/daprSubscriptions/{name} + /// + /// + /// Operation Id + /// DaprSubscriptions_Get + /// + /// + /// Default Api Version + /// 2025-02-02-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the Dapr subscription. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual NullableResponse GetIfExists(string name, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(name, nameof(name)); + + using var scope = _daprSubscriptionClientDiagnostics.CreateScope("DaprSubscriptionCollection.GetIfExists"); + scope.Start(); + try + { + var response = _daprSubscriptionRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, name, cancellationToken: cancellationToken); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new DaprSubscriptionResource(Client, response.Value), 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/containerapps/Azure.ResourceManager.AppContainers/src/Generated/DaprSubscriptionData.Serialization.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/DaprSubscriptionData.Serialization.cs new file mode 100644 index 000000000000..092dca2e4d96 --- /dev/null +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/DaprSubscriptionData.Serialization.cs @@ -0,0 +1,522 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Text.Json; +using Azure.Core; +using Azure.ResourceManager.AppContainers.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.AppContainers +{ + public partial class DaprSubscriptionData : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DaprSubscriptionData)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + writer.WritePropertyName("properties"u8); + writer.WriteStartObject(); + if (Optional.IsDefined(PubsubName)) + { + writer.WritePropertyName("pubsubName"u8); + writer.WriteStringValue(PubsubName); + } + if (Optional.IsDefined(Topic)) + { + writer.WritePropertyName("topic"u8); + writer.WriteStringValue(Topic); + } + if (Optional.IsDefined(DeadLetterTopic)) + { + writer.WritePropertyName("deadLetterTopic"u8); + writer.WriteStringValue(DeadLetterTopic); + } + if (Optional.IsDefined(Routes)) + { + writer.WritePropertyName("routes"u8); + writer.WriteObjectValue(Routes, options); + } + if (Optional.IsCollectionDefined(Scopes)) + { + writer.WritePropertyName("scopes"u8); + writer.WriteStartArray(); + foreach (var item in Scopes) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(Metadata)) + { + writer.WritePropertyName("metadata"u8); + writer.WriteStartObject(); + foreach (var item in Metadata) + { + writer.WritePropertyName(item.Key); + writer.WriteStringValue(item.Value); + } + writer.WriteEndObject(); + } + if (Optional.IsDefined(BulkSubscribe)) + { + writer.WritePropertyName("bulkSubscribe"u8); + writer.WriteObjectValue(BulkSubscribe, options); + } + writer.WriteEndObject(); + } + + DaprSubscriptionData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DaprSubscriptionData)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDaprSubscriptionData(document.RootElement, options); + } + + internal static DaprSubscriptionData DeserializeDaprSubscriptionData(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ResourceIdentifier id = default; + string name = default; + ResourceType type = default; + SystemData systemData = default; + string pubsubName = default; + string topic = default; + string deadLetterTopic = default; + DaprSubscriptionRoutes routes = default; + IList scopes = default; + IDictionary metadata = default; + DaprSubscriptionBulkSubscribeConfig bulkSubscribe = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + 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.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + systemData = JsonSerializer.Deserialize(property.Value.GetRawText()); + continue; + } + if (property.NameEquals("properties"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + foreach (var property0 in property.Value.EnumerateObject()) + { + if (property0.NameEquals("pubsubName"u8)) + { + pubsubName = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("topic"u8)) + { + topic = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("deadLetterTopic"u8)) + { + deadLetterTopic = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("routes"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + routes = DaprSubscriptionRoutes.DeserializeDaprSubscriptionRoutes(property0.Value, options); + continue; + } + if (property0.NameEquals("scopes"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property0.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + scopes = array; + continue; + } + if (property0.NameEquals("metadata"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + Dictionary dictionary = new Dictionary(); + foreach (var property1 in property0.Value.EnumerateObject()) + { + dictionary.Add(property1.Name, property1.Value.GetString()); + } + metadata = dictionary; + continue; + } + if (property0.NameEquals("bulkSubscribe"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + bulkSubscribe = DaprSubscriptionBulkSubscribeConfig.DeserializeDaprSubscriptionBulkSubscribeConfig(property0.Value, options); + continue; + } + } + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DaprSubscriptionData( + id, + name, + type, + systemData, + pubsubName, + topic, + deadLetterTopic, + routes, + scopes ?? new ChangeTrackingList(), + metadata ?? new ChangeTrackingDictionary(), + bulkSubscribe, + serializedAdditionalRawData); + } + + private BinaryData SerializeBicep(ModelReaderWriterOptions options) + { + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Name), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" name: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Name)) + { + builder.Append(" name: "); + if (Name.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{Name}'''"); + } + else + { + builder.AppendLine($"'{Name}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Id), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" id: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Id)) + { + builder.Append(" id: "); + builder.AppendLine($"'{Id.ToString()}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(SystemData), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" systemData: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(SystemData)) + { + builder.Append(" systemData: "); + builder.AppendLine($"'{SystemData.ToString()}'"); + } + } + + builder.Append(" properties:"); + builder.AppendLine(" {"); + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(PubsubName), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" pubsubName: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(PubsubName)) + { + builder.Append(" pubsubName: "); + if (PubsubName.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{PubsubName}'''"); + } + else + { + builder.AppendLine($"'{PubsubName}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Topic), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" topic: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Topic)) + { + builder.Append(" topic: "); + if (Topic.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{Topic}'''"); + } + else + { + builder.AppendLine($"'{Topic}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(DeadLetterTopic), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" deadLetterTopic: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(DeadLetterTopic)) + { + builder.Append(" deadLetterTopic: "); + if (DeadLetterTopic.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{DeadLetterTopic}'''"); + } + else + { + builder.AppendLine($"'{DeadLetterTopic}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Routes), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" routes: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Routes)) + { + builder.Append(" routes: "); + BicepSerializationHelpers.AppendChildObject(builder, Routes, options, 4, false, " routes: "); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Scopes), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" scopes: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsCollectionDefined(Scopes)) + { + if (Scopes.Any()) + { + builder.Append(" scopes: "); + builder.AppendLine("["); + foreach (var item in Scopes) + { + if (item == null) + { + builder.Append("null"); + continue; + } + if (item.Contains(Environment.NewLine)) + { + builder.AppendLine(" '''"); + builder.AppendLine($"{item}'''"); + } + else + { + builder.AppendLine($" '{item}'"); + } + } + builder.AppendLine(" ]"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Metadata), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" metadata: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsCollectionDefined(Metadata)) + { + if (Metadata.Any()) + { + builder.Append(" metadata: "); + builder.AppendLine("{"); + foreach (var item in Metadata) + { + builder.Append($" '{item.Key}': "); + if (item.Value == null) + { + builder.Append("null"); + continue; + } + if (item.Value.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{item.Value}'''"); + } + else + { + builder.AppendLine($"'{item.Value}'"); + } + } + builder.AppendLine(" }"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(BulkSubscribe), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" bulkSubscribe: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(BulkSubscribe)) + { + builder.Append(" bulkSubscribe: "); + BicepSerializationHelpers.AppendChildObject(builder, BulkSubscribe, options, 4, false, " bulkSubscribe: "); + } + } + + builder.AppendLine(" }"); + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerAppContainersContext.Default); + case "bicep": + return SerializeBicep(options); + default: + throw new FormatException($"The model {nameof(DaprSubscriptionData)} does not support writing '{options.Format}' format."); + } + } + + DaprSubscriptionData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeDaprSubscriptionData(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DaprSubscriptionData)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/DaprSubscriptionData.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/DaprSubscriptionData.cs new file mode 100644 index 000000000000..60b52403a324 --- /dev/null +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/DaprSubscriptionData.cs @@ -0,0 +1,108 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; +using Azure.ResourceManager.AppContainers.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.AppContainers +{ + /// + /// A class representing the DaprSubscription data model. + /// Dapr PubSub Event Subscription. + /// + public partial class DaprSubscriptionData : ResourceData + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public DaprSubscriptionData() + { + Scopes = new ChangeTrackingList(); + Metadata = new ChangeTrackingDictionary(); + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// Dapr PubSub component name. + /// Topic name. + /// Deadletter topic name. + /// Subscription routes. + /// Application scopes to restrict the subscription to specific apps. + /// Subscription metadata. + /// Bulk subscription options. + /// Keeps track of any properties unknown to the library. + internal DaprSubscriptionData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, string pubsubName, string topic, string deadLetterTopic, DaprSubscriptionRoutes routes, IList scopes, IDictionary metadata, DaprSubscriptionBulkSubscribeConfig bulkSubscribe, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) + { + PubsubName = pubsubName; + Topic = topic; + DeadLetterTopic = deadLetterTopic; + Routes = routes; + Scopes = scopes; + Metadata = metadata; + BulkSubscribe = bulkSubscribe; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Dapr PubSub component name. + [WirePath("properties.pubsubName")] + public string PubsubName { get; set; } + /// Topic name. + [WirePath("properties.topic")] + public string Topic { get; set; } + /// Deadletter topic name. + [WirePath("properties.deadLetterTopic")] + public string DeadLetterTopic { get; set; } + /// Subscription routes. + [WirePath("properties.routes")] + public DaprSubscriptionRoutes Routes { get; set; } + /// Application scopes to restrict the subscription to specific apps. + [WirePath("properties.scopes")] + public IList Scopes { get; } + /// Subscription metadata. + [WirePath("properties.metadata")] + public IDictionary Metadata { get; } + /// Bulk subscription options. + [WirePath("properties.bulkSubscribe")] + public DaprSubscriptionBulkSubscribeConfig BulkSubscribe { get; set; } + } +} diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/DaprSubscriptionResource.Serialization.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/DaprSubscriptionResource.Serialization.cs new file mode 100644 index 000000000000..a16b9a833aa5 --- /dev/null +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/DaprSubscriptionResource.Serialization.cs @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; + +namespace Azure.ResourceManager.AppContainers +{ + public partial class DaprSubscriptionResource : IJsonModel + { + private static DaprSubscriptionData s_dataDeserializationInstance; + private static DaprSubscriptionData DataDeserializationInstance => s_dataDeserializationInstance ??= new(); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); + + DaprSubscriptionData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)DataDeserializationInstance).Create(ref reader, options); + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options, AzureResourceManagerAppContainersContext.Default); + + DaprSubscriptionData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options, AzureResourceManagerAppContainersContext.Default); + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)DataDeserializationInstance).GetFormatFromOptions(options); + } +} diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/DaprSubscriptionResource.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/DaprSubscriptionResource.cs new file mode 100644 index 000000000000..48dbb0cd66ee --- /dev/null +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/DaprSubscriptionResource.cs @@ -0,0 +1,355 @@ +// 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.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.AppContainers +{ + /// + /// A Class representing a DaprSubscription 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 GetDaprSubscriptionResource method. + /// Otherwise you can get one from its parent resource using the GetDaprSubscription method. + /// + public partial class DaprSubscriptionResource : ArmResource + { + /// Generate the resource identifier of a instance. + /// The subscriptionId. + /// The resourceGroupName. + /// The environmentName. + /// The name. + public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string environmentName, string name) + { + var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/daprSubscriptions/{name}"; + return new ResourceIdentifier(resourceId); + } + + private readonly ClientDiagnostics _daprSubscriptionClientDiagnostics; + private readonly DaprSubscriptionsRestOperations _daprSubscriptionRestClient; + private readonly DaprSubscriptionData _data; + + /// Gets the resource type for the operations. + public static readonly ResourceType ResourceType = "Microsoft.App/managedEnvironments/daprSubscriptions"; + + /// Initializes a new instance of the class for mocking. + protected DaprSubscriptionResource() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The resource that is the target of operations. + internal DaprSubscriptionResource(ArmClient client, DaprSubscriptionData 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 DaprSubscriptionResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _daprSubscriptionClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.AppContainers", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string daprSubscriptionApiVersion); + _daprSubscriptionRestClient = new DaprSubscriptionsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, daprSubscriptionApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + /// 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 DaprSubscriptionData 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 a dapr subscription. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/daprSubscriptions/{name} + /// + /// + /// Operation Id + /// DaprSubscriptions_Get + /// + /// + /// Default Api Version + /// 2025-02-02-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + { + using var scope = _daprSubscriptionClientDiagnostics.CreateScope("DaprSubscriptionResource.Get"); + scope.Start(); + try + { + var response = await _daprSubscriptionRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new DaprSubscriptionResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a dapr subscription. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/daprSubscriptions/{name} + /// + /// + /// Operation Id + /// DaprSubscriptions_Get + /// + /// + /// Default Api Version + /// 2025-02-02-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual Response Get(CancellationToken cancellationToken = default) + { + using var scope = _daprSubscriptionClientDiagnostics.CreateScope("DaprSubscriptionResource.Get"); + scope.Start(); + try + { + var response = _daprSubscriptionRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new DaprSubscriptionResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Delete a Dapr subscription from a Managed Environment. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/daprSubscriptions/{name} + /// + /// + /// Operation Id + /// DaprSubscriptions_Delete + /// + /// + /// Default Api Version + /// 2025-02-02-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// 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 = _daprSubscriptionClientDiagnostics.CreateScope("DaprSubscriptionResource.Delete"); + scope.Start(); + try + { + var response = await _daprSubscriptionRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + var uri = _daprSubscriptionRestClient.CreateDeleteRequestUri(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name); + var rehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(RequestMethod.Delete, uri.ToUri(), uri.ToString(), "None", null, OperationFinalStateVia.OriginalUri.ToString()); + var operation = new AppContainersArmOperation(response, rehydrationToken); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Delete a Dapr subscription from a Managed Environment. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/daprSubscriptions/{name} + /// + /// + /// Operation Id + /// DaprSubscriptions_Delete + /// + /// + /// Default Api Version + /// 2025-02-02-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// 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 = _daprSubscriptionClientDiagnostics.CreateScope("DaprSubscriptionResource.Delete"); + scope.Start(); + try + { + var response = _daprSubscriptionRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + var uri = _daprSubscriptionRestClient.CreateDeleteRequestUri(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name); + var rehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(RequestMethod.Delete, uri.ToUri(), uri.ToString(), "None", null, OperationFinalStateVia.OriginalUri.ToString()); + var operation = new AppContainersArmOperation(response, rehydrationToken); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletionResponse(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Creates or updates a Dapr subscription in a Managed Environment. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/daprSubscriptions/{name} + /// + /// + /// Operation Id + /// DaprSubscriptions_CreateOrUpdate + /// + /// + /// Default Api Version + /// 2025-02-02-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// 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. + /// Configuration details of the Dapr subscription. + /// The cancellation token to use. + /// is null. + public virtual async Task> UpdateAsync(WaitUntil waitUntil, DaprSubscriptionData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _daprSubscriptionClientDiagnostics.CreateScope("DaprSubscriptionResource.Update"); + scope.Start(); + try + { + var response = await _daprSubscriptionRestClient.CreateOrUpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, cancellationToken).ConfigureAwait(false); + var uri = _daprSubscriptionRestClient.CreateCreateOrUpdateRequestUri(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data); + var rehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(RequestMethod.Put, uri.ToUri(), uri.ToString(), "None", null, OperationFinalStateVia.OriginalUri.ToString()); + var operation = new AppContainersArmOperation(Response.FromValue(new DaprSubscriptionResource(Client, response), response.GetRawResponse()), rehydrationToken); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Creates or updates a Dapr subscription in a Managed Environment. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/daprSubscriptions/{name} + /// + /// + /// Operation Id + /// DaprSubscriptions_CreateOrUpdate + /// + /// + /// Default Api Version + /// 2025-02-02-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// 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. + /// Configuration details of the Dapr subscription. + /// The cancellation token to use. + /// is null. + public virtual ArmOperation Update(WaitUntil waitUntil, DaprSubscriptionData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _daprSubscriptionClientDiagnostics.CreateScope("DaprSubscriptionResource.Update"); + scope.Start(); + try + { + var response = _daprSubscriptionRestClient.CreateOrUpdate(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, cancellationToken); + var uri = _daprSubscriptionRestClient.CreateCreateOrUpdateRequestUri(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data); + var rehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(RequestMethod.Put, uri.ToUri(), uri.ToString(), "None", null, OperationFinalStateVia.OriginalUri.ToString()); + var operation = new AppContainersArmOperation(Response.FromValue(new DaprSubscriptionResource(Client, response), response.GetRawResponse()), rehydrationToken); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/DotNetComponentCollection.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/DotNetComponentCollection.cs new file mode 100644 index 000000000000..1b5be93c62c8 --- /dev/null +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/DotNetComponentCollection.cs @@ -0,0 +1,493 @@ +// 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 Autorest.CSharp.Core; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.AppContainers +{ + /// + /// 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 GetDotNetComponents method from an instance of . + /// + public partial class DotNetComponentCollection : ArmCollection, IEnumerable, IAsyncEnumerable + { + private readonly ClientDiagnostics _dotNetComponentClientDiagnostics; + private readonly DotNetComponentsRestOperations _dotNetComponentRestClient; + + /// Initializes a new instance of the class for mocking. + protected DotNetComponentCollection() + { + } + + /// 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 DotNetComponentCollection(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _dotNetComponentClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.AppContainers", DotNetComponentResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(DotNetComponentResource.ResourceType, out string dotNetComponentApiVersion); + _dotNetComponentRestClient = new DotNetComponentsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, dotNetComponentApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != ContainerAppManagedEnvironmentResource.ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ContainerAppManagedEnvironmentResource.ResourceType), nameof(id)); + } + + /// + /// Creates or updates a .NET Component in a Managed Environment. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/dotNetComponents/{name} + /// + /// + /// Operation Id + /// DotNetComponents_CreateOrUpdate + /// + /// + /// Default Api Version + /// 2025-02-02-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// 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 .NET Component. + /// Configuration details of the .NET Component. + /// 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, DotNetComponentData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(name, nameof(name)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _dotNetComponentClientDiagnostics.CreateScope("DotNetComponentCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = await _dotNetComponentRestClient.CreateOrUpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, name, data, cancellationToken).ConfigureAwait(false); + var operation = new AppContainersArmOperation(new DotNetComponentOperationSource(Client), _dotNetComponentClientDiagnostics, Pipeline, _dotNetComponentRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, name, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Creates or updates a .NET Component in a Managed Environment. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/dotNetComponents/{name} + /// + /// + /// Operation Id + /// DotNetComponents_CreateOrUpdate + /// + /// + /// Default Api Version + /// 2025-02-02-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// 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 .NET Component. + /// Configuration details of the .NET Component. + /// 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, DotNetComponentData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(name, nameof(name)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _dotNetComponentClientDiagnostics.CreateScope("DotNetComponentCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = _dotNetComponentRestClient.CreateOrUpdate(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, name, data, cancellationToken); + var operation = new AppContainersArmOperation(new DotNetComponentOperationSource(Client), _dotNetComponentClientDiagnostics, Pipeline, _dotNetComponentRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, name, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a .NET Component. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/dotNetComponents/{name} + /// + /// + /// Operation Id + /// DotNetComponents_Get + /// + /// + /// Default Api Version + /// 2025-02-02-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the .NET Component. + /// 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 = _dotNetComponentClientDiagnostics.CreateScope("DotNetComponentCollection.Get"); + scope.Start(); + try + { + var response = await _dotNetComponentRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, name, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new DotNetComponentResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a .NET Component. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/dotNetComponents/{name} + /// + /// + /// Operation Id + /// DotNetComponents_Get + /// + /// + /// Default Api Version + /// 2025-02-02-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the .NET Component. + /// 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 = _dotNetComponentClientDiagnostics.CreateScope("DotNetComponentCollection.Get"); + scope.Start(); + try + { + var response = _dotNetComponentRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, name, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new DotNetComponentResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get the .NET Components for a managed environment. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/dotNetComponents + /// + /// + /// Operation Id + /// DotNetComponents_List + /// + /// + /// Default Api Version + /// 2025-02-02-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// 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) => _dotNetComponentRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _dotNetComponentRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new DotNetComponentResource(Client, DotNetComponentData.DeserializeDotNetComponentData(e)), _dotNetComponentClientDiagnostics, Pipeline, "DotNetComponentCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Get the .NET Components for a managed environment. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/dotNetComponents + /// + /// + /// Operation Id + /// DotNetComponents_List + /// + /// + /// Default Api Version + /// 2025-02-02-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// 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) => _dotNetComponentRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _dotNetComponentRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new DotNetComponentResource(Client, DotNetComponentData.DeserializeDotNetComponentData(e)), _dotNetComponentClientDiagnostics, Pipeline, "DotNetComponentCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/dotNetComponents/{name} + /// + /// + /// Operation Id + /// DotNetComponents_Get + /// + /// + /// Default Api Version + /// 2025-02-02-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the .NET Component. + /// 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 = _dotNetComponentClientDiagnostics.CreateScope("DotNetComponentCollection.Exists"); + scope.Start(); + try + { + var response = await _dotNetComponentRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, 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.App/managedEnvironments/{environmentName}/dotNetComponents/{name} + /// + /// + /// Operation Id + /// DotNetComponents_Get + /// + /// + /// Default Api Version + /// 2025-02-02-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the .NET Component. + /// 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 = _dotNetComponentClientDiagnostics.CreateScope("DotNetComponentCollection.Exists"); + scope.Start(); + try + { + var response = _dotNetComponentRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, name, cancellationToken: cancellationToken); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/dotNetComponents/{name} + /// + /// + /// Operation Id + /// DotNetComponents_Get + /// + /// + /// Default Api Version + /// 2025-02-02-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the .NET Component. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetIfExistsAsync(string name, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(name, nameof(name)); + + using var scope = _dotNetComponentClientDiagnostics.CreateScope("DotNetComponentCollection.GetIfExists"); + scope.Start(); + try + { + var response = await _dotNetComponentRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, name, cancellationToken: cancellationToken).ConfigureAwait(false); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new DotNetComponentResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/dotNetComponents/{name} + /// + /// + /// Operation Id + /// DotNetComponents_Get + /// + /// + /// Default Api Version + /// 2025-02-02-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the .NET Component. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual NullableResponse GetIfExists(string name, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(name, nameof(name)); + + using var scope = _dotNetComponentClientDiagnostics.CreateScope("DotNetComponentCollection.GetIfExists"); + scope.Start(); + try + { + var response = _dotNetComponentRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, name, cancellationToken: cancellationToken); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new DotNetComponentResource(Client, response.Value), 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/containerapps/Azure.ResourceManager.AppContainers/src/Generated/DotNetComponentData.Serialization.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/DotNetComponentData.Serialization.cs new file mode 100644 index 000000000000..956b27eb1874 --- /dev/null +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/DotNetComponentData.Serialization.cs @@ -0,0 +1,389 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Text.Json; +using Azure.Core; +using Azure.ResourceManager.AppContainers.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.AppContainers +{ + public partial class DotNetComponentData : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DotNetComponentData)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + writer.WritePropertyName("properties"u8); + writer.WriteStartObject(); + if (Optional.IsDefined(ComponentType)) + { + writer.WritePropertyName("componentType"u8); + writer.WriteStringValue(ComponentType.Value.ToString()); + } + if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) + { + writer.WritePropertyName("provisioningState"u8); + writer.WriteStringValue(ProvisioningState.Value.ToString()); + } + if (Optional.IsCollectionDefined(Configurations)) + { + writer.WritePropertyName("configurations"u8); + writer.WriteStartArray(); + foreach (var item in Configurations) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(ServiceBinds)) + { + writer.WritePropertyName("serviceBinds"u8); + writer.WriteStartArray(); + foreach (var item in ServiceBinds) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + writer.WriteEndObject(); + } + + DotNetComponentData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DotNetComponentData)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDotNetComponentData(document.RootElement, options); + } + + internal static DotNetComponentData DeserializeDotNetComponentData(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ResourceIdentifier id = default; + string name = default; + ResourceType type = default; + SystemData systemData = default; + DotNetComponentType? componentType = default; + DotNetComponentProvisioningState? provisioningState = default; + IList configurations = default; + IList serviceBinds = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + 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.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + systemData = JsonSerializer.Deserialize(property.Value.GetRawText()); + continue; + } + if (property.NameEquals("properties"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + foreach (var property0 in property.Value.EnumerateObject()) + { + if (property0.NameEquals("componentType"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + componentType = new DotNetComponentType(property0.Value.GetString()); + continue; + } + if (property0.NameEquals("provisioningState"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + provisioningState = new DotNetComponentProvisioningState(property0.Value.GetString()); + continue; + } + if (property0.NameEquals("configurations"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property0.Value.EnumerateArray()) + { + array.Add(DotNetComponentConfigurationProperty.DeserializeDotNetComponentConfigurationProperty(item, options)); + } + configurations = array; + continue; + } + if (property0.NameEquals("serviceBinds"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property0.Value.EnumerateArray()) + { + array.Add(DotNetComponentServiceBind.DeserializeDotNetComponentServiceBind(item, options)); + } + serviceBinds = array; + continue; + } + } + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DotNetComponentData( + id, + name, + type, + systemData, + componentType, + provisioningState, + configurations ?? new ChangeTrackingList(), + serviceBinds ?? new ChangeTrackingList(), + serializedAdditionalRawData); + } + + private BinaryData SerializeBicep(ModelReaderWriterOptions options) + { + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Name), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" name: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Name)) + { + builder.Append(" name: "); + if (Name.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{Name}'''"); + } + else + { + builder.AppendLine($"'{Name}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Id), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" id: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Id)) + { + builder.Append(" id: "); + builder.AppendLine($"'{Id.ToString()}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(SystemData), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" systemData: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(SystemData)) + { + builder.Append(" systemData: "); + builder.AppendLine($"'{SystemData.ToString()}'"); + } + } + + builder.Append(" properties:"); + builder.AppendLine(" {"); + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(ComponentType), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" componentType: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(ComponentType)) + { + builder.Append(" componentType: "); + builder.AppendLine($"'{ComponentType.Value.ToString()}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(ProvisioningState), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" provisioningState: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(ProvisioningState)) + { + builder.Append(" provisioningState: "); + builder.AppendLine($"'{ProvisioningState.Value.ToString()}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Configurations), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" configurations: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsCollectionDefined(Configurations)) + { + if (Configurations.Any()) + { + builder.Append(" configurations: "); + builder.AppendLine("["); + foreach (var item in Configurations) + { + BicepSerializationHelpers.AppendChildObject(builder, item, options, 6, true, " configurations: "); + } + builder.AppendLine(" ]"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(ServiceBinds), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" serviceBinds: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsCollectionDefined(ServiceBinds)) + { + if (ServiceBinds.Any()) + { + builder.Append(" serviceBinds: "); + builder.AppendLine("["); + foreach (var item in ServiceBinds) + { + BicepSerializationHelpers.AppendChildObject(builder, item, options, 6, true, " serviceBinds: "); + } + builder.AppendLine(" ]"); + } + } + } + + builder.AppendLine(" }"); + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerAppContainersContext.Default); + case "bicep": + return SerializeBicep(options); + default: + throw new FormatException($"The model {nameof(DotNetComponentData)} does not support writing '{options.Format}' format."); + } + } + + DotNetComponentData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeDotNetComponentData(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DotNetComponentData)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/DotNetComponentData.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/DotNetComponentData.cs new file mode 100644 index 000000000000..cb6d48351546 --- /dev/null +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/DotNetComponentData.cs @@ -0,0 +1,93 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; +using Azure.ResourceManager.AppContainers.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.AppContainers +{ + /// + /// A class representing the DotNetComponent data model. + /// .NET Component. + /// + public partial class DotNetComponentData : ResourceData + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public DotNetComponentData() + { + Configurations = new ChangeTrackingList(); + ServiceBinds = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// Type of the .NET Component. + /// Provisioning state of the .NET Component. + /// List of .NET Components configuration properties. + /// List of .NET Components that are bound to the .NET component. + /// Keeps track of any properties unknown to the library. + internal DotNetComponentData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, DotNetComponentType? componentType, DotNetComponentProvisioningState? provisioningState, IList configurations, IList serviceBinds, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) + { + ComponentType = componentType; + ProvisioningState = provisioningState; + Configurations = configurations; + ServiceBinds = serviceBinds; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Type of the .NET Component. + [WirePath("properties.componentType")] + public DotNetComponentType? ComponentType { get; set; } + /// Provisioning state of the .NET Component. + [WirePath("properties.provisioningState")] + public DotNetComponentProvisioningState? ProvisioningState { get; } + /// List of .NET Components configuration properties. + [WirePath("properties.configurations")] + public IList Configurations { get; } + /// List of .NET Components that are bound to the .NET component. + [WirePath("properties.serviceBinds")] + public IList ServiceBinds { get; } + } +} diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/DotNetComponentResource.Serialization.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/DotNetComponentResource.Serialization.cs new file mode 100644 index 000000000000..02ba2df8ad32 --- /dev/null +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/DotNetComponentResource.Serialization.cs @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; + +namespace Azure.ResourceManager.AppContainers +{ + public partial class DotNetComponentResource : IJsonModel + { + private static DotNetComponentData s_dataDeserializationInstance; + private static DotNetComponentData DataDeserializationInstance => s_dataDeserializationInstance ??= new(); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); + + DotNetComponentData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)DataDeserializationInstance).Create(ref reader, options); + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options, AzureResourceManagerAppContainersContext.Default); + + DotNetComponentData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options, AzureResourceManagerAppContainersContext.Default); + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)DataDeserializationInstance).GetFormatFromOptions(options); + } +} diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/DotNetComponentResource.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/DotNetComponentResource.cs new file mode 100644 index 000000000000..6fb7e862ecb9 --- /dev/null +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/DotNetComponentResource.cs @@ -0,0 +1,347 @@ +// 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.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.AppContainers +{ + /// + /// A Class representing a DotNetComponent 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 GetDotNetComponentResource method. + /// Otherwise you can get one from its parent resource using the GetDotNetComponent method. + /// + public partial class DotNetComponentResource : ArmResource + { + /// Generate the resource identifier of a instance. + /// The subscriptionId. + /// The resourceGroupName. + /// The environmentName. + /// The name. + public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string environmentName, string name) + { + var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/dotNetComponents/{name}"; + return new ResourceIdentifier(resourceId); + } + + private readonly ClientDiagnostics _dotNetComponentClientDiagnostics; + private readonly DotNetComponentsRestOperations _dotNetComponentRestClient; + private readonly DotNetComponentData _data; + + /// Gets the resource type for the operations. + public static readonly ResourceType ResourceType = "Microsoft.App/managedEnvironments/dotNetComponents"; + + /// Initializes a new instance of the class for mocking. + protected DotNetComponentResource() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The resource that is the target of operations. + internal DotNetComponentResource(ArmClient client, DotNetComponentData 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 DotNetComponentResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _dotNetComponentClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.AppContainers", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string dotNetComponentApiVersion); + _dotNetComponentRestClient = new DotNetComponentsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, dotNetComponentApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + /// 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 DotNetComponentData 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 a .NET Component. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/dotNetComponents/{name} + /// + /// + /// Operation Id + /// DotNetComponents_Get + /// + /// + /// Default Api Version + /// 2025-02-02-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + { + using var scope = _dotNetComponentClientDiagnostics.CreateScope("DotNetComponentResource.Get"); + scope.Start(); + try + { + var response = await _dotNetComponentRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new DotNetComponentResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a .NET Component. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/dotNetComponents/{name} + /// + /// + /// Operation Id + /// DotNetComponents_Get + /// + /// + /// Default Api Version + /// 2025-02-02-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual Response Get(CancellationToken cancellationToken = default) + { + using var scope = _dotNetComponentClientDiagnostics.CreateScope("DotNetComponentResource.Get"); + scope.Start(); + try + { + var response = _dotNetComponentRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new DotNetComponentResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Delete a .NET Component. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/dotNetComponents/{name} + /// + /// + /// Operation Id + /// DotNetComponents_Delete + /// + /// + /// Default Api Version + /// 2025-02-02-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// 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 = _dotNetComponentClientDiagnostics.CreateScope("DotNetComponentResource.Delete"); + scope.Start(); + try + { + var response = await _dotNetComponentRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + var operation = new AppContainersArmOperation(_dotNetComponentClientDiagnostics, Pipeline, _dotNetComponentRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, 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; + } + } + + /// + /// Delete a .NET Component. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/dotNetComponents/{name} + /// + /// + /// Operation Id + /// DotNetComponents_Delete + /// + /// + /// Default Api Version + /// 2025-02-02-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// 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 = _dotNetComponentClientDiagnostics.CreateScope("DotNetComponentResource.Delete"); + scope.Start(); + try + { + var response = _dotNetComponentRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + var operation = new AppContainersArmOperation(_dotNetComponentClientDiagnostics, Pipeline, _dotNetComponentRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletionResponse(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Patches a .NET Component using JSON Merge Patch + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/dotNetComponents/{name} + /// + /// + /// Operation Id + /// DotNetComponents_Update + /// + /// + /// Default Api Version + /// 2025-02-02-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// 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. + /// Configuration details of the .NET Component. + /// The cancellation token to use. + /// is null. + public virtual async Task> UpdateAsync(WaitUntil waitUntil, DotNetComponentData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _dotNetComponentClientDiagnostics.CreateScope("DotNetComponentResource.Update"); + scope.Start(); + try + { + var response = await _dotNetComponentRestClient.UpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, cancellationToken).ConfigureAwait(false); + var operation = new AppContainersArmOperation(new DotNetComponentOperationSource(Client), _dotNetComponentClientDiagnostics, Pipeline, _dotNetComponentRestClient.CreateUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, 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; + } + } + + /// + /// Patches a .NET Component using JSON Merge Patch + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/dotNetComponents/{name} + /// + /// + /// Operation Id + /// DotNetComponents_Update + /// + /// + /// Default Api Version + /// 2025-02-02-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// 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. + /// Configuration details of the .NET Component. + /// The cancellation token to use. + /// is null. + public virtual ArmOperation Update(WaitUntil waitUntil, DotNetComponentData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _dotNetComponentClientDiagnostics.CreateScope("DotNetComponentResource.Update"); + scope.Start(); + try + { + var response = _dotNetComponentRestClient.Update(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, cancellationToken); + var operation = new AppContainersArmOperation(new DotNetComponentOperationSource(Client), _dotNetComponentClientDiagnostics, Pipeline, _dotNetComponentRestClient.CreateUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Extensions/AppContainersExtensions.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Extensions/AppContainersExtensions.cs index 5b6fca5cf4b4..021912733f91 100644 --- a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Extensions/AppContainersExtensions.cs +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Extensions/AppContainersExtensions.cs @@ -33,6 +33,25 @@ private static MockableAppContainersSubscriptionResource GetMockableAppContainer return resource.GetCachedClient(client => new MockableAppContainersSubscriptionResource(client, resource.Id)); } + /// + /// 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. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The resource ID of the resource to get. + /// is null. + /// Returns a object. + public static AppResiliencyResource GetAppResiliencyResource(this ArmClient client, ResourceIdentifier id) + { + Argument.AssertNotNull(client, nameof(client)); + + return GetMockableAppContainersArmClient(client).GetAppResiliencyResource(id); + } + /// /// 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. @@ -52,6 +71,44 @@ public static ContainerAppAuthConfigResource GetContainerAppAuthConfigResource(t return GetMockableAppContainersArmClient(client).GetContainerAppAuthConfigResource(id); } + /// + /// 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. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The resource ID of the resource to get. + /// is null. + /// Returns a object. + public static BuilderResource GetBuilderResource(this ArmClient client, ResourceIdentifier id) + { + Argument.AssertNotNull(client, nameof(client)); + + return GetMockableAppContainersArmClient(client).GetBuilderResource(id); + } + + /// + /// 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. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The resource ID of the resource to get. + /// is null. + /// Returns a object. + public static BuildResource GetBuildResource(this ArmClient client, ResourceIdentifier id) + { + Argument.AssertNotNull(client, nameof(client)); + + return GetMockableAppContainersArmClient(client).GetBuildResource(id); + } + /// /// 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. @@ -110,41 +167,22 @@ public static ContainerAppManagedEnvironmentCertificateResource GetContainerAppM } /// - /// 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. + /// 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. /// /// Mocking - /// To mock this method, please mock instead. + /// To mock this method, please mock instead. /// /// /// The instance the method will execute against. /// The resource ID of the resource to get. /// is null. - /// Returns a object. - public static ContainerAppConnectedEnvironmentDaprComponentResource GetContainerAppConnectedEnvironmentDaprComponentResource(this ArmClient client, ResourceIdentifier id) + /// Returns a object. + public static ConnectedEnvironmentDaprComponentResource GetConnectedEnvironmentDaprComponentResource(this ArmClient client, ResourceIdentifier id) { Argument.AssertNotNull(client, nameof(client)); - return GetMockableAppContainersArmClient(client).GetContainerAppConnectedEnvironmentDaprComponentResource(id); - } - - /// - /// 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. - /// - /// Mocking - /// To mock this method, please mock instead. - /// - /// - /// The instance the method will execute against. - /// The resource ID of the resource to get. - /// is null. - /// Returns a object. - public static ContainerAppManagedEnvironmentDaprComponentResource GetContainerAppManagedEnvironmentDaprComponentResource(this ArmClient client, ResourceIdentifier id) - { - Argument.AssertNotNull(client, nameof(client)); - - return GetMockableAppContainersArmClient(client).GetContainerAppManagedEnvironmentDaprComponentResource(id); + return GetMockableAppContainersArmClient(client).GetConnectedEnvironmentDaprComponentResource(id); } /// @@ -204,6 +242,63 @@ public static ContainerAppDetectorPropertyResource GetContainerAppDetectorProper return GetMockableAppContainersArmClient(client).GetContainerAppDetectorPropertyResource(id); } + /// + /// 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. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The resource ID of the resource to get. + /// is null. + /// Returns a object. + public static ContainerAppsBuildResource GetContainerAppsBuildResource(this ArmClient client, ResourceIdentifier id) + { + Argument.AssertNotNull(client, nameof(client)); + + return GetMockableAppContainersArmClient(client).GetContainerAppsBuildResource(id); + } + + /// + /// 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. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The resource ID of the resource to get. + /// is null. + /// Returns a object. + public static LabelHistoryResource GetLabelHistoryResource(this ArmClient client, ResourceIdentifier id) + { + Argument.AssertNotNull(client, nameof(client)); + + return GetMockableAppContainersArmClient(client).GetLabelHistoryResource(id); + } + + /// + /// 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. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The resource ID of the resource to get. + /// is null. + /// Returns a object. + public static ContainerAppsPatchResource GetContainerAppsPatchResource(this ArmClient client, ResourceIdentifier id) + { + Argument.AssertNotNull(client, nameof(client)); + + return GetMockableAppContainersArmClient(client).GetContainerAppsPatchResource(id); + } + /// /// 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. @@ -394,6 +489,25 @@ public static ContainerAppJobResource GetContainerAppJobResource(this ArmClient return GetMockableAppContainersArmClient(client).GetContainerAppJobResource(id); } + /// + /// 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. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The resource ID of the resource to get. + /// is null. + /// Returns a object. + public static DotNetComponentResource GetDotNetComponentResource(this ArmClient client, ResourceIdentifier id) + { + Argument.AssertNotNull(client, nameof(client)); + + return GetMockableAppContainersArmClient(client).GetDotNetComponentResource(id); + } + /// /// 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. @@ -432,6 +546,44 @@ public static ContainerAppJobExecutionResource GetContainerAppJobExecutionResour return GetMockableAppContainersArmClient(client).GetContainerAppJobExecutionResource(id); } + /// + /// 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. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The resource ID of the resource to get. + /// is null. + /// Returns a object. + public static LogicAppResource GetLogicAppResource(this ArmClient client, ResourceIdentifier id) + { + Argument.AssertNotNull(client, nameof(client)); + + return GetMockableAppContainersArmClient(client).GetLogicAppResource(id); + } + + /// + /// 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. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The resource ID of the resource to get. + /// is null. + /// Returns a object. + public static WorkflowEnvelopeResource GetWorkflowEnvelopeResource(this ArmClient client, ResourceIdentifier id) + { + Argument.AssertNotNull(client, nameof(client)); + + return GetMockableAppContainersArmClient(client).GetWorkflowEnvelopeResource(id); + } + /// /// 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. @@ -451,6 +603,120 @@ public static ContainerAppManagedCertificateResource GetContainerAppManagedCerti return GetMockableAppContainersArmClient(client).GetContainerAppManagedCertificateResource(id); } + /// + /// 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. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The resource ID of the resource to get. + /// is null. + /// Returns a object. + public static AppContainersPrivateEndpointConnectionResource GetAppContainersPrivateEndpointConnectionResource(this ArmClient client, ResourceIdentifier id) + { + Argument.AssertNotNull(client, nameof(client)); + + return GetMockableAppContainersArmClient(client).GetAppContainersPrivateEndpointConnectionResource(id); + } + + /// + /// 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. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The resource ID of the resource to get. + /// is null. + /// Returns a object. + public static DaprComponentResiliencyPolicyResource GetDaprComponentResiliencyPolicyResource(this ArmClient client, ResourceIdentifier id) + { + Argument.AssertNotNull(client, nameof(client)); + + return GetMockableAppContainersArmClient(client).GetDaprComponentResiliencyPolicyResource(id); + } + + /// + /// 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. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The resource ID of the resource to get. + /// is null. + /// Returns a object. + public static ContainerAppManagedEnvironmentDaprComponentResource GetContainerAppManagedEnvironmentDaprComponentResource(this ArmClient client, ResourceIdentifier id) + { + Argument.AssertNotNull(client, nameof(client)); + + return GetMockableAppContainersArmClient(client).GetContainerAppManagedEnvironmentDaprComponentResource(id); + } + + /// + /// 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. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The resource ID of the resource to get. + /// is null. + /// Returns a object. + public static DaprSubscriptionResource GetDaprSubscriptionResource(this ArmClient client, ResourceIdentifier id) + { + Argument.AssertNotNull(client, nameof(client)); + + return GetMockableAppContainersArmClient(client).GetDaprSubscriptionResource(id); + } + + /// + /// 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. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The resource ID of the resource to get. + /// is null. + /// Returns a object. + public static HttpRouteConfigResource GetHttpRouteConfigResource(this ArmClient client, ResourceIdentifier id) + { + Argument.AssertNotNull(client, nameof(client)); + + return GetMockableAppContainersArmClient(client).GetHttpRouteConfigResource(id); + } + + /// + /// 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. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The resource ID of the resource to get. + /// is null. + /// Returns a object. + public static MaintenanceConfigurationResource GetMaintenanceConfigurationResource(this ArmClient client, ResourceIdentifier id) + { + Argument.AssertNotNull(client, nameof(client)); + + return GetMockableAppContainersArmClient(client).GetMaintenanceConfigurationResource(id); + } + /// /// 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. @@ -508,6 +774,99 @@ public static ContainerAppSourceControlResource GetContainerAppSourceControlReso return GetMockableAppContainersArmClient(client).GetContainerAppSourceControlResource(id); } + /// + /// Gets a collection of BuilderResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// is null. + /// An object representing collection of BuilderResources and their operations over a BuilderResource. + public static BuilderResourceCollection GetBuilderResources(this ResourceGroupResource resourceGroupResource) + { + Argument.AssertNotNull(resourceGroupResource, nameof(resourceGroupResource)); + + return GetMockableAppContainersResourceGroupResource(resourceGroupResource).GetBuilderResources(); + } + + /// + /// Get a BuilderResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/builders/{builderName} + /// + /// + /// Operation Id + /// Builders_Get + /// + /// + /// Default Api Version + /// 2025-02-02-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The name of the builder. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public static async Task> GetBuilderResourceAsync(this ResourceGroupResource resourceGroupResource, string builderName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(resourceGroupResource, nameof(resourceGroupResource)); + + return await GetMockableAppContainersResourceGroupResource(resourceGroupResource).GetBuilderResourceAsync(builderName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get a BuilderResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/builders/{builderName} + /// + /// + /// Operation Id + /// Builders_Get + /// + /// + /// Default Api Version + /// 2025-02-02-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The name of the builder. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public static Response GetBuilderResource(this ResourceGroupResource resourceGroupResource, string builderName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(resourceGroupResource, nameof(resourceGroupResource)); + + return GetMockableAppContainersResourceGroupResource(resourceGroupResource).GetBuilderResource(builderName, cancellationToken); + } + /// /// Gets a collection of ContainerAppConnectedEnvironmentResources in the ResourceGroupResource. /// @@ -538,7 +897,7 @@ public static ContainerAppConnectedEnvironmentCollection GetContainerAppConnecte /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -576,7 +935,7 @@ public static async Task> Get /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -631,7 +990,7 @@ public static ContainerAppCollection GetContainerApps(this ResourceGroupResource /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -669,7 +1028,7 @@ public static async Task> GetContainerAppAsync(th /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -724,7 +1083,7 @@ public static ContainerAppManagedEnvironmentCollection GetContainerAppManagedEnv /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -762,7 +1121,7 @@ public static async Task> GetCo /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -817,7 +1176,7 @@ public static ContainerAppJobCollection GetContainerAppJobs(this ResourceGroupRe /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -855,7 +1214,7 @@ public static async Task> GetContainerAppJobAs /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -910,7 +1269,7 @@ public static SessionPoolCollection GetSessionPools(this ResourceGroupResource r /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -948,7 +1307,7 @@ public static async Task> GetSessionPoolAsync(this /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -986,7 +1345,7 @@ public static Response GetSessionPool(this ResourceGroupRes /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// @@ -1019,7 +1378,7 @@ public static AsyncPageable GetAvailableWo /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// @@ -1052,7 +1411,7 @@ public static Pageable GetAvailableWorkloa /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// @@ -1085,7 +1444,7 @@ public static AsyncPageable GetBillingMetersAsync(this /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// @@ -1105,6 +1464,78 @@ public static Pageable GetBillingMeters(this Subscript return GetMockableAppContainersSubscriptionResource(subscriptionResource).GetBillingMeters(location, cancellationToken); } + /// + /// List BuilderResource resources by subscription ID + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.App/builders + /// + /// + /// Operation Id + /// Builders_ListBySubscription + /// + /// + /// Default Api Version + /// 2025-02-02-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The cancellation token to use. + /// is null. + /// An async collection of that may take multiple service requests to iterate over. + public static AsyncPageable GetBuilderResourcesAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); + + return GetMockableAppContainersSubscriptionResource(subscriptionResource).GetBuilderResourcesAsync(cancellationToken); + } + + /// + /// List BuilderResource resources by subscription ID + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.App/builders + /// + /// + /// Operation Id + /// Builders_ListBySubscription + /// + /// + /// Default Api Version + /// 2025-02-02-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The cancellation token to use. + /// is null. + /// A collection of that may take multiple service requests to iterate over. + public static Pageable GetBuilderResources(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); + + return GetMockableAppContainersSubscriptionResource(subscriptionResource).GetBuilderResources(cancellationToken); + } + /// /// Get all connectedEnvironments for a subscription. /// @@ -1118,7 +1549,7 @@ public static Pageable GetBillingMeters(this Subscript /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -1154,7 +1585,7 @@ public static AsyncPageable GetContain /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -1190,7 +1621,7 @@ public static Pageable GetContainerApp /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -1226,7 +1657,7 @@ public static AsyncPageable GetContainerAppsAsync(this Sub /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -1262,7 +1693,7 @@ public static Pageable GetContainerApps(this SubscriptionR /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -1298,7 +1729,7 @@ public static AsyncPageable GetContainerAppJobsAsync(th /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -1334,7 +1765,7 @@ public static Pageable GetContainerAppJobs(this Subscri /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -1369,7 +1800,7 @@ public static async Task> GetCustomDomainVerificationIdAsync(th /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -1404,7 +1835,7 @@ public static Response GetCustomDomainVerificationId(this SubscriptionRe /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -1440,7 +1871,7 @@ public static AsyncPageable GetContainer /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -1476,7 +1907,7 @@ public static Pageable GetContainerAppMa /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -1512,7 +1943,7 @@ public static AsyncPageable GetSessionPoolsAsync(this Subsc /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -1548,7 +1979,7 @@ public static Pageable GetSessionPools(this SubscriptionRes /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// @@ -1581,7 +2012,7 @@ public static AsyncPageable GetUsagesAsync(this SubscriptionR /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Extensions/MockableAppContainersArmClient.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Extensions/MockableAppContainersArmClient.cs index 0af1960f4cb6..4010ad4e0806 100644 --- a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Extensions/MockableAppContainersArmClient.cs +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Extensions/MockableAppContainersArmClient.cs @@ -34,6 +34,18 @@ private string GetApiVersionOrNull(ResourceType resourceType) return apiVersion; } + /// + /// 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 resource ID of the resource to get. + /// Returns a object. + public virtual AppResiliencyResource GetAppResiliencyResource(ResourceIdentifier id) + { + AppResiliencyResource.ValidateResourceId(id); + return new AppResiliencyResource(Client, id); + } + /// /// 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. @@ -46,6 +58,30 @@ public virtual ContainerAppAuthConfigResource GetContainerAppAuthConfigResource( return new ContainerAppAuthConfigResource(Client, id); } + /// + /// 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 resource ID of the resource to get. + /// Returns a object. + public virtual BuilderResource GetBuilderResource(ResourceIdentifier id) + { + BuilderResource.ValidateResourceId(id); + return new BuilderResource(Client, id); + } + + /// + /// 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 resource ID of the resource to get. + /// Returns a object. + public virtual BuildResource GetBuildResource(ResourceIdentifier id) + { + BuildResource.ValidateResourceId(id); + return new BuildResource(Client, id); + } + /// /// 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. @@ -83,27 +119,15 @@ public virtual ContainerAppManagedEnvironmentCertificateResource GetContainerApp } /// - /// 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. + /// 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 resource ID of the resource to get. - /// Returns a object. - public virtual ContainerAppConnectedEnvironmentDaprComponentResource GetContainerAppConnectedEnvironmentDaprComponentResource(ResourceIdentifier id) - { - ContainerAppConnectedEnvironmentDaprComponentResource.ValidateResourceId(id); - return new ContainerAppConnectedEnvironmentDaprComponentResource(Client, id); - } - - /// - /// 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 resource ID of the resource to get. - /// Returns a object. - public virtual ContainerAppManagedEnvironmentDaprComponentResource GetContainerAppManagedEnvironmentDaprComponentResource(ResourceIdentifier id) + /// Returns a object. + public virtual ConnectedEnvironmentDaprComponentResource GetConnectedEnvironmentDaprComponentResource(ResourceIdentifier id) { - ContainerAppManagedEnvironmentDaprComponentResource.ValidateResourceId(id); - return new ContainerAppManagedEnvironmentDaprComponentResource(Client, id); + ConnectedEnvironmentDaprComponentResource.ValidateResourceId(id); + return new ConnectedEnvironmentDaprComponentResource(Client, id); } /// @@ -142,6 +166,42 @@ public virtual ContainerAppDetectorPropertyResource GetContainerAppDetectorPrope return new ContainerAppDetectorPropertyResource(Client, id); } + /// + /// 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 resource ID of the resource to get. + /// Returns a object. + public virtual ContainerAppsBuildResource GetContainerAppsBuildResource(ResourceIdentifier id) + { + ContainerAppsBuildResource.ValidateResourceId(id); + return new ContainerAppsBuildResource(Client, id); + } + + /// + /// 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 resource ID of the resource to get. + /// Returns a object. + public virtual LabelHistoryResource GetLabelHistoryResource(ResourceIdentifier id) + { + LabelHistoryResource.ValidateResourceId(id); + return new LabelHistoryResource(Client, id); + } + + /// + /// 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 resource ID of the resource to get. + /// Returns a object. + public virtual ContainerAppsPatchResource GetContainerAppsPatchResource(ResourceIdentifier id) + { + ContainerAppsPatchResource.ValidateResourceId(id); + return new ContainerAppsPatchResource(Client, id); + } + /// /// 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. @@ -262,6 +322,18 @@ public virtual ContainerAppJobResource GetContainerAppJobResource(ResourceIdenti return new ContainerAppJobResource(Client, id); } + /// + /// 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 resource ID of the resource to get. + /// Returns a object. + public virtual DotNetComponentResource GetDotNetComponentResource(ResourceIdentifier id) + { + DotNetComponentResource.ValidateResourceId(id); + return new DotNetComponentResource(Client, id); + } + /// /// 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. @@ -286,6 +358,30 @@ public virtual ContainerAppJobExecutionResource GetContainerAppJobExecutionResou return new ContainerAppJobExecutionResource(Client, id); } + /// + /// 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 resource ID of the resource to get. + /// Returns a object. + public virtual LogicAppResource GetLogicAppResource(ResourceIdentifier id) + { + LogicAppResource.ValidateResourceId(id); + return new LogicAppResource(Client, id); + } + + /// + /// 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 resource ID of the resource to get. + /// Returns a object. + public virtual WorkflowEnvelopeResource GetWorkflowEnvelopeResource(ResourceIdentifier id) + { + WorkflowEnvelopeResource.ValidateResourceId(id); + return new WorkflowEnvelopeResource(Client, id); + } + /// /// 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. @@ -298,6 +394,78 @@ public virtual ContainerAppManagedCertificateResource GetContainerAppManagedCert return new ContainerAppManagedCertificateResource(Client, id); } + /// + /// 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 resource ID of the resource to get. + /// Returns a object. + public virtual AppContainersPrivateEndpointConnectionResource GetAppContainersPrivateEndpointConnectionResource(ResourceIdentifier id) + { + AppContainersPrivateEndpointConnectionResource.ValidateResourceId(id); + return new AppContainersPrivateEndpointConnectionResource(Client, id); + } + + /// + /// 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 resource ID of the resource to get. + /// Returns a object. + public virtual DaprComponentResiliencyPolicyResource GetDaprComponentResiliencyPolicyResource(ResourceIdentifier id) + { + DaprComponentResiliencyPolicyResource.ValidateResourceId(id); + return new DaprComponentResiliencyPolicyResource(Client, id); + } + + /// + /// 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 resource ID of the resource to get. + /// Returns a object. + public virtual ContainerAppManagedEnvironmentDaprComponentResource GetContainerAppManagedEnvironmentDaprComponentResource(ResourceIdentifier id) + { + ContainerAppManagedEnvironmentDaprComponentResource.ValidateResourceId(id); + return new ContainerAppManagedEnvironmentDaprComponentResource(Client, id); + } + + /// + /// 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 resource ID of the resource to get. + /// Returns a object. + public virtual DaprSubscriptionResource GetDaprSubscriptionResource(ResourceIdentifier id) + { + DaprSubscriptionResource.ValidateResourceId(id); + return new DaprSubscriptionResource(Client, id); + } + + /// + /// 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 resource ID of the resource to get. + /// Returns a object. + public virtual HttpRouteConfigResource GetHttpRouteConfigResource(ResourceIdentifier id) + { + HttpRouteConfigResource.ValidateResourceId(id); + return new HttpRouteConfigResource(Client, id); + } + + /// + /// 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 resource ID of the resource to get. + /// Returns a object. + public virtual MaintenanceConfigurationResource GetMaintenanceConfigurationResource(ResourceIdentifier id) + { + MaintenanceConfigurationResource.ValidateResourceId(id); + return new MaintenanceConfigurationResource(Client, id); + } + /// /// 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. diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Extensions/MockableAppContainersResourceGroupResource.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Extensions/MockableAppContainersResourceGroupResource.cs index 0c3918058ad1..ad43846e78e6 100644 --- a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Extensions/MockableAppContainersResourceGroupResource.cs +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Extensions/MockableAppContainersResourceGroupResource.cs @@ -33,6 +33,75 @@ private string GetApiVersionOrNull(ResourceType resourceType) return apiVersion; } + /// Gets a collection of BuilderResources in the ResourceGroupResource. + /// An object representing collection of BuilderResources and their operations over a BuilderResource. + public virtual BuilderResourceCollection GetBuilderResources() + { + return GetCachedClient(client => new BuilderResourceCollection(client, Id)); + } + + /// + /// Get a BuilderResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/builders/{builderName} + /// + /// + /// Operation Id + /// Builders_Get + /// + /// + /// Default Api Version + /// 2025-02-02-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the builder. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetBuilderResourceAsync(string builderName, CancellationToken cancellationToken = default) + { + return await GetBuilderResources().GetAsync(builderName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get a BuilderResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/builders/{builderName} + /// + /// + /// Operation Id + /// Builders_Get + /// + /// + /// Default Api Version + /// 2025-02-02-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the builder. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetBuilderResource(string builderName, CancellationToken cancellationToken = default) + { + return GetBuilderResources().Get(builderName, cancellationToken); + } + /// Gets a collection of ContainerAppConnectedEnvironmentResources in the ResourceGroupResource. /// An object representing collection of ContainerAppConnectedEnvironmentResources and their operations over a ContainerAppConnectedEnvironmentResource. public virtual ContainerAppConnectedEnvironmentCollection GetContainerAppConnectedEnvironments() @@ -53,7 +122,7 @@ public virtual ContainerAppConnectedEnvironmentCollection GetContainerAppConnect /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -84,7 +153,7 @@ public virtual async Task> Ge /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -122,7 +191,7 @@ public virtual ContainerAppCollection GetContainerApps() /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -153,7 +222,7 @@ public virtual async Task> GetContainerAppAsync(s /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -191,7 +260,7 @@ public virtual ContainerAppManagedEnvironmentCollection GetContainerAppManagedEn /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -222,7 +291,7 @@ public virtual async Task> GetC /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -260,7 +329,7 @@ public virtual ContainerAppJobCollection GetContainerAppJobs() /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -291,7 +360,7 @@ public virtual async Task> GetContainerAppJobA /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -329,7 +398,7 @@ public virtual SessionPoolCollection GetSessionPools() /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -360,7 +429,7 @@ public virtual async Task> GetSessionPoolAsync(str /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Extensions/MockableAppContainersSubscriptionResource.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Extensions/MockableAppContainersSubscriptionResource.cs index 7b7cba4e39be..1d6119a17afd 100644 --- a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Extensions/MockableAppContainersSubscriptionResource.cs +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Extensions/MockableAppContainersSubscriptionResource.cs @@ -22,6 +22,8 @@ public partial class MockableAppContainersSubscriptionResource : ArmResource private AvailableWorkloadProfilesRestOperations _availableWorkloadProfilesRestClient; private ClientDiagnostics _billingMetersClientDiagnostics; private BillingMetersRestOperations _billingMetersRestClient; + private ClientDiagnostics _builderResourceBuildersClientDiagnostics; + private BuildersRestOperations _builderResourceBuildersRestClient; private ClientDiagnostics _containerAppConnectedEnvironmentConnectedEnvironmentsClientDiagnostics; private ConnectedEnvironmentsRestOperations _containerAppConnectedEnvironmentConnectedEnvironmentsRestClient; private ClientDiagnostics _containerAppClientDiagnostics; @@ -53,6 +55,8 @@ internal MockableAppContainersSubscriptionResource(ArmClient client, ResourceIde private AvailableWorkloadProfilesRestOperations AvailableWorkloadProfilesRestClient => _availableWorkloadProfilesRestClient ??= new AvailableWorkloadProfilesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint); private ClientDiagnostics BillingMetersClientDiagnostics => _billingMetersClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.AppContainers", ProviderConstants.DefaultProviderNamespace, Diagnostics); private BillingMetersRestOperations BillingMetersRestClient => _billingMetersRestClient ??= new BillingMetersRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint); + private ClientDiagnostics BuilderResourceBuildersClientDiagnostics => _builderResourceBuildersClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.AppContainers", BuilderResource.ResourceType.Namespace, Diagnostics); + private BuildersRestOperations BuilderResourceBuildersRestClient => _builderResourceBuildersRestClient ??= new BuildersRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, GetApiVersionOrNull(BuilderResource.ResourceType)); private ClientDiagnostics ContainerAppConnectedEnvironmentConnectedEnvironmentsClientDiagnostics => _containerAppConnectedEnvironmentConnectedEnvironmentsClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.AppContainers", ContainerAppConnectedEnvironmentResource.ResourceType.Namespace, Diagnostics); private ConnectedEnvironmentsRestOperations ContainerAppConnectedEnvironmentConnectedEnvironmentsRestClient => _containerAppConnectedEnvironmentConnectedEnvironmentsRestClient ??= new ConnectedEnvironmentsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, GetApiVersionOrNull(ContainerAppConnectedEnvironmentResource.ResourceType)); private ClientDiagnostics ContainerAppClientDiagnostics => _containerAppClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.AppContainers", ContainerAppResource.ResourceType.Namespace, Diagnostics); @@ -87,7 +91,7 @@ private string GetApiVersionOrNull(ResourceType resourceType) /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// @@ -114,7 +118,7 @@ public virtual AsyncPageable GetAvailableW /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// @@ -141,7 +145,7 @@ public virtual Pageable GetAvailableWorklo /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// @@ -167,7 +171,7 @@ public virtual AsyncPageable GetBillingMetersAsync(Azu /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// @@ -180,6 +184,66 @@ public virtual Pageable GetBillingMeters(AzureLocation return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, null, e => ContainerAppBillingMeter.DeserializeContainerAppBillingMeter(e), BillingMetersClientDiagnostics, Pipeline, "MockableAppContainersSubscriptionResource.GetBillingMeters", "value", null, cancellationToken); } + /// + /// List BuilderResource resources by subscription ID + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.App/builders + /// + /// + /// Operation Id + /// Builders_ListBySubscription + /// + /// + /// Default Api Version + /// 2025-02-02-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetBuilderResourcesAsync(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => BuilderResourceBuildersRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => BuilderResourceBuildersRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new BuilderResource(Client, BuilderResourceData.DeserializeBuilderResourceData(e)), BuilderResourceBuildersClientDiagnostics, Pipeline, "MockableAppContainersSubscriptionResource.GetBuilderResources", "value", "nextLink", cancellationToken); + } + + /// + /// List BuilderResource resources by subscription ID + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.App/builders + /// + /// + /// Operation Id + /// Builders_ListBySubscription + /// + /// + /// Default Api Version + /// 2025-02-02-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetBuilderResources(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => BuilderResourceBuildersRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => BuilderResourceBuildersRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new BuilderResource(Client, BuilderResourceData.DeserializeBuilderResourceData(e)), BuilderResourceBuildersClientDiagnostics, Pipeline, "MockableAppContainersSubscriptionResource.GetBuilderResources", "value", "nextLink", cancellationToken); + } + /// /// Get all connectedEnvironments for a subscription. /// @@ -193,7 +257,7 @@ public virtual Pageable GetBillingMeters(AzureLocation /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -223,7 +287,7 @@ public virtual AsyncPageable GetContai /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -253,7 +317,7 @@ public virtual Pageable GetContainerAp /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -283,7 +347,7 @@ public virtual AsyncPageable GetContainerAppsAsync(Cancell /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -313,7 +377,7 @@ public virtual Pageable GetContainerApps(CancellationToken /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -343,7 +407,7 @@ public virtual AsyncPageable GetContainerAppJobsAsync(C /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -373,7 +437,7 @@ public virtual Pageable GetContainerAppJobs(Cancellatio /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -411,7 +475,7 @@ public virtual async Task> GetCustomDomainVerificationIdAsync(C /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -449,7 +513,7 @@ public virtual Response GetCustomDomainVerificationId(CancellationToken /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -479,7 +543,7 @@ public virtual AsyncPageable GetContaine /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -509,7 +573,7 @@ public virtual Pageable GetContainerAppM /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -539,7 +603,7 @@ public virtual AsyncPageable GetSessionPoolsAsync(Cancellat /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -569,7 +633,7 @@ public virtual Pageable GetSessionPools(CancellationToken c /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// @@ -596,7 +660,7 @@ public virtual AsyncPageable GetUsagesAsync(AzureLocation loc /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/HttpRouteConfigCollection.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/HttpRouteConfigCollection.cs new file mode 100644 index 000000000000..020b2e543820 --- /dev/null +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/HttpRouteConfigCollection.cs @@ -0,0 +1,497 @@ +// 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 Autorest.CSharp.Core; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.AppContainers +{ + /// + /// 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 GetHttpRouteConfigs method from an instance of . + /// + public partial class HttpRouteConfigCollection : ArmCollection, IEnumerable, IAsyncEnumerable + { + private readonly ClientDiagnostics _httpRouteConfigClientDiagnostics; + private readonly HttpRouteConfigRestOperations _httpRouteConfigRestClient; + + /// Initializes a new instance of the class for mocking. + protected HttpRouteConfigCollection() + { + } + + /// 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 HttpRouteConfigCollection(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _httpRouteConfigClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.AppContainers", HttpRouteConfigResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(HttpRouteConfigResource.ResourceType, out string httpRouteConfigApiVersion); + _httpRouteConfigRestClient = new HttpRouteConfigRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, httpRouteConfigApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != ContainerAppManagedEnvironmentResource.ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ContainerAppManagedEnvironmentResource.ResourceType), nameof(id)); + } + + /// + /// Create or Update a Http Route Config. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/httpRouteConfigs/{httpRouteName} + /// + /// + /// Operation Id + /// HttpRouteConfig_CreateOrUpdate + /// + /// + /// Default Api Version + /// 2025-02-02-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// 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 Http Route Config Resource. + /// Http Route config to be created or updated. + /// 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 httpRouteName, HttpRouteConfigData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(httpRouteName, nameof(httpRouteName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _httpRouteConfigClientDiagnostics.CreateScope("HttpRouteConfigCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = await _httpRouteConfigRestClient.CreateOrUpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, httpRouteName, data, cancellationToken).ConfigureAwait(false); + var uri = _httpRouteConfigRestClient.CreateCreateOrUpdateRequestUri(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, httpRouteName, data); + var rehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(RequestMethod.Put, uri.ToUri(), uri.ToString(), "None", null, OperationFinalStateVia.OriginalUri.ToString()); + var operation = new AppContainersArmOperation(Response.FromValue(new HttpRouteConfigResource(Client, response), response.GetRawResponse()), rehydrationToken); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Create or Update a Http Route Config. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/httpRouteConfigs/{httpRouteName} + /// + /// + /// Operation Id + /// HttpRouteConfig_CreateOrUpdate + /// + /// + /// Default Api Version + /// 2025-02-02-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// 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 Http Route Config Resource. + /// Http Route config to be created or updated. + /// 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 httpRouteName, HttpRouteConfigData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(httpRouteName, nameof(httpRouteName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _httpRouteConfigClientDiagnostics.CreateScope("HttpRouteConfigCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = _httpRouteConfigRestClient.CreateOrUpdate(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, httpRouteName, data, cancellationToken); + var uri = _httpRouteConfigRestClient.CreateCreateOrUpdateRequestUri(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, httpRouteName, data); + var rehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(RequestMethod.Put, uri.ToUri(), uri.ToString(), "None", null, OperationFinalStateVia.OriginalUri.ToString()); + var operation = new AppContainersArmOperation(Response.FromValue(new HttpRouteConfigResource(Client, response), response.GetRawResponse()), rehydrationToken); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get the specified Managed Http Route Config. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/httpRouteConfigs/{httpRouteName} + /// + /// + /// Operation Id + /// HttpRouteConfig_Get + /// + /// + /// Default Api Version + /// 2025-02-02-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the Http Route Config Resource. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetAsync(string httpRouteName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(httpRouteName, nameof(httpRouteName)); + + using var scope = _httpRouteConfigClientDiagnostics.CreateScope("HttpRouteConfigCollection.Get"); + scope.Start(); + try + { + var response = await _httpRouteConfigRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, httpRouteName, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new HttpRouteConfigResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get the specified Managed Http Route Config. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/httpRouteConfigs/{httpRouteName} + /// + /// + /// Operation Id + /// HttpRouteConfig_Get + /// + /// + /// Default Api Version + /// 2025-02-02-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the Http Route Config Resource. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Get(string httpRouteName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(httpRouteName, nameof(httpRouteName)); + + using var scope = _httpRouteConfigClientDiagnostics.CreateScope("HttpRouteConfigCollection.Get"); + scope.Start(); + try + { + var response = _httpRouteConfigRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, httpRouteName, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new HttpRouteConfigResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get the Managed Http Routes in a given managed environment. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/httpRouteConfigs + /// + /// + /// Operation Id + /// HttpRouteConfig_List + /// + /// + /// Default Api Version + /// 2025-02-02-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// 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) => _httpRouteConfigRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _httpRouteConfigRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new HttpRouteConfigResource(Client, HttpRouteConfigData.DeserializeHttpRouteConfigData(e)), _httpRouteConfigClientDiagnostics, Pipeline, "HttpRouteConfigCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Get the Managed Http Routes in a given managed environment. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/httpRouteConfigs + /// + /// + /// Operation Id + /// HttpRouteConfig_List + /// + /// + /// Default Api Version + /// 2025-02-02-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// 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) => _httpRouteConfigRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _httpRouteConfigRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new HttpRouteConfigResource(Client, HttpRouteConfigData.DeserializeHttpRouteConfigData(e)), _httpRouteConfigClientDiagnostics, Pipeline, "HttpRouteConfigCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/httpRouteConfigs/{httpRouteName} + /// + /// + /// Operation Id + /// HttpRouteConfig_Get + /// + /// + /// Default Api Version + /// 2025-02-02-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the Http Route Config Resource. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> ExistsAsync(string httpRouteName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(httpRouteName, nameof(httpRouteName)); + + using var scope = _httpRouteConfigClientDiagnostics.CreateScope("HttpRouteConfigCollection.Exists"); + scope.Start(); + try + { + var response = await _httpRouteConfigRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, httpRouteName, 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.App/managedEnvironments/{environmentName}/httpRouteConfigs/{httpRouteName} + /// + /// + /// Operation Id + /// HttpRouteConfig_Get + /// + /// + /// Default Api Version + /// 2025-02-02-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the Http Route Config Resource. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Exists(string httpRouteName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(httpRouteName, nameof(httpRouteName)); + + using var scope = _httpRouteConfigClientDiagnostics.CreateScope("HttpRouteConfigCollection.Exists"); + scope.Start(); + try + { + var response = _httpRouteConfigRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, httpRouteName, cancellationToken: cancellationToken); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/httpRouteConfigs/{httpRouteName} + /// + /// + /// Operation Id + /// HttpRouteConfig_Get + /// + /// + /// Default Api Version + /// 2025-02-02-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the Http Route Config Resource. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetIfExistsAsync(string httpRouteName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(httpRouteName, nameof(httpRouteName)); + + using var scope = _httpRouteConfigClientDiagnostics.CreateScope("HttpRouteConfigCollection.GetIfExists"); + scope.Start(); + try + { + var response = await _httpRouteConfigRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, httpRouteName, cancellationToken: cancellationToken).ConfigureAwait(false); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new HttpRouteConfigResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/httpRouteConfigs/{httpRouteName} + /// + /// + /// Operation Id + /// HttpRouteConfig_Get + /// + /// + /// Default Api Version + /// 2025-02-02-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the Http Route Config Resource. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual NullableResponse GetIfExists(string httpRouteName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(httpRouteName, nameof(httpRouteName)); + + using var scope = _httpRouteConfigClientDiagnostics.CreateScope("HttpRouteConfigCollection.GetIfExists"); + scope.Start(); + try + { + var response = _httpRouteConfigRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, httpRouteName, cancellationToken: cancellationToken); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new HttpRouteConfigResource(Client, response.Value), 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/containerapps/Azure.ResourceManager.AppContainers/src/Generated/HttpRouteConfigData.Serialization.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/HttpRouteConfigData.Serialization.cs new file mode 100644 index 000000000000..c4107b8046d9 --- /dev/null +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/HttpRouteConfigData.Serialization.cs @@ -0,0 +1,241 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text; +using System.Text.Json; +using Azure.Core; +using Azure.ResourceManager.AppContainers.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.AppContainers +{ + public partial class HttpRouteConfigData : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(HttpRouteConfigData)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + if (Optional.IsDefined(Properties)) + { + writer.WritePropertyName("properties"u8); + writer.WriteObjectValue(Properties, options); + } + } + + HttpRouteConfigData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(HttpRouteConfigData)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeHttpRouteConfigData(document.RootElement, options); + } + + internal static HttpRouteConfigData DeserializeHttpRouteConfigData(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + HttpRouteConfigProperties properties = default; + ResourceIdentifier id = default; + string name = default; + ResourceType type = default; + SystemData systemData = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("properties"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + properties = HttpRouteConfigProperties.DeserializeHttpRouteConfigProperties(property.Value, options); + 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.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + systemData = JsonSerializer.Deserialize(property.Value.GetRawText()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new HttpRouteConfigData( + id, + name, + type, + systemData, + properties, + serializedAdditionalRawData); + } + + private BinaryData SerializeBicep(ModelReaderWriterOptions options) + { + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Name), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" name: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Name)) + { + builder.Append(" name: "); + if (Name.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{Name}'''"); + } + else + { + builder.AppendLine($"'{Name}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Properties), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" properties: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Properties)) + { + builder.Append(" properties: "); + BicepSerializationHelpers.AppendChildObject(builder, Properties, options, 2, false, " properties: "); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Id), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" id: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Id)) + { + builder.Append(" id: "); + builder.AppendLine($"'{Id.ToString()}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(SystemData), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" systemData: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(SystemData)) + { + builder.Append(" systemData: "); + builder.AppendLine($"'{SystemData.ToString()}'"); + } + } + + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerAppContainersContext.Default); + case "bicep": + return SerializeBicep(options); + default: + throw new FormatException($"The model {nameof(HttpRouteConfigData)} does not support writing '{options.Format}' format."); + } + } + + HttpRouteConfigData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeHttpRouteConfigData(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(HttpRouteConfigData)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/HttpRouteConfigData.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/HttpRouteConfigData.cs new file mode 100644 index 000000000000..cd6debe85e5f --- /dev/null +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/HttpRouteConfigData.cs @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; +using Azure.ResourceManager.AppContainers.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.AppContainers +{ + /// + /// A class representing the HttpRouteConfig data model. + /// Advanced Ingress routing for path/header based routing for a Container App Environment + /// + public partial class HttpRouteConfigData : ResourceData + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public HttpRouteConfigData() + { + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// Http Route Config properties. + /// Keeps track of any properties unknown to the library. + internal HttpRouteConfigData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, HttpRouteConfigProperties properties, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) + { + Properties = properties; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Http Route Config properties. + [WirePath("properties")] + public HttpRouteConfigProperties Properties { get; set; } + } +} diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/HttpRouteConfigResource.Serialization.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/HttpRouteConfigResource.Serialization.cs new file mode 100644 index 000000000000..30d03d32a109 --- /dev/null +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/HttpRouteConfigResource.Serialization.cs @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; + +namespace Azure.ResourceManager.AppContainers +{ + public partial class HttpRouteConfigResource : IJsonModel + { + private static HttpRouteConfigData s_dataDeserializationInstance; + private static HttpRouteConfigData DataDeserializationInstance => s_dataDeserializationInstance ??= new(); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); + + HttpRouteConfigData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)DataDeserializationInstance).Create(ref reader, options); + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options, AzureResourceManagerAppContainersContext.Default); + + HttpRouteConfigData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options, AzureResourceManagerAppContainersContext.Default); + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)DataDeserializationInstance).GetFormatFromOptions(options); + } +} diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/HttpRouteConfigResource.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/HttpRouteConfigResource.cs new file mode 100644 index 000000000000..bc3848e68c92 --- /dev/null +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/HttpRouteConfigResource.cs @@ -0,0 +1,343 @@ +// 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.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.AppContainers +{ + /// + /// A Class representing a HttpRouteConfig 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 GetHttpRouteConfigResource method. + /// Otherwise you can get one from its parent resource using the GetHttpRouteConfig method. + /// + public partial class HttpRouteConfigResource : ArmResource + { + /// Generate the resource identifier of a instance. + /// The subscriptionId. + /// The resourceGroupName. + /// The environmentName. + /// The httpRouteName. + public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string environmentName, string httpRouteName) + { + var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/httpRouteConfigs/{httpRouteName}"; + return new ResourceIdentifier(resourceId); + } + + private readonly ClientDiagnostics _httpRouteConfigClientDiagnostics; + private readonly HttpRouteConfigRestOperations _httpRouteConfigRestClient; + private readonly HttpRouteConfigData _data; + + /// Gets the resource type for the operations. + public static readonly ResourceType ResourceType = "Microsoft.App/managedEnvironments/httpRouteConfigs"; + + /// Initializes a new instance of the class for mocking. + protected HttpRouteConfigResource() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The resource that is the target of operations. + internal HttpRouteConfigResource(ArmClient client, HttpRouteConfigData 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 HttpRouteConfigResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _httpRouteConfigClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.AppContainers", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string httpRouteConfigApiVersion); + _httpRouteConfigRestClient = new HttpRouteConfigRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, httpRouteConfigApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + /// 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 HttpRouteConfigData 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 the specified Managed Http Route Config. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/httpRouteConfigs/{httpRouteName} + /// + /// + /// Operation Id + /// HttpRouteConfig_Get + /// + /// + /// Default Api Version + /// 2025-02-02-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + { + using var scope = _httpRouteConfigClientDiagnostics.CreateScope("HttpRouteConfigResource.Get"); + scope.Start(); + try + { + var response = await _httpRouteConfigRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new HttpRouteConfigResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get the specified Managed Http Route Config. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/httpRouteConfigs/{httpRouteName} + /// + /// + /// Operation Id + /// HttpRouteConfig_Get + /// + /// + /// Default Api Version + /// 2025-02-02-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual Response Get(CancellationToken cancellationToken = default) + { + using var scope = _httpRouteConfigClientDiagnostics.CreateScope("HttpRouteConfigResource.Get"); + scope.Start(); + try + { + var response = _httpRouteConfigRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new HttpRouteConfigResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Deletes the specified Managed Http Route. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/httpRouteConfigs/{httpRouteName} + /// + /// + /// Operation Id + /// HttpRouteConfig_Delete + /// + /// + /// Default Api Version + /// 2025-02-02-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// 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 = _httpRouteConfigClientDiagnostics.CreateScope("HttpRouteConfigResource.Delete"); + scope.Start(); + try + { + var response = await _httpRouteConfigRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + var uri = _httpRouteConfigRestClient.CreateDeleteRequestUri(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name); + var rehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(RequestMethod.Delete, uri.ToUri(), uri.ToString(), "None", null, OperationFinalStateVia.OriginalUri.ToString()); + var operation = new AppContainersArmOperation(response, rehydrationToken); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Deletes the specified Managed Http Route. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/httpRouteConfigs/{httpRouteName} + /// + /// + /// Operation Id + /// HttpRouteConfig_Delete + /// + /// + /// Default Api Version + /// 2025-02-02-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// 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 = _httpRouteConfigClientDiagnostics.CreateScope("HttpRouteConfigResource.Delete"); + scope.Start(); + try + { + var response = _httpRouteConfigRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + var uri = _httpRouteConfigRestClient.CreateDeleteRequestUri(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name); + var rehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(RequestMethod.Delete, uri.ToUri(), uri.ToString(), "None", null, OperationFinalStateVia.OriginalUri.ToString()); + var operation = new AppContainersArmOperation(response, rehydrationToken); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletionResponse(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Patches an http route config resource. Only patching of tags is supported + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/httpRouteConfigs/{httpRouteName} + /// + /// + /// Operation Id + /// HttpRouteConfig_Update + /// + /// + /// Default Api Version + /// 2025-02-02-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Properties of http route config that need to be updated. + /// The cancellation token to use. + /// is null. + public virtual async Task> UpdateAsync(HttpRouteConfigData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _httpRouteConfigClientDiagnostics.CreateScope("HttpRouteConfigResource.Update"); + scope.Start(); + try + { + var response = await _httpRouteConfigRestClient.UpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, cancellationToken).ConfigureAwait(false); + return Response.FromValue(new HttpRouteConfigResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Patches an http route config resource. Only patching of tags is supported + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/httpRouteConfigs/{httpRouteName} + /// + /// + /// Operation Id + /// HttpRouteConfig_Update + /// + /// + /// Default Api Version + /// 2025-02-02-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Properties of http route config that need to be updated. + /// The cancellation token to use. + /// is null. + public virtual Response Update(HttpRouteConfigData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _httpRouteConfigClientDiagnostics.CreateScope("HttpRouteConfigResource.Update"); + scope.Start(); + try + { + var response = _httpRouteConfigRestClient.Update(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, cancellationToken); + return Response.FromValue(new HttpRouteConfigResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/JavaComponentCollection.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/JavaComponentCollection.cs index b60fad9d4fa8..b2fb65e787b0 100644 --- a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/JavaComponentCollection.cs +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/JavaComponentCollection.cs @@ -64,7 +64,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -113,7 +113,7 @@ public virtual async Task> CreateOrUpdateAsy /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -162,7 +162,7 @@ public virtual ArmOperation CreateOrUpdate(WaitUntil wait /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -207,7 +207,7 @@ public virtual async Task> GetAsync(string name, /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -252,7 +252,7 @@ public virtual Response Get(string name, CancellationToke /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -282,7 +282,7 @@ public virtual AsyncPageable GetAllAsync(CancellationToke /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -312,7 +312,7 @@ public virtual Pageable GetAll(CancellationToken cancella /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -355,7 +355,7 @@ public virtual async Task> ExistsAsync(string name, CancellationT /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -398,7 +398,7 @@ public virtual Response Exists(string name, CancellationToken cancellation /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -443,7 +443,7 @@ public virtual async Task> GetIfExistsAs /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/JavaComponentData.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/JavaComponentData.cs index c8642d788bd3..3f6ef7d7157c 100644 --- a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/JavaComponentData.cs +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/JavaComponentData.cs @@ -64,7 +64,7 @@ public JavaComponentData() /// /// Java Component resource specific properties /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , and . + /// The available derived classes include , , , and . /// /// Keeps track of any properties unknown to the library. internal JavaComponentData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, JavaComponentProperties properties, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) @@ -76,7 +76,7 @@ internal JavaComponentData(ResourceIdentifier id, string name, ResourceType reso /// /// Java Component resource specific properties /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , and . + /// The available derived classes include , , , and . /// [WirePath("properties")] public JavaComponentProperties Properties { get; set; } diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/JavaComponentResource.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/JavaComponentResource.cs index 596ed5c5350b..4d7e6bb93fe9 100644 --- a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/JavaComponentResource.cs +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/JavaComponentResource.cs @@ -101,7 +101,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -141,7 +141,7 @@ public virtual async Task> GetAsync(Cancellation /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -181,7 +181,7 @@ public virtual Response Get(CancellationToken cancellatio /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -223,7 +223,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -265,7 +265,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -311,7 +311,7 @@ public virtual async Task> UpdateAsync(WaitU /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/LabelHistoryCollection.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/LabelHistoryCollection.cs new file mode 100644 index 000000000000..aff13fc4ba50 --- /dev/null +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/LabelHistoryCollection.cs @@ -0,0 +1,397 @@ +// 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 Autorest.CSharp.Core; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.AppContainers +{ + /// + /// 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 GetLabelHistories method from an instance of . + /// + public partial class LabelHistoryCollection : ArmCollection, IEnumerable, IAsyncEnumerable + { + private readonly ClientDiagnostics _labelHistoryContainerAppsLabelHistoryClientDiagnostics; + private readonly ContainerAppsLabelHistoryRestOperations _labelHistoryContainerAppsLabelHistoryRestClient; + + /// Initializes a new instance of the class for mocking. + protected LabelHistoryCollection() + { + } + + /// 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 LabelHistoryCollection(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _labelHistoryContainerAppsLabelHistoryClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.AppContainers", LabelHistoryResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(LabelHistoryResource.ResourceType, out string labelHistoryContainerAppsLabelHistoryApiVersion); + _labelHistoryContainerAppsLabelHistoryRestClient = new ContainerAppsLabelHistoryRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, labelHistoryContainerAppsLabelHistoryApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != ContainerAppResource.ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ContainerAppResource.ResourceType), nameof(id)); + } + + /// + /// Get the history of a label. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/labelHistory/{labelName} + /// + /// + /// Operation Id + /// ContainerAppsLabelHistory_GetLabelHistory + /// + /// + /// Default Api Version + /// 2025-02-02-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the Container App label. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetAsync(string labelName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(labelName, nameof(labelName)); + + using var scope = _labelHistoryContainerAppsLabelHistoryClientDiagnostics.CreateScope("LabelHistoryCollection.Get"); + scope.Start(); + try + { + var response = await _labelHistoryContainerAppsLabelHistoryRestClient.GetLabelHistoryAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, labelName, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new LabelHistoryResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get the history of a label. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/labelHistory/{labelName} + /// + /// + /// Operation Id + /// ContainerAppsLabelHistory_GetLabelHistory + /// + /// + /// Default Api Version + /// 2025-02-02-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the Container App label. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Get(string labelName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(labelName, nameof(labelName)); + + using var scope = _labelHistoryContainerAppsLabelHistoryClientDiagnostics.CreateScope("LabelHistoryCollection.Get"); + scope.Start(); + try + { + var response = _labelHistoryContainerAppsLabelHistoryRestClient.GetLabelHistory(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, labelName, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new LabelHistoryResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get the Label History for a given Container App. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/labelHistory + /// + /// + /// Operation Id + /// ContainerAppsLabelHistory_ListLabelHistory + /// + /// + /// Default Api Version + /// 2025-02-02-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The filter to apply on the operation. + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetAllAsync(string filter = null, CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _labelHistoryContainerAppsLabelHistoryRestClient.CreateListLabelHistoryRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, filter); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _labelHistoryContainerAppsLabelHistoryRestClient.CreateListLabelHistoryNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name, filter); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new LabelHistoryResource(Client, LabelHistoryData.DeserializeLabelHistoryData(e)), _labelHistoryContainerAppsLabelHistoryClientDiagnostics, Pipeline, "LabelHistoryCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Get the Label History for a given Container App. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/labelHistory + /// + /// + /// Operation Id + /// ContainerAppsLabelHistory_ListLabelHistory + /// + /// + /// Default Api Version + /// 2025-02-02-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The filter to apply on the operation. + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetAll(string filter = null, CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _labelHistoryContainerAppsLabelHistoryRestClient.CreateListLabelHistoryRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, filter); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _labelHistoryContainerAppsLabelHistoryRestClient.CreateListLabelHistoryNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name, filter); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new LabelHistoryResource(Client, LabelHistoryData.DeserializeLabelHistoryData(e)), _labelHistoryContainerAppsLabelHistoryClientDiagnostics, Pipeline, "LabelHistoryCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/labelHistory/{labelName} + /// + /// + /// Operation Id + /// ContainerAppsLabelHistory_GetLabelHistory + /// + /// + /// Default Api Version + /// 2025-02-02-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the Container App label. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> ExistsAsync(string labelName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(labelName, nameof(labelName)); + + using var scope = _labelHistoryContainerAppsLabelHistoryClientDiagnostics.CreateScope("LabelHistoryCollection.Exists"); + scope.Start(); + try + { + var response = await _labelHistoryContainerAppsLabelHistoryRestClient.GetLabelHistoryAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, labelName, 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.App/containerApps/{containerAppName}/labelHistory/{labelName} + /// + /// + /// Operation Id + /// ContainerAppsLabelHistory_GetLabelHistory + /// + /// + /// Default Api Version + /// 2025-02-02-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the Container App label. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Exists(string labelName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(labelName, nameof(labelName)); + + using var scope = _labelHistoryContainerAppsLabelHistoryClientDiagnostics.CreateScope("LabelHistoryCollection.Exists"); + scope.Start(); + try + { + var response = _labelHistoryContainerAppsLabelHistoryRestClient.GetLabelHistory(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, labelName, cancellationToken: cancellationToken); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/labelHistory/{labelName} + /// + /// + /// Operation Id + /// ContainerAppsLabelHistory_GetLabelHistory + /// + /// + /// Default Api Version + /// 2025-02-02-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the Container App label. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetIfExistsAsync(string labelName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(labelName, nameof(labelName)); + + using var scope = _labelHistoryContainerAppsLabelHistoryClientDiagnostics.CreateScope("LabelHistoryCollection.GetIfExists"); + scope.Start(); + try + { + var response = await _labelHistoryContainerAppsLabelHistoryRestClient.GetLabelHistoryAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, labelName, cancellationToken: cancellationToken).ConfigureAwait(false); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new LabelHistoryResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/labelHistory/{labelName} + /// + /// + /// Operation Id + /// ContainerAppsLabelHistory_GetLabelHistory + /// + /// + /// Default Api Version + /// 2025-02-02-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the Container App label. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual NullableResponse GetIfExists(string labelName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(labelName, nameof(labelName)); + + using var scope = _labelHistoryContainerAppsLabelHistoryClientDiagnostics.CreateScope("LabelHistoryCollection.GetIfExists"); + scope.Start(); + try + { + var response = _labelHistoryContainerAppsLabelHistoryRestClient.GetLabelHistory(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, labelName, cancellationToken: cancellationToken); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new LabelHistoryResource(Client, response.Value), 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/containerapps/Azure.ResourceManager.AppContainers/src/Generated/LabelHistoryData.Serialization.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/LabelHistoryData.Serialization.cs new file mode 100644 index 000000000000..cf296000050f --- /dev/null +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/LabelHistoryData.Serialization.cs @@ -0,0 +1,244 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text; +using System.Text.Json; +using Azure.Core; +using Azure.ResourceManager.AppContainers.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.AppContainers +{ + public partial class LabelHistoryData : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(LabelHistoryData)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + if (Optional.IsDefined(Properties)) + { + writer.WritePropertyName("properties"u8); + writer.WriteObjectValue(Properties, options); + } + } + + LabelHistoryData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(LabelHistoryData)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeLabelHistoryData(document.RootElement, options); + } + + internal static LabelHistoryData DeserializeLabelHistoryData(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + LabelHistoryProperties properties = default; + ResourceIdentifier id = default; + string name = default; + ResourceType type = default; + SystemData systemData = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("properties"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + properties = LabelHistoryProperties.DeserializeLabelHistoryProperties(property.Value, options); + 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.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + systemData = JsonSerializer.Deserialize(property.Value.GetRawText()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new LabelHistoryData( + id, + name, + type, + systemData, + properties, + serializedAdditionalRawData); + } + + private BinaryData SerializeBicep(ModelReaderWriterOptions options) + { + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Name), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" name: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Name)) + { + builder.Append(" name: "); + if (Name.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{Name}'''"); + } + else + { + builder.AppendLine($"'{Name}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue("LabelHistoryRecords", out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" properties: "); + builder.AppendLine("{"); + builder.Append(" records: "); + builder.AppendLine(propertyOverride); + builder.AppendLine(" }"); + } + else + { + if (Optional.IsDefined(Properties)) + { + builder.Append(" properties: "); + BicepSerializationHelpers.AppendChildObject(builder, Properties, options, 2, false, " properties: "); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Id), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" id: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Id)) + { + builder.Append(" id: "); + builder.AppendLine($"'{Id.ToString()}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(SystemData), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" systemData: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(SystemData)) + { + builder.Append(" systemData: "); + builder.AppendLine($"'{SystemData.ToString()}'"); + } + } + + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerAppContainersContext.Default); + case "bicep": + return SerializeBicep(options); + default: + throw new FormatException($"The model {nameof(LabelHistoryData)} does not support writing '{options.Format}' format."); + } + } + + LabelHistoryData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeLabelHistoryData(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(LabelHistoryData)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/LabelHistoryData.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/LabelHistoryData.cs new file mode 100644 index 000000000000..b890871bef4b --- /dev/null +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/LabelHistoryData.cs @@ -0,0 +1,86 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; +using Azure.ResourceManager.AppContainers.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.AppContainers +{ + /// + /// A class representing the LabelHistory data model. + /// Container App Label History. + /// + public partial class LabelHistoryData : ResourceData + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public LabelHistoryData() + { + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// Container App Label History resource specific properties. + /// Keeps track of any properties unknown to the library. + internal LabelHistoryData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, LabelHistoryProperties properties, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) + { + Properties = properties; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Container App Label History resource specific properties. + internal LabelHistoryProperties Properties { get; set; } + /// List of label history records. + [WirePath("properties.records")] + public IReadOnlyList LabelHistoryRecords + { + get + { + if (Properties is null) + Properties = new LabelHistoryProperties(); + return Properties.Records; + } + } + } +} diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/LabelHistoryResource.Serialization.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/LabelHistoryResource.Serialization.cs new file mode 100644 index 000000000000..ad54fb414745 --- /dev/null +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/LabelHistoryResource.Serialization.cs @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; + +namespace Azure.ResourceManager.AppContainers +{ + public partial class LabelHistoryResource : IJsonModel + { + private static LabelHistoryData s_dataDeserializationInstance; + private static LabelHistoryData DataDeserializationInstance => s_dataDeserializationInstance ??= new(); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); + + LabelHistoryData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)DataDeserializationInstance).Create(ref reader, options); + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options, AzureResourceManagerAppContainersContext.Default); + + LabelHistoryData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options, AzureResourceManagerAppContainersContext.Default); + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)DataDeserializationInstance).GetFormatFromOptions(options); + } +} diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/LabelHistoryResource.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/LabelHistoryResource.cs new file mode 100644 index 000000000000..476bd9bae898 --- /dev/null +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/LabelHistoryResource.cs @@ -0,0 +1,259 @@ +// 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.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.AppContainers +{ + /// + /// A Class representing a LabelHistory 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 GetLabelHistoryResource method. + /// Otherwise you can get one from its parent resource using the GetLabelHistory method. + /// + public partial class LabelHistoryResource : ArmResource + { + /// Generate the resource identifier of a instance. + /// The subscriptionId. + /// The resourceGroupName. + /// The containerAppName. + /// The labelName. + public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string containerAppName, string labelName) + { + var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/labelHistory/{labelName}"; + return new ResourceIdentifier(resourceId); + } + + private readonly ClientDiagnostics _labelHistoryContainerAppsLabelHistoryClientDiagnostics; + private readonly ContainerAppsLabelHistoryRestOperations _labelHistoryContainerAppsLabelHistoryRestClient; + private readonly LabelHistoryData _data; + + /// Gets the resource type for the operations. + public static readonly ResourceType ResourceType = "Microsoft.App/containerApps/labelHistory"; + + /// Initializes a new instance of the class for mocking. + protected LabelHistoryResource() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The resource that is the target of operations. + internal LabelHistoryResource(ArmClient client, LabelHistoryData 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 LabelHistoryResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _labelHistoryContainerAppsLabelHistoryClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.AppContainers", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string labelHistoryContainerAppsLabelHistoryApiVersion); + _labelHistoryContainerAppsLabelHistoryRestClient = new ContainerAppsLabelHistoryRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, labelHistoryContainerAppsLabelHistoryApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + /// 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 LabelHistoryData 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 the history of a label. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/labelHistory/{labelName} + /// + /// + /// Operation Id + /// ContainerAppsLabelHistory_GetLabelHistory + /// + /// + /// Default Api Version + /// 2025-02-02-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + { + using var scope = _labelHistoryContainerAppsLabelHistoryClientDiagnostics.CreateScope("LabelHistoryResource.Get"); + scope.Start(); + try + { + var response = await _labelHistoryContainerAppsLabelHistoryRestClient.GetLabelHistoryAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new LabelHistoryResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get the history of a label. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/labelHistory/{labelName} + /// + /// + /// Operation Id + /// ContainerAppsLabelHistory_GetLabelHistory + /// + /// + /// Default Api Version + /// 2025-02-02-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual Response Get(CancellationToken cancellationToken = default) + { + using var scope = _labelHistoryContainerAppsLabelHistoryClientDiagnostics.CreateScope("LabelHistoryResource.Get"); + scope.Start(); + try + { + var response = _labelHistoryContainerAppsLabelHistoryRestClient.GetLabelHistory(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new LabelHistoryResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Delete the history of a label. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/labelHistory/{labelName} + /// + /// + /// Operation Id + /// ContainerAppsLabelHistory_DeleteLabelHistory + /// + /// + /// Default Api Version + /// 2025-02-02-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// 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 = _labelHistoryContainerAppsLabelHistoryClientDiagnostics.CreateScope("LabelHistoryResource.Delete"); + scope.Start(); + try + { + var response = await _labelHistoryContainerAppsLabelHistoryRestClient.DeleteLabelHistoryAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + var uri = _labelHistoryContainerAppsLabelHistoryRestClient.CreateDeleteLabelHistoryRequestUri(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name); + var rehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(RequestMethod.Delete, uri.ToUri(), uri.ToString(), "None", null, OperationFinalStateVia.OriginalUri.ToString()); + var operation = new AppContainersArmOperation(response, rehydrationToken); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Delete the history of a label. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/labelHistory/{labelName} + /// + /// + /// Operation Id + /// ContainerAppsLabelHistory_DeleteLabelHistory + /// + /// + /// Default Api Version + /// 2025-02-02-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// 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 = _labelHistoryContainerAppsLabelHistoryClientDiagnostics.CreateScope("LabelHistoryResource.Delete"); + scope.Start(); + try + { + var response = _labelHistoryContainerAppsLabelHistoryRestClient.DeleteLabelHistory(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + var uri = _labelHistoryContainerAppsLabelHistoryRestClient.CreateDeleteLabelHistoryRequestUri(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name); + var rehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(RequestMethod.Delete, uri.ToUri(), uri.ToString(), "None", null, OperationFinalStateVia.OriginalUri.ToString()); + var operation = new AppContainersArmOperation(response, rehydrationToken); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletionResponse(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/LogicAppCollection.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/LogicAppCollection.cs new file mode 100644 index 000000000000..1943d3be796b --- /dev/null +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/LogicAppCollection.cs @@ -0,0 +1,419 @@ +// 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.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.AppContainers +{ + /// + /// 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 GetLogicApps method from an instance of . + /// + public partial class LogicAppCollection : ArmCollection + { + private readonly ClientDiagnostics _logicAppClientDiagnostics; + private readonly LogicAppsRestOperations _logicAppRestClient; + + /// Initializes a new instance of the class for mocking. + protected LogicAppCollection() + { + } + + /// 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 LogicAppCollection(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _logicAppClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.AppContainers", LogicAppResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(LogicAppResource.ResourceType, out string logicAppApiVersion); + _logicAppRestClient = new LogicAppsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, logicAppApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != ContainerAppResource.ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ContainerAppResource.ResourceType), nameof(id)); + } + + /// + /// Create or update a Logic App extension resource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/providers/Microsoft.App/logicApps/{logicAppName} + /// + /// + /// Operation Id + /// LogicApps_CreateOrUpdate + /// + /// + /// Default Api Version + /// 2025-02-02-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// 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 Logic App, the extension resource. + /// Logic app resource properties. + /// 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 logicAppName, LogicAppData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(logicAppName, nameof(logicAppName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _logicAppClientDiagnostics.CreateScope("LogicAppCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = await _logicAppRestClient.CreateOrUpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, logicAppName, data, cancellationToken).ConfigureAwait(false); + var uri = _logicAppRestClient.CreateCreateOrUpdateRequestUri(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, logicAppName, data); + var rehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(RequestMethod.Put, uri.ToUri(), uri.ToString(), "None", null, OperationFinalStateVia.OriginalUri.ToString()); + var operation = new AppContainersArmOperation(Response.FromValue(new LogicAppResource(Client, response), response.GetRawResponse()), rehydrationToken); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Create or update a Logic App extension resource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/providers/Microsoft.App/logicApps/{logicAppName} + /// + /// + /// Operation Id + /// LogicApps_CreateOrUpdate + /// + /// + /// Default Api Version + /// 2025-02-02-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// 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 Logic App, the extension resource. + /// Logic app resource properties. + /// 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 logicAppName, LogicAppData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(logicAppName, nameof(logicAppName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _logicAppClientDiagnostics.CreateScope("LogicAppCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = _logicAppRestClient.CreateOrUpdate(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, logicAppName, data, cancellationToken); + var uri = _logicAppRestClient.CreateCreateOrUpdateRequestUri(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, logicAppName, data); + var rehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(RequestMethod.Put, uri.ToUri(), uri.ToString(), "None", null, OperationFinalStateVia.OriginalUri.ToString()); + var operation = new AppContainersArmOperation(Response.FromValue(new LogicAppResource(Client, response), response.GetRawResponse()), rehydrationToken); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets a logic app extension resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/providers/Microsoft.App/logicApps/{logicAppName} + /// + /// + /// Operation Id + /// LogicApps_Get + /// + /// + /// Default Api Version + /// 2025-02-02-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the Logic App, the extension resource. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetAsync(string logicAppName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(logicAppName, nameof(logicAppName)); + + using var scope = _logicAppClientDiagnostics.CreateScope("LogicAppCollection.Get"); + scope.Start(); + try + { + var response = await _logicAppRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, logicAppName, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new LogicAppResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets a logic app extension resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/providers/Microsoft.App/logicApps/{logicAppName} + /// + /// + /// Operation Id + /// LogicApps_Get + /// + /// + /// Default Api Version + /// 2025-02-02-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the Logic App, the extension resource. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Get(string logicAppName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(logicAppName, nameof(logicAppName)); + + using var scope = _logicAppClientDiagnostics.CreateScope("LogicAppCollection.Get"); + scope.Start(); + try + { + var response = _logicAppRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, logicAppName, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new LogicAppResource(Client, response.Value), 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.App/containerApps/{containerAppName}/providers/Microsoft.App/logicApps/{logicAppName} + /// + /// + /// Operation Id + /// LogicApps_Get + /// + /// + /// Default Api Version + /// 2025-02-02-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the Logic App, the extension resource. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> ExistsAsync(string logicAppName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(logicAppName, nameof(logicAppName)); + + using var scope = _logicAppClientDiagnostics.CreateScope("LogicAppCollection.Exists"); + scope.Start(); + try + { + var response = await _logicAppRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, logicAppName, 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.App/containerApps/{containerAppName}/providers/Microsoft.App/logicApps/{logicAppName} + /// + /// + /// Operation Id + /// LogicApps_Get + /// + /// + /// Default Api Version + /// 2025-02-02-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the Logic App, the extension resource. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Exists(string logicAppName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(logicAppName, nameof(logicAppName)); + + using var scope = _logicAppClientDiagnostics.CreateScope("LogicAppCollection.Exists"); + scope.Start(); + try + { + var response = _logicAppRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, logicAppName, cancellationToken: cancellationToken); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/providers/Microsoft.App/logicApps/{logicAppName} + /// + /// + /// Operation Id + /// LogicApps_Get + /// + /// + /// Default Api Version + /// 2025-02-02-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the Logic App, the extension resource. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetIfExistsAsync(string logicAppName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(logicAppName, nameof(logicAppName)); + + using var scope = _logicAppClientDiagnostics.CreateScope("LogicAppCollection.GetIfExists"); + scope.Start(); + try + { + var response = await _logicAppRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, logicAppName, cancellationToken: cancellationToken).ConfigureAwait(false); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new LogicAppResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/providers/Microsoft.App/logicApps/{logicAppName} + /// + /// + /// Operation Id + /// LogicApps_Get + /// + /// + /// Default Api Version + /// 2025-02-02-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the Logic App, the extension resource. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual NullableResponse GetIfExists(string logicAppName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(logicAppName, nameof(logicAppName)); + + using var scope = _logicAppClientDiagnostics.CreateScope("LogicAppCollection.GetIfExists"); + scope.Start(); + try + { + var response = _logicAppRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, logicAppName, cancellationToken: cancellationToken); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new LogicAppResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/LogicAppData.Serialization.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/LogicAppData.Serialization.cs new file mode 100644 index 000000000000..a62164e77d9b --- /dev/null +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/LogicAppData.Serialization.cs @@ -0,0 +1,247 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text; +using System.Text.Json; +using Azure.Core; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.AppContainers +{ + public partial class LogicAppData : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(LogicAppData)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + if (Optional.IsDefined(Properties)) + { + writer.WritePropertyName("properties"u8); +#if NET6_0_OR_GREATER + writer.WriteRawValue(Properties); +#else + using (JsonDocument document = JsonDocument.Parse(Properties, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + + LogicAppData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(LogicAppData)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeLogicAppData(document.RootElement, options); + } + + internal static LogicAppData DeserializeLogicAppData(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + BinaryData properties = default; + ResourceIdentifier id = default; + string name = default; + ResourceType type = default; + SystemData systemData = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("properties"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + properties = BinaryData.FromString(property.Value.GetRawText()); + 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.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + systemData = JsonSerializer.Deserialize(property.Value.GetRawText()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new LogicAppData( + id, + name, + type, + systemData, + properties, + serializedAdditionalRawData); + } + + private BinaryData SerializeBicep(ModelReaderWriterOptions options) + { + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Name), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" name: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Name)) + { + builder.Append(" name: "); + if (Name.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{Name}'''"); + } + else + { + builder.AppendLine($"'{Name}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Properties), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" properties: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Properties)) + { + builder.Append(" properties: "); + builder.AppendLine($"'{Properties.ToString()}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Id), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" id: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Id)) + { + builder.Append(" id: "); + builder.AppendLine($"'{Id.ToString()}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(SystemData), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" systemData: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(SystemData)) + { + builder.Append(" systemData: "); + builder.AppendLine($"'{SystemData.ToString()}'"); + } + } + + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerAppContainersContext.Default); + case "bicep": + return SerializeBicep(options); + default: + throw new FormatException($"The model {nameof(LogicAppData)} does not support writing '{options.Format}' format."); + } + } + + LogicAppData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeLogicAppData(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(LogicAppData)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/LogicAppData.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/LogicAppData.cs new file mode 100644 index 000000000000..f91b6b426043 --- /dev/null +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/LogicAppData.cs @@ -0,0 +1,104 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.AppContainers +{ + /// + /// A class representing the LogicApp data model. + /// A logic app extension resource + /// + public partial class LogicAppData : ResourceData + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public LogicAppData() + { + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The resource-specific properties for this resource. + /// Keeps track of any properties unknown to the library. + internal LogicAppData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, BinaryData properties, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) + { + Properties = properties; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// + /// The resource-specific properties for this resource. + /// + /// To assign an object to this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + [WirePath("properties")] + public BinaryData Properties { get; set; } + } +} diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/LogicAppResource.Serialization.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/LogicAppResource.Serialization.cs new file mode 100644 index 000000000000..c53e0a94fcec --- /dev/null +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/LogicAppResource.Serialization.cs @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; + +namespace Azure.ResourceManager.AppContainers +{ + public partial class LogicAppResource : IJsonModel + { + private static LogicAppData s_dataDeserializationInstance; + private static LogicAppData DataDeserializationInstance => s_dataDeserializationInstance ??= new(); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); + + LogicAppData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)DataDeserializationInstance).Create(ref reader, options); + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options, AzureResourceManagerAppContainersContext.Default); + + LogicAppData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options, AzureResourceManagerAppContainersContext.Default); + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)DataDeserializationInstance).GetFormatFromOptions(options); + } +} diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/LogicAppResource.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/LogicAppResource.cs new file mode 100644 index 000000000000..bd66cd92316d --- /dev/null +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/LogicAppResource.cs @@ -0,0 +1,665 @@ +// 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.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.AppContainers.Models; + +namespace Azure.ResourceManager.AppContainers +{ + /// + /// A Class representing a LogicApp 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 GetLogicAppResource method. + /// Otherwise you can get one from its parent resource using the GetLogicApp method. + /// + public partial class LogicAppResource : ArmResource + { + /// Generate the resource identifier of a instance. + /// The subscriptionId. + /// The resourceGroupName. + /// The containerAppName. + /// The logicAppName. + public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string containerAppName, string logicAppName) + { + var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/providers/Microsoft.App/logicApps/{logicAppName}"; + return new ResourceIdentifier(resourceId); + } + + private readonly ClientDiagnostics _logicAppClientDiagnostics; + private readonly LogicAppsRestOperations _logicAppRestClient; + private readonly LogicAppData _data; + + /// Gets the resource type for the operations. + public static readonly ResourceType ResourceType = "Microsoft.App/logicApps"; + + /// Initializes a new instance of the class for mocking. + protected LogicAppResource() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The resource that is the target of operations. + internal LogicAppResource(ArmClient client, LogicAppData 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 LogicAppResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _logicAppClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.AppContainers", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string logicAppApiVersion); + _logicAppRestClient = new LogicAppsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, logicAppApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + /// 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 LogicAppData 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 WorkflowEnvelopeResources in the LogicApp. + /// An object representing collection of WorkflowEnvelopeResources and their operations over a WorkflowEnvelopeResource. + public virtual WorkflowEnvelopeCollection GetWorkflowEnvelopes() + { + return GetCachedClient(client => new WorkflowEnvelopeCollection(client, Id)); + } + + /// + /// Get workflow information by its name + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/providers/Microsoft.App/logicApps/{logicAppName}/workflows/{workflowName} + /// + /// + /// Operation Id + /// LogicApps_GetWorkflow + /// + /// + /// Default Api Version + /// 2025-02-02-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Workflow name. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetWorkflowEnvelopeAsync(string workflowName, CancellationToken cancellationToken = default) + { + return await GetWorkflowEnvelopes().GetAsync(workflowName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get workflow information by its name + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/providers/Microsoft.App/logicApps/{logicAppName}/workflows/{workflowName} + /// + /// + /// Operation Id + /// LogicApps_GetWorkflow + /// + /// + /// Default Api Version + /// 2025-02-02-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Workflow name. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetWorkflowEnvelope(string workflowName, CancellationToken cancellationToken = default) + { + return GetWorkflowEnvelopes().Get(workflowName, cancellationToken); + } + + /// + /// Gets a logic app extension resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/providers/Microsoft.App/logicApps/{logicAppName} + /// + /// + /// Operation Id + /// LogicApps_Get + /// + /// + /// Default Api Version + /// 2025-02-02-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + { + using var scope = _logicAppClientDiagnostics.CreateScope("LogicAppResource.Get"); + scope.Start(); + try + { + var response = await _logicAppRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new LogicAppResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets a logic app extension resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/providers/Microsoft.App/logicApps/{logicAppName} + /// + /// + /// Operation Id + /// LogicApps_Get + /// + /// + /// Default Api Version + /// 2025-02-02-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual Response Get(CancellationToken cancellationToken = default) + { + using var scope = _logicAppClientDiagnostics.CreateScope("LogicAppResource.Get"); + scope.Start(); + try + { + var response = _logicAppRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new LogicAppResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Deletes a Logic App extension resource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/providers/Microsoft.App/logicApps/{logicAppName} + /// + /// + /// Operation Id + /// LogicApps_Delete + /// + /// + /// Default Api Version + /// 2025-02-02-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// 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 = _logicAppClientDiagnostics.CreateScope("LogicAppResource.Delete"); + scope.Start(); + try + { + var response = await _logicAppRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + var uri = _logicAppRestClient.CreateDeleteRequestUri(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name); + var rehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(RequestMethod.Delete, uri.ToUri(), uri.ToString(), "None", null, OperationFinalStateVia.OriginalUri.ToString()); + var operation = new AppContainersArmOperation(response, rehydrationToken); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Deletes a Logic App extension resource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/providers/Microsoft.App/logicApps/{logicAppName} + /// + /// + /// Operation Id + /// LogicApps_Delete + /// + /// + /// Default Api Version + /// 2025-02-02-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// 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 = _logicAppClientDiagnostics.CreateScope("LogicAppResource.Delete"); + scope.Start(); + try + { + var response = _logicAppRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + var uri = _logicAppRestClient.CreateDeleteRequestUri(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name); + var rehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(RequestMethod.Delete, uri.ToUri(), uri.ToString(), "None", null, OperationFinalStateVia.OriginalUri.ToString()); + var operation = new AppContainersArmOperation(response, rehydrationToken); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletionResponse(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Create or update a Logic App extension resource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/providers/Microsoft.App/logicApps/{logicAppName} + /// + /// + /// Operation Id + /// LogicApps_CreateOrUpdate + /// + /// + /// Default Api Version + /// 2025-02-02-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// 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. + /// Logic app resource properties. + /// The cancellation token to use. + /// is null. + public virtual async Task> UpdateAsync(WaitUntil waitUntil, LogicAppData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _logicAppClientDiagnostics.CreateScope("LogicAppResource.Update"); + scope.Start(); + try + { + var response = await _logicAppRestClient.CreateOrUpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, cancellationToken).ConfigureAwait(false); + var uri = _logicAppRestClient.CreateCreateOrUpdateRequestUri(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data); + var rehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(RequestMethod.Put, uri.ToUri(), uri.ToString(), "None", null, OperationFinalStateVia.OriginalUri.ToString()); + var operation = new AppContainersArmOperation(Response.FromValue(new LogicAppResource(Client, response), response.GetRawResponse()), rehydrationToken); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Create or update a Logic App extension resource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/providers/Microsoft.App/logicApps/{logicAppName} + /// + /// + /// Operation Id + /// LogicApps_CreateOrUpdate + /// + /// + /// Default Api Version + /// 2025-02-02-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// 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. + /// Logic app resource properties. + /// The cancellation token to use. + /// is null. + public virtual ArmOperation Update(WaitUntil waitUntil, LogicAppData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _logicAppClientDiagnostics.CreateScope("LogicAppResource.Update"); + scope.Start(); + try + { + var response = _logicAppRestClient.CreateOrUpdate(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, cancellationToken); + var uri = _logicAppRestClient.CreateCreateOrUpdateRequestUri(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data); + var rehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(RequestMethod.Put, uri.ToUri(), uri.ToString(), "None", null, OperationFinalStateVia.OriginalUri.ToString()); + var operation = new AppContainersArmOperation(Response.FromValue(new LogicAppResource(Client, response), response.GetRawResponse()), rehydrationToken); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Creates or updates the artifacts for the logic app + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/providers/Microsoft.App/logicApps/{logicAppName}/deployWorkflowArtifacts + /// + /// + /// Operation Id + /// LogicApps_DeployWorkflowArtifacts + /// + /// + /// Default Api Version + /// 2025-02-02-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Application settings and files of the workflow. + /// The cancellation token to use. + public virtual async Task DeployWorkflowArtifactsAsync(ContainerAppWorkflowArtifacts workflowArtifacts = null, CancellationToken cancellationToken = default) + { + using var scope = _logicAppClientDiagnostics.CreateScope("LogicAppResource.DeployWorkflowArtifacts"); + scope.Start(); + try + { + var response = await _logicAppRestClient.DeployWorkflowArtifactsAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, workflowArtifacts, cancellationToken).ConfigureAwait(false); + return response; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Creates or updates the artifacts for the logic app + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/providers/Microsoft.App/logicApps/{logicAppName}/deployWorkflowArtifacts + /// + /// + /// Operation Id + /// LogicApps_DeployWorkflowArtifacts + /// + /// + /// Default Api Version + /// 2025-02-02-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Application settings and files of the workflow. + /// The cancellation token to use. + public virtual Response DeployWorkflowArtifacts(ContainerAppWorkflowArtifacts workflowArtifacts = null, CancellationToken cancellationToken = default) + { + using var scope = _logicAppClientDiagnostics.CreateScope("LogicAppResource.DeployWorkflowArtifacts"); + scope.Start(); + try + { + var response = _logicAppRestClient.DeployWorkflowArtifacts(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, workflowArtifacts, cancellationToken); + return response; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets logic app's connections. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/providers/Microsoft.App/logicApps/{logicAppName}/listWorkflowsConnections + /// + /// + /// Operation Id + /// LogicApps_ListWorkflowsConnections + /// + /// + /// Default Api Version + /// 2025-02-02-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> GetWorkflowsConnectionsAsync(CancellationToken cancellationToken = default) + { + using var scope = _logicAppClientDiagnostics.CreateScope("LogicAppResource.GetWorkflowsConnections"); + scope.Start(); + try + { + var response = await _logicAppRestClient.ListWorkflowsConnectionsAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + return Response.FromValue(new WorkflowEnvelopeResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets logic app's connections. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/providers/Microsoft.App/logicApps/{logicAppName}/listWorkflowsConnections + /// + /// + /// Operation Id + /// LogicApps_ListWorkflowsConnections + /// + /// + /// Default Api Version + /// 2025-02-02-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual Response GetWorkflowsConnections(CancellationToken cancellationToken = default) + { + using var scope = _logicAppClientDiagnostics.CreateScope("LogicAppResource.GetWorkflowsConnections"); + scope.Start(); + try + { + var response = _logicAppRestClient.ListWorkflowsConnections(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + return Response.FromValue(new WorkflowEnvelopeResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Proxies a the API call to the logic app backed by the container app. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/providers/Microsoft.App/logicApps/{logicAppName}/invoke + /// + /// + /// Operation Id + /// LogicApps_Invoke + /// + /// + /// Default Api Version + /// 2025-02-02-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The proxy path for the API call. + /// The proxy method for the API call. + /// The cancellation token to use. + /// is null. + public virtual async Task> InvokeAsync(string xMsLogicAppsProxyPath, LogicAppsProxyMethod xMsLogicAppsProxyMethod, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(xMsLogicAppsProxyPath, nameof(xMsLogicAppsProxyPath)); + + using var scope = _logicAppClientDiagnostics.CreateScope("LogicAppResource.Invoke"); + scope.Start(); + try + { + var response = await _logicAppRestClient.InvokeAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, xMsLogicAppsProxyPath, xMsLogicAppsProxyMethod, cancellationToken).ConfigureAwait(false); + return response; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Proxies a the API call to the logic app backed by the container app. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/providers/Microsoft.App/logicApps/{logicAppName}/invoke + /// + /// + /// Operation Id + /// LogicApps_Invoke + /// + /// + /// Default Api Version + /// 2025-02-02-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The proxy path for the API call. + /// The proxy method for the API call. + /// The cancellation token to use. + /// is null. + public virtual Response Invoke(string xMsLogicAppsProxyPath, LogicAppsProxyMethod xMsLogicAppsProxyMethod, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(xMsLogicAppsProxyPath, nameof(xMsLogicAppsProxyPath)); + + using var scope = _logicAppClientDiagnostics.CreateScope("LogicAppResource.Invoke"); + scope.Start(); + try + { + var response = _logicAppRestClient.Invoke(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, xMsLogicAppsProxyPath, xMsLogicAppsProxyMethod, cancellationToken); + return response; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/LongRunningOperation/AppContainersPrivateEndpointConnectionOperationSource.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/LongRunningOperation/AppContainersPrivateEndpointConnectionOperationSource.cs new file mode 100644 index 000000000000..143cd064e285 --- /dev/null +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/LongRunningOperation/AppContainersPrivateEndpointConnectionOperationSource.cs @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.ClientModel.Primitives; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; + +namespace Azure.ResourceManager.AppContainers +{ + internal class AppContainersPrivateEndpointConnectionOperationSource : IOperationSource + { + private readonly ArmClient _client; + + internal AppContainersPrivateEndpointConnectionOperationSource(ArmClient client) + { + _client = client; + } + + AppContainersPrivateEndpointConnectionResource IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) + { + var data = ModelReaderWriter.Read(response.Content, ModelReaderWriterOptions.Json, AzureResourceManagerAppContainersContext.Default); + return new AppContainersPrivateEndpointConnectionResource(_client, data); + } + + async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) + { + var data = ModelReaderWriter.Read(response.Content, ModelReaderWriterOptions.Json, AzureResourceManagerAppContainersContext.Default); + return await Task.FromResult(new AppContainersPrivateEndpointConnectionResource(_client, data)).ConfigureAwait(false); + } + } +} diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/LongRunningOperation/BuildResourceOperationSource.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/LongRunningOperation/BuildResourceOperationSource.cs new file mode 100644 index 000000000000..dca832eab2f7 --- /dev/null +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/LongRunningOperation/BuildResourceOperationSource.cs @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.ClientModel.Primitives; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; + +namespace Azure.ResourceManager.AppContainers +{ + internal class BuildResourceOperationSource : IOperationSource + { + private readonly ArmClient _client; + + internal BuildResourceOperationSource(ArmClient client) + { + _client = client; + } + + BuildResource IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) + { + var data = ModelReaderWriter.Read(response.Content, ModelReaderWriterOptions.Json, AzureResourceManagerAppContainersContext.Default); + return new BuildResource(_client, data); + } + + async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) + { + var data = ModelReaderWriter.Read(response.Content, ModelReaderWriterOptions.Json, AzureResourceManagerAppContainersContext.Default); + return await Task.FromResult(new BuildResource(_client, data)).ConfigureAwait(false); + } + } +} diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/LongRunningOperation/BuilderResourceOperationSource.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/LongRunningOperation/BuilderResourceOperationSource.cs new file mode 100644 index 000000000000..0f2a32bde8ee --- /dev/null +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/LongRunningOperation/BuilderResourceOperationSource.cs @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.ClientModel.Primitives; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; + +namespace Azure.ResourceManager.AppContainers +{ + internal class BuilderResourceOperationSource : IOperationSource + { + private readonly ArmClient _client; + + internal BuilderResourceOperationSource(ArmClient client) + { + _client = client; + } + + BuilderResource IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) + { + var data = ModelReaderWriter.Read(response.Content, ModelReaderWriterOptions.Json, AzureResourceManagerAppContainersContext.Default); + return new BuilderResource(_client, data); + } + + async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) + { + var data = ModelReaderWriter.Read(response.Content, ModelReaderWriterOptions.Json, AzureResourceManagerAppContainersContext.Default); + return await Task.FromResult(new BuilderResource(_client, data)).ConfigureAwait(false); + } + } +} diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/LongRunningOperation/ConnectedEnvironmentDaprComponentOperationSource.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/LongRunningOperation/ConnectedEnvironmentDaprComponentOperationSource.cs new file mode 100644 index 000000000000..eac5c044d904 --- /dev/null +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/LongRunningOperation/ConnectedEnvironmentDaprComponentOperationSource.cs @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.ClientModel.Primitives; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; + +namespace Azure.ResourceManager.AppContainers +{ + internal class ConnectedEnvironmentDaprComponentOperationSource : IOperationSource + { + private readonly ArmClient _client; + + internal ConnectedEnvironmentDaprComponentOperationSource(ArmClient client) + { + _client = client; + } + + ConnectedEnvironmentDaprComponentResource IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) + { + var data = ModelReaderWriter.Read(response.Content, ModelReaderWriterOptions.Json, AzureResourceManagerAppContainersContext.Default); + return new ConnectedEnvironmentDaprComponentResource(_client, data); + } + + async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) + { + var data = ModelReaderWriter.Read(response.Content, ModelReaderWriterOptions.Json, AzureResourceManagerAppContainersContext.Default); + return await Task.FromResult(new ConnectedEnvironmentDaprComponentResource(_client, data)).ConfigureAwait(false); + } + } +} diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/LongRunningOperation/ContainerAppConnectedEnvironmentCertificateOperationSource.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/LongRunningOperation/ContainerAppConnectedEnvironmentCertificateOperationSource.cs new file mode 100644 index 000000000000..ee6821d2c2d0 --- /dev/null +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/LongRunningOperation/ContainerAppConnectedEnvironmentCertificateOperationSource.cs @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.ClientModel.Primitives; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; + +namespace Azure.ResourceManager.AppContainers +{ + internal class ContainerAppConnectedEnvironmentCertificateOperationSource : IOperationSource + { + private readonly ArmClient _client; + + internal ContainerAppConnectedEnvironmentCertificateOperationSource(ArmClient client) + { + _client = client; + } + + ContainerAppConnectedEnvironmentCertificateResource IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) + { + var data = ModelReaderWriter.Read(response.Content, ModelReaderWriterOptions.Json, AzureResourceManagerAppContainersContext.Default); + return new ContainerAppConnectedEnvironmentCertificateResource(_client, data); + } + + async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) + { + var data = ModelReaderWriter.Read(response.Content, ModelReaderWriterOptions.Json, AzureResourceManagerAppContainersContext.Default); + return await Task.FromResult(new ContainerAppConnectedEnvironmentCertificateResource(_client, data)).ConfigureAwait(false); + } + } +} diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/LongRunningOperation/ContainerAppConnectedEnvironmentStorageOperationSource.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/LongRunningOperation/ContainerAppConnectedEnvironmentStorageOperationSource.cs new file mode 100644 index 000000000000..70357045522d --- /dev/null +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/LongRunningOperation/ContainerAppConnectedEnvironmentStorageOperationSource.cs @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.ClientModel.Primitives; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; + +namespace Azure.ResourceManager.AppContainers +{ + internal class ContainerAppConnectedEnvironmentStorageOperationSource : IOperationSource + { + private readonly ArmClient _client; + + internal ContainerAppConnectedEnvironmentStorageOperationSource(ArmClient client) + { + _client = client; + } + + ContainerAppConnectedEnvironmentStorageResource IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) + { + var data = ModelReaderWriter.Read(response.Content, ModelReaderWriterOptions.Json, AzureResourceManagerAppContainersContext.Default); + return new ContainerAppConnectedEnvironmentStorageResource(_client, data); + } + + async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) + { + var data = ModelReaderWriter.Read(response.Content, ModelReaderWriterOptions.Json, AzureResourceManagerAppContainersContext.Default); + return await Task.FromResult(new ContainerAppConnectedEnvironmentStorageResource(_client, data)).ConfigureAwait(false); + } + } +} diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/LongRunningOperation/ContainerAppsPatchResourceOperationSource.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/LongRunningOperation/ContainerAppsPatchResourceOperationSource.cs new file mode 100644 index 000000000000..a8eebabefcd9 --- /dev/null +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/LongRunningOperation/ContainerAppsPatchResourceOperationSource.cs @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.ClientModel.Primitives; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; + +namespace Azure.ResourceManager.AppContainers +{ + internal class ContainerAppsPatchResourceOperationSource : IOperationSource + { + private readonly ArmClient _client; + + internal ContainerAppsPatchResourceOperationSource(ArmClient client) + { + _client = client; + } + + ContainerAppsPatchResource IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) + { + var data = ModelReaderWriter.Read(response.Content, ModelReaderWriterOptions.Json, AzureResourceManagerAppContainersContext.Default); + return new ContainerAppsPatchResource(_client, data); + } + + async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) + { + var data = ModelReaderWriter.Read(response.Content, ModelReaderWriterOptions.Json, AzureResourceManagerAppContainersContext.Default); + return await Task.FromResult(new ContainerAppsPatchResource(_client, data)).ConfigureAwait(false); + } + } +} diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/LongRunningOperation/DotNetComponentOperationSource.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/LongRunningOperation/DotNetComponentOperationSource.cs new file mode 100644 index 000000000000..8d4c29cb50b2 --- /dev/null +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/LongRunningOperation/DotNetComponentOperationSource.cs @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.ClientModel.Primitives; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; + +namespace Azure.ResourceManager.AppContainers +{ + internal class DotNetComponentOperationSource : IOperationSource + { + private readonly ArmClient _client; + + internal DotNetComponentOperationSource(ArmClient client) + { + _client = client; + } + + DotNetComponentResource IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) + { + var data = ModelReaderWriter.Read(response.Content, ModelReaderWriterOptions.Json, AzureResourceManagerAppContainersContext.Default); + return new DotNetComponentResource(_client, data); + } + + async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) + { + var data = ModelReaderWriter.Read(response.Content, ModelReaderWriterOptions.Json, AzureResourceManagerAppContainersContext.Default); + return await Task.FromResult(new DotNetComponentResource(_client, data)).ConfigureAwait(false); + } + } +} diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/MaintenanceConfigurationResource.Serialization.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/MaintenanceConfigurationResource.Serialization.cs new file mode 100644 index 000000000000..5dcf981d8747 --- /dev/null +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/MaintenanceConfigurationResource.Serialization.cs @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; + +namespace Azure.ResourceManager.AppContainers +{ + public partial class MaintenanceConfigurationResource : IJsonModel + { + private static MaintenanceConfigurationResourceData s_dataDeserializationInstance; + private static MaintenanceConfigurationResourceData DataDeserializationInstance => s_dataDeserializationInstance ??= new(); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); + + MaintenanceConfigurationResourceData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)DataDeserializationInstance).Create(ref reader, options); + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options, AzureResourceManagerAppContainersContext.Default); + + MaintenanceConfigurationResourceData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options, AzureResourceManagerAppContainersContext.Default); + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)DataDeserializationInstance).GetFormatFromOptions(options); + } +} diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/MaintenanceConfigurationResource.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/MaintenanceConfigurationResource.cs new file mode 100644 index 000000000000..638f2b9a7b62 --- /dev/null +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/MaintenanceConfigurationResource.cs @@ -0,0 +1,355 @@ +// 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.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.AppContainers +{ + /// + /// A Class representing a MaintenanceConfigurationResource 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 GetMaintenanceConfigurationResource method. + /// Otherwise you can get one from its parent resource using the GetMaintenanceConfigurationResource method. + /// + public partial class MaintenanceConfigurationResource : ArmResource + { + /// Generate the resource identifier of a instance. + /// The subscriptionId. + /// The resourceGroupName. + /// The environmentName. + /// The configName. + public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string environmentName, string configName) + { + var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/maintenanceConfigurations/{configName}"; + return new ResourceIdentifier(resourceId); + } + + private readonly ClientDiagnostics _maintenanceConfigurationResourceMaintenanceConfigurationsClientDiagnostics; + private readonly MaintenanceConfigurationsRestOperations _maintenanceConfigurationResourceMaintenanceConfigurationsRestClient; + private readonly MaintenanceConfigurationResourceData _data; + + /// Gets the resource type for the operations. + public static readonly ResourceType ResourceType = "Microsoft.App/managedEnvironments/maintenanceConfigurations"; + + /// Initializes a new instance of the class for mocking. + protected MaintenanceConfigurationResource() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The resource that is the target of operations. + internal MaintenanceConfigurationResource(ArmClient client, MaintenanceConfigurationResourceData 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 MaintenanceConfigurationResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _maintenanceConfigurationResourceMaintenanceConfigurationsClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.AppContainers", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string maintenanceConfigurationResourceMaintenanceConfigurationsApiVersion); + _maintenanceConfigurationResourceMaintenanceConfigurationsRestClient = new MaintenanceConfigurationsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, maintenanceConfigurationResourceMaintenanceConfigurationsApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + /// 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 MaintenanceConfigurationResourceData 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 the maintenance configuration of a ManagedEnvironment . + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/maintenanceConfigurations/{configName} + /// + /// + /// Operation Id + /// MaintenanceConfigurations_Get + /// + /// + /// Default Api Version + /// 2025-02-02-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + { + using var scope = _maintenanceConfigurationResourceMaintenanceConfigurationsClientDiagnostics.CreateScope("MaintenanceConfigurationResource.Get"); + scope.Start(); + try + { + var response = await _maintenanceConfigurationResourceMaintenanceConfigurationsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new MaintenanceConfigurationResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets the maintenance configuration of a ManagedEnvironment . + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/maintenanceConfigurations/{configName} + /// + /// + /// Operation Id + /// MaintenanceConfigurations_Get + /// + /// + /// Default Api Version + /// 2025-02-02-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual Response Get(CancellationToken cancellationToken = default) + { + using var scope = _maintenanceConfigurationResourceMaintenanceConfigurationsClientDiagnostics.CreateScope("MaintenanceConfigurationResource.Get"); + scope.Start(); + try + { + var response = _maintenanceConfigurationResourceMaintenanceConfigurationsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new MaintenanceConfigurationResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Deletes the maintenance configuration of a ManagedEnvironment . + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/maintenanceConfigurations/{configName} + /// + /// + /// Operation Id + /// MaintenanceConfigurations_Delete + /// + /// + /// Default Api Version + /// 2025-02-02-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// 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 = _maintenanceConfigurationResourceMaintenanceConfigurationsClientDiagnostics.CreateScope("MaintenanceConfigurationResource.Delete"); + scope.Start(); + try + { + var response = await _maintenanceConfigurationResourceMaintenanceConfigurationsRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + var uri = _maintenanceConfigurationResourceMaintenanceConfigurationsRestClient.CreateDeleteRequestUri(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name); + var rehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(RequestMethod.Delete, uri.ToUri(), uri.ToString(), "None", null, OperationFinalStateVia.OriginalUri.ToString()); + var operation = new AppContainersArmOperation(response, rehydrationToken); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Deletes the maintenance configuration of a ManagedEnvironment . + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/maintenanceConfigurations/{configName} + /// + /// + /// Operation Id + /// MaintenanceConfigurations_Delete + /// + /// + /// Default Api Version + /// 2025-02-02-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// 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 = _maintenanceConfigurationResourceMaintenanceConfigurationsClientDiagnostics.CreateScope("MaintenanceConfigurationResource.Delete"); + scope.Start(); + try + { + var response = _maintenanceConfigurationResourceMaintenanceConfigurationsRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + var uri = _maintenanceConfigurationResourceMaintenanceConfigurationsRestClient.CreateDeleteRequestUri(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name); + var rehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(RequestMethod.Delete, uri.ToUri(), uri.ToString(), "None", null, OperationFinalStateVia.OriginalUri.ToString()); + var operation = new AppContainersArmOperation(response, rehydrationToken); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletionResponse(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Create or update the maintenance configuration for Managed Environment. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/maintenanceConfigurations/{configName} + /// + /// + /// Operation Id + /// MaintenanceConfigurations_CreateOrUpdate + /// + /// + /// Default Api Version + /// 2025-02-02-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// 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. + /// Parameters to set the maintenance configuration for ManagedEnvironment . + /// The cancellation token to use. + /// is null. + public virtual async Task> UpdateAsync(WaitUntil waitUntil, MaintenanceConfigurationResourceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _maintenanceConfigurationResourceMaintenanceConfigurationsClientDiagnostics.CreateScope("MaintenanceConfigurationResource.Update"); + scope.Start(); + try + { + var response = await _maintenanceConfigurationResourceMaintenanceConfigurationsRestClient.CreateOrUpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, cancellationToken).ConfigureAwait(false); + var uri = _maintenanceConfigurationResourceMaintenanceConfigurationsRestClient.CreateCreateOrUpdateRequestUri(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data); + var rehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(RequestMethod.Put, uri.ToUri(), uri.ToString(), "None", null, OperationFinalStateVia.OriginalUri.ToString()); + var operation = new AppContainersArmOperation(Response.FromValue(new MaintenanceConfigurationResource(Client, response), response.GetRawResponse()), rehydrationToken); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Create or update the maintenance configuration for Managed Environment. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/maintenanceConfigurations/{configName} + /// + /// + /// Operation Id + /// MaintenanceConfigurations_CreateOrUpdate + /// + /// + /// Default Api Version + /// 2025-02-02-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// 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. + /// Parameters to set the maintenance configuration for ManagedEnvironment . + /// The cancellation token to use. + /// is null. + public virtual ArmOperation Update(WaitUntil waitUntil, MaintenanceConfigurationResourceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _maintenanceConfigurationResourceMaintenanceConfigurationsClientDiagnostics.CreateScope("MaintenanceConfigurationResource.Update"); + scope.Start(); + try + { + var response = _maintenanceConfigurationResourceMaintenanceConfigurationsRestClient.CreateOrUpdate(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, cancellationToken); + var uri = _maintenanceConfigurationResourceMaintenanceConfigurationsRestClient.CreateCreateOrUpdateRequestUri(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data); + var rehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(RequestMethod.Put, uri.ToUri(), uri.ToString(), "None", null, OperationFinalStateVia.OriginalUri.ToString()); + var operation = new AppContainersArmOperation(Response.FromValue(new MaintenanceConfigurationResource(Client, response), response.GetRawResponse()), rehydrationToken); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/MaintenanceConfigurationResourceCollection.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/MaintenanceConfigurationResourceCollection.cs new file mode 100644 index 000000000000..33f501a69c77 --- /dev/null +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/MaintenanceConfigurationResourceCollection.cs @@ -0,0 +1,497 @@ +// 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 Autorest.CSharp.Core; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.AppContainers +{ + /// + /// 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 GetMaintenanceConfigurationResources method from an instance of . + /// + public partial class MaintenanceConfigurationResourceCollection : ArmCollection, IEnumerable, IAsyncEnumerable + { + private readonly ClientDiagnostics _maintenanceConfigurationResourceMaintenanceConfigurationsClientDiagnostics; + private readonly MaintenanceConfigurationsRestOperations _maintenanceConfigurationResourceMaintenanceConfigurationsRestClient; + + /// Initializes a new instance of the class for mocking. + protected MaintenanceConfigurationResourceCollection() + { + } + + /// 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 MaintenanceConfigurationResourceCollection(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _maintenanceConfigurationResourceMaintenanceConfigurationsClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.AppContainers", MaintenanceConfigurationResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(MaintenanceConfigurationResource.ResourceType, out string maintenanceConfigurationResourceMaintenanceConfigurationsApiVersion); + _maintenanceConfigurationResourceMaintenanceConfigurationsRestClient = new MaintenanceConfigurationsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, maintenanceConfigurationResourceMaintenanceConfigurationsApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != ContainerAppManagedEnvironmentResource.ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ContainerAppManagedEnvironmentResource.ResourceType), nameof(id)); + } + + /// + /// Create or update the maintenance configuration for Managed Environment. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/maintenanceConfigurations/{configName} + /// + /// + /// Operation Id + /// MaintenanceConfigurations_CreateOrUpdate + /// + /// + /// Default Api Version + /// 2025-02-02-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// 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 name of the maintenance configuration. + /// Parameters to set the maintenance configuration for ManagedEnvironment . + /// 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 configName, MaintenanceConfigurationResourceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(configName, nameof(configName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _maintenanceConfigurationResourceMaintenanceConfigurationsClientDiagnostics.CreateScope("MaintenanceConfigurationResourceCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = await _maintenanceConfigurationResourceMaintenanceConfigurationsRestClient.CreateOrUpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, configName, data, cancellationToken).ConfigureAwait(false); + var uri = _maintenanceConfigurationResourceMaintenanceConfigurationsRestClient.CreateCreateOrUpdateRequestUri(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, configName, data); + var rehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(RequestMethod.Put, uri.ToUri(), uri.ToString(), "None", null, OperationFinalStateVia.OriginalUri.ToString()); + var operation = new AppContainersArmOperation(Response.FromValue(new MaintenanceConfigurationResource(Client, response), response.GetRawResponse()), rehydrationToken); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Create or update the maintenance configuration for Managed Environment. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/maintenanceConfigurations/{configName} + /// + /// + /// Operation Id + /// MaintenanceConfigurations_CreateOrUpdate + /// + /// + /// Default Api Version + /// 2025-02-02-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// 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 name of the maintenance configuration. + /// Parameters to set the maintenance configuration for ManagedEnvironment . + /// 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 configName, MaintenanceConfigurationResourceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(configName, nameof(configName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _maintenanceConfigurationResourceMaintenanceConfigurationsClientDiagnostics.CreateScope("MaintenanceConfigurationResourceCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = _maintenanceConfigurationResourceMaintenanceConfigurationsRestClient.CreateOrUpdate(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, configName, data, cancellationToken); + var uri = _maintenanceConfigurationResourceMaintenanceConfigurationsRestClient.CreateCreateOrUpdateRequestUri(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, configName, data); + var rehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(RequestMethod.Put, uri.ToUri(), uri.ToString(), "None", null, OperationFinalStateVia.OriginalUri.ToString()); + var operation = new AppContainersArmOperation(Response.FromValue(new MaintenanceConfigurationResource(Client, response), response.GetRawResponse()), rehydrationToken); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets the maintenance configuration of a ManagedEnvironment . + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/maintenanceConfigurations/{configName} + /// + /// + /// Operation Id + /// MaintenanceConfigurations_Get + /// + /// + /// Default Api Version + /// 2025-02-02-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the maintenance configuration. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetAsync(string configName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(configName, nameof(configName)); + + using var scope = _maintenanceConfigurationResourceMaintenanceConfigurationsClientDiagnostics.CreateScope("MaintenanceConfigurationResourceCollection.Get"); + scope.Start(); + try + { + var response = await _maintenanceConfigurationResourceMaintenanceConfigurationsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, configName, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new MaintenanceConfigurationResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets the maintenance configuration of a ManagedEnvironment . + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/maintenanceConfigurations/{configName} + /// + /// + /// Operation Id + /// MaintenanceConfigurations_Get + /// + /// + /// Default Api Version + /// 2025-02-02-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the maintenance configuration. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Get(string configName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(configName, nameof(configName)); + + using var scope = _maintenanceConfigurationResourceMaintenanceConfigurationsClientDiagnostics.CreateScope("MaintenanceConfigurationResourceCollection.Get"); + scope.Start(); + try + { + var response = _maintenanceConfigurationResourceMaintenanceConfigurationsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, configName, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new MaintenanceConfigurationResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets all maintenance configurations in the specified Managed Environment. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/maintenanceConfigurations + /// + /// + /// Operation Id + /// MaintenanceConfigurations_List + /// + /// + /// Default Api Version + /// 2025-02-02-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// 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) => _maintenanceConfigurationResourceMaintenanceConfigurationsRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _maintenanceConfigurationResourceMaintenanceConfigurationsRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new MaintenanceConfigurationResource(Client, MaintenanceConfigurationResourceData.DeserializeMaintenanceConfigurationResourceData(e)), _maintenanceConfigurationResourceMaintenanceConfigurationsClientDiagnostics, Pipeline, "MaintenanceConfigurationResourceCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Gets all maintenance configurations in the specified Managed Environment. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/maintenanceConfigurations + /// + /// + /// Operation Id + /// MaintenanceConfigurations_List + /// + /// + /// Default Api Version + /// 2025-02-02-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// 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) => _maintenanceConfigurationResourceMaintenanceConfigurationsRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _maintenanceConfigurationResourceMaintenanceConfigurationsRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new MaintenanceConfigurationResource(Client, MaintenanceConfigurationResourceData.DeserializeMaintenanceConfigurationResourceData(e)), _maintenanceConfigurationResourceMaintenanceConfigurationsClientDiagnostics, Pipeline, "MaintenanceConfigurationResourceCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/maintenanceConfigurations/{configName} + /// + /// + /// Operation Id + /// MaintenanceConfigurations_Get + /// + /// + /// Default Api Version + /// 2025-02-02-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the maintenance configuration. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> ExistsAsync(string configName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(configName, nameof(configName)); + + using var scope = _maintenanceConfigurationResourceMaintenanceConfigurationsClientDiagnostics.CreateScope("MaintenanceConfigurationResourceCollection.Exists"); + scope.Start(); + try + { + var response = await _maintenanceConfigurationResourceMaintenanceConfigurationsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, configName, 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.App/managedEnvironments/{environmentName}/maintenanceConfigurations/{configName} + /// + /// + /// Operation Id + /// MaintenanceConfigurations_Get + /// + /// + /// Default Api Version + /// 2025-02-02-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the maintenance configuration. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Exists(string configName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(configName, nameof(configName)); + + using var scope = _maintenanceConfigurationResourceMaintenanceConfigurationsClientDiagnostics.CreateScope("MaintenanceConfigurationResourceCollection.Exists"); + scope.Start(); + try + { + var response = _maintenanceConfigurationResourceMaintenanceConfigurationsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, configName, cancellationToken: cancellationToken); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/maintenanceConfigurations/{configName} + /// + /// + /// Operation Id + /// MaintenanceConfigurations_Get + /// + /// + /// Default Api Version + /// 2025-02-02-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the maintenance configuration. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetIfExistsAsync(string configName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(configName, nameof(configName)); + + using var scope = _maintenanceConfigurationResourceMaintenanceConfigurationsClientDiagnostics.CreateScope("MaintenanceConfigurationResourceCollection.GetIfExists"); + scope.Start(); + try + { + var response = await _maintenanceConfigurationResourceMaintenanceConfigurationsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, configName, cancellationToken: cancellationToken).ConfigureAwait(false); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new MaintenanceConfigurationResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/maintenanceConfigurations/{configName} + /// + /// + /// Operation Id + /// MaintenanceConfigurations_Get + /// + /// + /// Default Api Version + /// 2025-02-02-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the maintenance configuration. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual NullableResponse GetIfExists(string configName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(configName, nameof(configName)); + + using var scope = _maintenanceConfigurationResourceMaintenanceConfigurationsClientDiagnostics.CreateScope("MaintenanceConfigurationResourceCollection.GetIfExists"); + scope.Start(); + try + { + var response = _maintenanceConfigurationResourceMaintenanceConfigurationsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, configName, cancellationToken: cancellationToken); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new MaintenanceConfigurationResource(Client, response.Value), 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/containerapps/Azure.ResourceManager.AppContainers/src/Generated/MaintenanceConfigurationResourceData.Serialization.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/MaintenanceConfigurationResourceData.Serialization.cs new file mode 100644 index 000000000000..e86bebab4ee6 --- /dev/null +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/MaintenanceConfigurationResourceData.Serialization.cs @@ -0,0 +1,278 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Text.Json; +using Azure.Core; +using Azure.ResourceManager.AppContainers.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.AppContainers +{ + public partial class MaintenanceConfigurationResourceData : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(MaintenanceConfigurationResourceData)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + writer.WritePropertyName("properties"u8); + writer.WriteStartObject(); + if (Optional.IsCollectionDefined(ScheduledEntries)) + { + writer.WritePropertyName("scheduledEntries"u8); + writer.WriteStartArray(); + foreach (var item in ScheduledEntries) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + writer.WriteEndObject(); + } + + MaintenanceConfigurationResourceData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(MaintenanceConfigurationResourceData)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeMaintenanceConfigurationResourceData(document.RootElement, options); + } + + internal static MaintenanceConfigurationResourceData DeserializeMaintenanceConfigurationResourceData(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ResourceIdentifier id = default; + string name = default; + ResourceType type = default; + SystemData systemData = default; + IList scheduledEntries = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + 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.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + systemData = JsonSerializer.Deserialize(property.Value.GetRawText()); + continue; + } + if (property.NameEquals("properties"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + foreach (var property0 in property.Value.EnumerateObject()) + { + if (property0.NameEquals("scheduledEntries"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property0.Value.EnumerateArray()) + { + array.Add(ScheduledEntry.DeserializeScheduledEntry(item, options)); + } + scheduledEntries = array; + continue; + } + } + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new MaintenanceConfigurationResourceData( + id, + name, + type, + systemData, + scheduledEntries ?? new ChangeTrackingList(), + serializedAdditionalRawData); + } + + private BinaryData SerializeBicep(ModelReaderWriterOptions options) + { + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Name), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" name: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Name)) + { + builder.Append(" name: "); + if (Name.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{Name}'''"); + } + else + { + builder.AppendLine($"'{Name}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Id), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" id: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Id)) + { + builder.Append(" id: "); + builder.AppendLine($"'{Id.ToString()}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(SystemData), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" systemData: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(SystemData)) + { + builder.Append(" systemData: "); + builder.AppendLine($"'{SystemData.ToString()}'"); + } + } + + builder.Append(" properties:"); + builder.AppendLine(" {"); + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(ScheduledEntries), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" scheduledEntries: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsCollectionDefined(ScheduledEntries)) + { + if (ScheduledEntries.Any()) + { + builder.Append(" scheduledEntries: "); + builder.AppendLine("["); + foreach (var item in ScheduledEntries) + { + BicepSerializationHelpers.AppendChildObject(builder, item, options, 6, true, " scheduledEntries: "); + } + builder.AppendLine(" ]"); + } + } + } + + builder.AppendLine(" }"); + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerAppContainersContext.Default); + case "bicep": + return SerializeBicep(options); + default: + throw new FormatException($"The model {nameof(MaintenanceConfigurationResourceData)} does not support writing '{options.Format}' format."); + } + } + + MaintenanceConfigurationResourceData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeMaintenanceConfigurationResourceData(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(MaintenanceConfigurationResourceData)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/MaintenanceConfigurationResourceData.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/MaintenanceConfigurationResourceData.cs new file mode 100644 index 000000000000..491ac5fe62f5 --- /dev/null +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/MaintenanceConfigurationResourceData.cs @@ -0,0 +1,77 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; +using Azure.ResourceManager.AppContainers.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.AppContainers +{ + /// + /// A class representing the MaintenanceConfigurationResource data model. + /// Information about the Maintenance Configuration resource. + /// + public partial class MaintenanceConfigurationResourceData : ResourceData + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public MaintenanceConfigurationResourceData() + { + ScheduledEntries = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// List of maintenance schedules for a managed environment. + /// Keeps track of any properties unknown to the library. + internal MaintenanceConfigurationResourceData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IList scheduledEntries, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) + { + ScheduledEntries = scheduledEntries; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// List of maintenance schedules for a managed environment. + [WirePath("properties.scheduledEntries")] + public IList ScheduledEntries { get; } + } +} diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/AppContainerResources.Serialization.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/AppContainerResources.Serialization.cs index 828dac8154a4..754b68adf520 100644 --- a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/AppContainerResources.Serialization.cs +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/AppContainerResources.Serialization.cs @@ -50,6 +50,11 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WritePropertyName("ephemeralStorage"u8); writer.WriteStringValue(EphemeralStorage); } + if (Optional.IsDefined(Gpu)) + { + writer.WritePropertyName("gpu"u8); + writer.WriteNumberValue(Gpu.Value); + } if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) @@ -90,6 +95,7 @@ internal static AppContainerResources DeserializeAppContainerResources(JsonEleme double? cpu = default; string memory = default; string ephemeralStorage = default; + double? gpu = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -113,13 +119,22 @@ internal static AppContainerResources DeserializeAppContainerResources(JsonEleme ephemeralStorage = property.Value.GetString(); continue; } + if (property.NameEquals("gpu"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + gpu = property.Value.GetDouble(); + continue; + } if (options.Format != "W") { rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); } } serializedAdditionalRawData = rawDataDictionary; - return new AppContainerResources(cpu, memory, ephemeralStorage, serializedAdditionalRawData); + return new AppContainerResources(cpu, memory, ephemeralStorage, gpu, serializedAdditionalRawData); } private BinaryData SerializeBicep(ModelReaderWriterOptions options) @@ -194,6 +209,21 @@ private BinaryData SerializeBicep(ModelReaderWriterOptions options) } } + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Gpu), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" gpu: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Gpu)) + { + builder.Append(" gpu: "); + builder.AppendLine($"'{Gpu.Value.ToString()}'"); + } + } + builder.AppendLine("}"); return BinaryData.FromString(builder.ToString()); } diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/AppContainerResources.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/AppContainerResources.cs index 551e7de26e98..c4fd947d9139 100644 --- a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/AppContainerResources.cs +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/AppContainerResources.cs @@ -54,12 +54,14 @@ public AppContainerResources() /// Required CPU in cores, e.g. 0.5. /// Required memory, e.g. "250Mb". /// Ephemeral Storage, e.g. "1Gi". + /// Required GPU in cores for GPU based app, e.g. 1.0. /// Keeps track of any properties unknown to the library. - internal AppContainerResources(double? cpu, string memory, string ephemeralStorage, IDictionary serializedAdditionalRawData) + internal AppContainerResources(double? cpu, string memory, string ephemeralStorage, double? gpu, IDictionary serializedAdditionalRawData) { Cpu = cpu; Memory = memory; EphemeralStorage = ephemeralStorage; + Gpu = gpu; _serializedAdditionalRawData = serializedAdditionalRawData; } @@ -72,5 +74,8 @@ internal AppContainerResources(double? cpu, string memory, string ephemeralStora /// Ephemeral Storage, e.g. "1Gi". [WirePath("ephemeralStorage")] public string EphemeralStorage { get; } + /// Required GPU in cores for GPU based app, e.g. 1.0. + [WirePath("gpu")] + public double? Gpu { get; set; } } } diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/AppContainersKind.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/AppContainersKind.cs new file mode 100644 index 000000000000..4504938648d9 --- /dev/null +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/AppContainersKind.cs @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.AppContainers.Models +{ + /// Metadata used to render different experiences for resources of the same type; e.g. WorkflowApp is a kind of Microsoft.App/ContainerApps type. If supported, the resource provider must validate and persist this value. + public readonly partial struct AppContainersKind : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public AppContainersKind(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string WorkflowappValue = "workflowapp"; + + /// workflowapp. + public static AppContainersKind Workflowapp { get; } = new AppContainersKind(WorkflowappValue); + /// Determines if two values are the same. + public static bool operator ==(AppContainersKind left, AppContainersKind right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(AppContainersKind left, AppContainersKind right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator AppContainersKind(string value) => new AppContainersKind(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is AppContainersKind other && Equals(other); + /// + public bool Equals(AppContainersKind other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/AppContainersPrivateEndpointConnectionListResult.Serialization.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/AppContainersPrivateEndpointConnectionListResult.Serialization.cs new file mode 100644 index 000000000000..e15204a74858 --- /dev/null +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/AppContainersPrivateEndpointConnectionListResult.Serialization.cs @@ -0,0 +1,215 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.AppContainers.Models +{ + internal partial class AppContainersPrivateEndpointConnectionListResult : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AppContainersPrivateEndpointConnectionListResult)} does not support writing '{format}' format."); + } + + if (Optional.IsCollectionDefined(Value)) + { + writer.WritePropertyName("value"u8); + writer.WriteStartArray(); + foreach (var item in Value) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && Optional.IsDefined(NextLink)) + { + writer.WritePropertyName("nextLink"u8); + writer.WriteStringValue(NextLink.AbsoluteUri); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + AppContainersPrivateEndpointConnectionListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AppContainersPrivateEndpointConnectionListResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAppContainersPrivateEndpointConnectionListResult(document.RootElement, options); + } + + internal static AppContainersPrivateEndpointConnectionListResult DeserializeAppContainersPrivateEndpointConnectionListResult(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IReadOnlyList value = default; + Uri nextLink = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(AppContainersPrivateEndpointConnectionData.DeserializeAppContainersPrivateEndpointConnectionData(item, options)); + } + value = array; + continue; + } + if (property.NameEquals("nextLink"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + nextLink = new Uri(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new AppContainersPrivateEndpointConnectionListResult(value ?? new ChangeTrackingList(), nextLink, serializedAdditionalRawData); + } + + private BinaryData SerializeBicep(ModelReaderWriterOptions options) + { + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Value), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" value: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsCollectionDefined(Value)) + { + if (Value.Any()) + { + builder.Append(" value: "); + builder.AppendLine("["); + foreach (var item in Value) + { + BicepSerializationHelpers.AppendChildObject(builder, item, options, 4, true, " value: "); + } + builder.AppendLine(" ]"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(NextLink), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" nextLink: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(NextLink)) + { + builder.Append(" nextLink: "); + builder.AppendLine($"'{NextLink.AbsoluteUri}'"); + } + } + + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerAppContainersContext.Default); + case "bicep": + return SerializeBicep(options); + default: + throw new FormatException($"The model {nameof(AppContainersPrivateEndpointConnectionListResult)} does not support writing '{options.Format}' format."); + } + } + + AppContainersPrivateEndpointConnectionListResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeAppContainersPrivateEndpointConnectionListResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(AppContainersPrivateEndpointConnectionListResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/AppContainersPrivateEndpointConnectionListResult.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/AppContainersPrivateEndpointConnectionListResult.cs new file mode 100644 index 000000000000..0dbc9e43da18 --- /dev/null +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/AppContainersPrivateEndpointConnectionListResult.cs @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.AppContainers.Models +{ + /// List of private endpoint connection associated with the specified resource. + internal partial class AppContainersPrivateEndpointConnectionListResult + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + internal AppContainersPrivateEndpointConnectionListResult() + { + Value = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// Array of private endpoint connections. + /// URL to get the next set of operation list results (if there are any). + /// Keeps track of any properties unknown to the library. + internal AppContainersPrivateEndpointConnectionListResult(IReadOnlyList value, Uri nextLink, IDictionary serializedAdditionalRawData) + { + Value = value; + NextLink = nextLink; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Array of private endpoint connections. + public IReadOnlyList Value { get; } + /// URL to get the next set of operation list results (if there are any). + public Uri NextLink { get; } + } +} diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/AppContainersPrivateEndpointConnectionProvisioningState.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/AppContainersPrivateEndpointConnectionProvisioningState.cs new file mode 100644 index 000000000000..0c08f2396f98 --- /dev/null +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/AppContainersPrivateEndpointConnectionProvisioningState.cs @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.AppContainers.Models +{ + /// The current provisioning state. + public readonly partial struct AppContainersPrivateEndpointConnectionProvisioningState : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public AppContainersPrivateEndpointConnectionProvisioningState(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string SucceededValue = "Succeeded"; + private const string FailedValue = "Failed"; + private const string CanceledValue = "Canceled"; + private const string WaitingValue = "Waiting"; + private const string UpdatingValue = "Updating"; + private const string DeletingValue = "Deleting"; + private const string PendingValue = "Pending"; + + /// Succeeded. + public static AppContainersPrivateEndpointConnectionProvisioningState Succeeded { get; } = new AppContainersPrivateEndpointConnectionProvisioningState(SucceededValue); + /// Failed. + public static AppContainersPrivateEndpointConnectionProvisioningState Failed { get; } = new AppContainersPrivateEndpointConnectionProvisioningState(FailedValue); + /// Canceled. + public static AppContainersPrivateEndpointConnectionProvisioningState Canceled { get; } = new AppContainersPrivateEndpointConnectionProvisioningState(CanceledValue); + /// Waiting. + public static AppContainersPrivateEndpointConnectionProvisioningState Waiting { get; } = new AppContainersPrivateEndpointConnectionProvisioningState(WaitingValue); + /// Updating. + public static AppContainersPrivateEndpointConnectionProvisioningState Updating { get; } = new AppContainersPrivateEndpointConnectionProvisioningState(UpdatingValue); + /// Deleting. + public static AppContainersPrivateEndpointConnectionProvisioningState Deleting { get; } = new AppContainersPrivateEndpointConnectionProvisioningState(DeletingValue); + /// Pending. + public static AppContainersPrivateEndpointConnectionProvisioningState Pending { get; } = new AppContainersPrivateEndpointConnectionProvisioningState(PendingValue); + /// Determines if two values are the same. + public static bool operator ==(AppContainersPrivateEndpointConnectionProvisioningState left, AppContainersPrivateEndpointConnectionProvisioningState right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(AppContainersPrivateEndpointConnectionProvisioningState left, AppContainersPrivateEndpointConnectionProvisioningState right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator AppContainersPrivateEndpointConnectionProvisioningState(string value) => new AppContainersPrivateEndpointConnectionProvisioningState(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is AppContainersPrivateEndpointConnectionProvisioningState other && Equals(other); + /// + public bool Equals(AppContainersPrivateEndpointConnectionProvisioningState other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/AppContainersPrivateEndpointServiceConnectionStatus.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/AppContainersPrivateEndpointServiceConnectionStatus.cs new file mode 100644 index 000000000000..b6e6dab6343e --- /dev/null +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/AppContainersPrivateEndpointServiceConnectionStatus.cs @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.AppContainers.Models +{ + /// The private endpoint connection status. + public readonly partial struct AppContainersPrivateEndpointServiceConnectionStatus : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public AppContainersPrivateEndpointServiceConnectionStatus(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string PendingValue = "Pending"; + private const string ApprovedValue = "Approved"; + private const string RejectedValue = "Rejected"; + private const string DisconnectedValue = "Disconnected"; + + /// Pending. + public static AppContainersPrivateEndpointServiceConnectionStatus Pending { get; } = new AppContainersPrivateEndpointServiceConnectionStatus(PendingValue); + /// Approved. + public static AppContainersPrivateEndpointServiceConnectionStatus Approved { get; } = new AppContainersPrivateEndpointServiceConnectionStatus(ApprovedValue); + /// Rejected. + public static AppContainersPrivateEndpointServiceConnectionStatus Rejected { get; } = new AppContainersPrivateEndpointServiceConnectionStatus(RejectedValue); + /// Disconnected. + public static AppContainersPrivateEndpointServiceConnectionStatus Disconnected { get; } = new AppContainersPrivateEndpointServiceConnectionStatus(DisconnectedValue); + /// Determines if two values are the same. + public static bool operator ==(AppContainersPrivateEndpointServiceConnectionStatus left, AppContainersPrivateEndpointServiceConnectionStatus right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(AppContainersPrivateEndpointServiceConnectionStatus left, AppContainersPrivateEndpointServiceConnectionStatus right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator AppContainersPrivateEndpointServiceConnectionStatus(string value) => new AppContainersPrivateEndpointServiceConnectionStatus(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is AppContainersPrivateEndpointServiceConnectionStatus other && Equals(other); + /// + public bool Equals(AppContainersPrivateEndpointServiceConnectionStatus other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/AppContainersPrivateLinkResource.Serialization.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/AppContainersPrivateLinkResource.Serialization.cs new file mode 100644 index 000000000000..e5a0b155825e --- /dev/null +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/AppContainersPrivateLinkResource.Serialization.cs @@ -0,0 +1,387 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Text.Json; +using Azure.Core; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.AppContainers.Models +{ + public partial class AppContainersPrivateLinkResource : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AppContainersPrivateLinkResource)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + writer.WritePropertyName("properties"u8); + writer.WriteStartObject(); + if (options.Format != "W" && Optional.IsDefined(GroupId)) + { + writer.WritePropertyName("groupId"u8); + writer.WriteStringValue(GroupId); + } + if (options.Format != "W" && Optional.IsCollectionDefined(RequiredMembers)) + { + writer.WritePropertyName("requiredMembers"u8); + writer.WriteStartArray(); + foreach (var item in RequiredMembers) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(RequiredZoneNames)) + { + writer.WritePropertyName("requiredZoneNames"u8); + writer.WriteStartArray(); + foreach (var item in RequiredZoneNames) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + writer.WriteEndObject(); + } + + AppContainersPrivateLinkResource IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AppContainersPrivateLinkResource)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAppContainersPrivateLinkResource(document.RootElement, options); + } + + internal static AppContainersPrivateLinkResource DeserializeAppContainersPrivateLinkResource(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ResourceIdentifier id = default; + string name = default; + ResourceType type = default; + SystemData systemData = default; + string groupId = default; + IReadOnlyList requiredMembers = default; + IList requiredZoneNames = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + 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.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + systemData = JsonSerializer.Deserialize(property.Value.GetRawText()); + continue; + } + if (property.NameEquals("properties"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + foreach (var property0 in property.Value.EnumerateObject()) + { + if (property0.NameEquals("groupId"u8)) + { + groupId = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("requiredMembers"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property0.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + requiredMembers = array; + continue; + } + if (property0.NameEquals("requiredZoneNames"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property0.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + requiredZoneNames = array; + continue; + } + } + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new AppContainersPrivateLinkResource( + id, + name, + type, + systemData, + groupId, + requiredMembers ?? new ChangeTrackingList(), + requiredZoneNames ?? new ChangeTrackingList(), + serializedAdditionalRawData); + } + + private BinaryData SerializeBicep(ModelReaderWriterOptions options) + { + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Name), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" name: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Name)) + { + builder.Append(" name: "); + if (Name.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{Name}'''"); + } + else + { + builder.AppendLine($"'{Name}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Id), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" id: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Id)) + { + builder.Append(" id: "); + builder.AppendLine($"'{Id.ToString()}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(SystemData), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" systemData: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(SystemData)) + { + builder.Append(" systemData: "); + builder.AppendLine($"'{SystemData.ToString()}'"); + } + } + + builder.Append(" properties:"); + builder.AppendLine(" {"); + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(GroupId), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" groupId: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(GroupId)) + { + builder.Append(" groupId: "); + if (GroupId.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{GroupId}'''"); + } + else + { + builder.AppendLine($"'{GroupId}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(RequiredMembers), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" requiredMembers: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsCollectionDefined(RequiredMembers)) + { + if (RequiredMembers.Any()) + { + builder.Append(" requiredMembers: "); + builder.AppendLine("["); + foreach (var item in RequiredMembers) + { + if (item == null) + { + builder.Append("null"); + continue; + } + if (item.Contains(Environment.NewLine)) + { + builder.AppendLine(" '''"); + builder.AppendLine($"{item}'''"); + } + else + { + builder.AppendLine($" '{item}'"); + } + } + builder.AppendLine(" ]"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(RequiredZoneNames), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" requiredZoneNames: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsCollectionDefined(RequiredZoneNames)) + { + if (RequiredZoneNames.Any()) + { + builder.Append(" requiredZoneNames: "); + builder.AppendLine("["); + foreach (var item in RequiredZoneNames) + { + if (item == null) + { + builder.Append("null"); + continue; + } + if (item.Contains(Environment.NewLine)) + { + builder.AppendLine(" '''"); + builder.AppendLine($"{item}'''"); + } + else + { + builder.AppendLine($" '{item}'"); + } + } + builder.AppendLine(" ]"); + } + } + } + + builder.AppendLine(" }"); + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerAppContainersContext.Default); + case "bicep": + return SerializeBicep(options); + default: + throw new FormatException($"The model {nameof(AppContainersPrivateLinkResource)} does not support writing '{options.Format}' format."); + } + } + + AppContainersPrivateLinkResource IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeAppContainersPrivateLinkResource(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(AppContainersPrivateLinkResource)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/AppContainersPrivateLinkResource.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/AppContainersPrivateLinkResource.cs new file mode 100644 index 000000000000..8f3cddf783f1 --- /dev/null +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/AppContainersPrivateLinkResource.cs @@ -0,0 +1,84 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.AppContainers.Models +{ + /// A private link resource. + public partial class AppContainersPrivateLinkResource : ResourceData + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public AppContainersPrivateLinkResource() + { + RequiredMembers = new ChangeTrackingList(); + RequiredZoneNames = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The private link resource group id. + /// The private link resource required member names. + /// The private link resource private link DNS zone name. + /// Keeps track of any properties unknown to the library. + internal AppContainersPrivateLinkResource(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, string groupId, IReadOnlyList requiredMembers, IList requiredZoneNames, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) + { + GroupId = groupId; + RequiredMembers = requiredMembers; + RequiredZoneNames = requiredZoneNames; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The private link resource group id. + [WirePath("properties.groupId")] + public string GroupId { get; } + /// The private link resource required member names. + [WirePath("properties.requiredMembers")] + public IReadOnlyList RequiredMembers { get; } + /// The private link resource private link DNS zone name. + [WirePath("properties.requiredZoneNames")] + public IList RequiredZoneNames { get; } + } +} diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/AppContainersPrivateLinkResourceListResult.Serialization.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/AppContainersPrivateLinkResourceListResult.Serialization.cs new file mode 100644 index 000000000000..9978ad5f7772 --- /dev/null +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/AppContainersPrivateLinkResourceListResult.Serialization.cs @@ -0,0 +1,215 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.AppContainers.Models +{ + internal partial class AppContainersPrivateLinkResourceListResult : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AppContainersPrivateLinkResourceListResult)} does not support writing '{format}' format."); + } + + if (Optional.IsCollectionDefined(Value)) + { + writer.WritePropertyName("value"u8); + writer.WriteStartArray(); + foreach (var item in Value) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && Optional.IsDefined(NextLink)) + { + writer.WritePropertyName("nextLink"u8); + writer.WriteStringValue(NextLink.AbsoluteUri); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + AppContainersPrivateLinkResourceListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AppContainersPrivateLinkResourceListResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAppContainersPrivateLinkResourceListResult(document.RootElement, options); + } + + internal static AppContainersPrivateLinkResourceListResult DeserializeAppContainersPrivateLinkResourceListResult(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IReadOnlyList value = default; + Uri nextLink = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(AppContainersPrivateLinkResource.DeserializeAppContainersPrivateLinkResource(item, options)); + } + value = array; + continue; + } + if (property.NameEquals("nextLink"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + nextLink = new Uri(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new AppContainersPrivateLinkResourceListResult(value ?? new ChangeTrackingList(), nextLink, serializedAdditionalRawData); + } + + private BinaryData SerializeBicep(ModelReaderWriterOptions options) + { + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Value), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" value: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsCollectionDefined(Value)) + { + if (Value.Any()) + { + builder.Append(" value: "); + builder.AppendLine("["); + foreach (var item in Value) + { + BicepSerializationHelpers.AppendChildObject(builder, item, options, 4, true, " value: "); + } + builder.AppendLine(" ]"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(NextLink), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" nextLink: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(NextLink)) + { + builder.Append(" nextLink: "); + builder.AppendLine($"'{NextLink.AbsoluteUri}'"); + } + } + + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerAppContainersContext.Default); + case "bicep": + return SerializeBicep(options); + default: + throw new FormatException($"The model {nameof(AppContainersPrivateLinkResourceListResult)} does not support writing '{options.Format}' format."); + } + } + + AppContainersPrivateLinkResourceListResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeAppContainersPrivateLinkResourceListResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(AppContainersPrivateLinkResourceListResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/AppContainersPrivateLinkResourceListResult.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/AppContainersPrivateLinkResourceListResult.cs new file mode 100644 index 000000000000..299a5c1f0aea --- /dev/null +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/AppContainersPrivateLinkResourceListResult.cs @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.AppContainers.Models +{ + /// A list of private link resources. + internal partial class AppContainersPrivateLinkResourceListResult + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + internal AppContainersPrivateLinkResourceListResult() + { + Value = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// Array of private link resources. + /// URL to get the next set of operation list results (if there are any). + /// Keeps track of any properties unknown to the library. + internal AppContainersPrivateLinkResourceListResult(IReadOnlyList value, Uri nextLink, IDictionary serializedAdditionalRawData) + { + Value = value; + NextLink = nextLink; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Array of private link resources. + public IReadOnlyList Value { get; } + /// URL to get the next set of operation list results (if there are any). + public Uri NextLink { get; } + } +} diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/AppContainersPrivateLinkServiceConnectionState.Serialization.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/AppContainersPrivateLinkServiceConnectionState.Serialization.cs new file mode 100644 index 000000000000..2fc6db139465 --- /dev/null +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/AppContainersPrivateLinkServiceConnectionState.Serialization.cs @@ -0,0 +1,234 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.AppContainers.Models +{ + public partial class AppContainersPrivateLinkServiceConnectionState : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AppContainersPrivateLinkServiceConnectionState)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(Status)) + { + writer.WritePropertyName("status"u8); + writer.WriteStringValue(Status.Value.ToString()); + } + if (Optional.IsDefined(Description)) + { + writer.WritePropertyName("description"u8); + writer.WriteStringValue(Description); + } + if (Optional.IsDefined(ActionsRequired)) + { + writer.WritePropertyName("actionsRequired"u8); + writer.WriteStringValue(ActionsRequired); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + AppContainersPrivateLinkServiceConnectionState IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AppContainersPrivateLinkServiceConnectionState)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAppContainersPrivateLinkServiceConnectionState(document.RootElement, options); + } + + internal static AppContainersPrivateLinkServiceConnectionState DeserializeAppContainersPrivateLinkServiceConnectionState(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + AppContainersPrivateEndpointServiceConnectionStatus? status = default; + string description = default; + string actionsRequired = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("status"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + status = new AppContainersPrivateEndpointServiceConnectionStatus(property.Value.GetString()); + continue; + } + if (property.NameEquals("description"u8)) + { + description = property.Value.GetString(); + continue; + } + if (property.NameEquals("actionsRequired"u8)) + { + actionsRequired = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new AppContainersPrivateLinkServiceConnectionState(status, description, actionsRequired, serializedAdditionalRawData); + } + + private BinaryData SerializeBicep(ModelReaderWriterOptions options) + { + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Status), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" status: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Status)) + { + builder.Append(" status: "); + builder.AppendLine($"'{Status.Value.ToString()}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Description), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" description: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Description)) + { + builder.Append(" description: "); + if (Description.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{Description}'''"); + } + else + { + builder.AppendLine($"'{Description}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(ActionsRequired), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" actionsRequired: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(ActionsRequired)) + { + builder.Append(" actionsRequired: "); + if (ActionsRequired.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{ActionsRequired}'''"); + } + else + { + builder.AppendLine($"'{ActionsRequired}'"); + } + } + } + + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerAppContainersContext.Default); + case "bicep": + return SerializeBicep(options); + default: + throw new FormatException($"The model {nameof(AppContainersPrivateLinkServiceConnectionState)} does not support writing '{options.Format}' format."); + } + } + + AppContainersPrivateLinkServiceConnectionState IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeAppContainersPrivateLinkServiceConnectionState(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(AppContainersPrivateLinkServiceConnectionState)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/AppContainersPrivateLinkServiceConnectionState.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/AppContainersPrivateLinkServiceConnectionState.cs new file mode 100644 index 000000000000..d209ebb905fb --- /dev/null +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/AppContainersPrivateLinkServiceConnectionState.cs @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.AppContainers.Models +{ + /// A collection of information about the state of the connection between service consumer and provider. + public partial class AppContainersPrivateLinkServiceConnectionState + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public AppContainersPrivateLinkServiceConnectionState() + { + } + + /// Initializes a new instance of . + /// Indicates whether the connection has been Approved/Rejected/Removed by the owner of the service. + /// The reason for approval/rejection of the connection. + /// A message indicating if changes on the service provider require any updates on the consumer. + /// Keeps track of any properties unknown to the library. + internal AppContainersPrivateLinkServiceConnectionState(AppContainersPrivateEndpointServiceConnectionStatus? status, string description, string actionsRequired, IDictionary serializedAdditionalRawData) + { + Status = status; + Description = description; + ActionsRequired = actionsRequired; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Indicates whether the connection has been Approved/Rejected/Removed by the owner of the service. + [WirePath("status")] + public AppContainersPrivateEndpointServiceConnectionStatus? Status { get; set; } + /// The reason for approval/rejection of the connection. + [WirePath("description")] + public string Description { get; set; } + /// A message indicating if changes on the service provider require any updates on the consumer. + [WirePath("actionsRequired")] + public string ActionsRequired { get; set; } + } +} diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/AppInsightsConfiguration.Serialization.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/AppInsightsConfiguration.Serialization.cs new file mode 100644 index 000000000000..d33c520c8917 --- /dev/null +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/AppInsightsConfiguration.Serialization.cs @@ -0,0 +1,170 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.AppContainers.Models +{ + internal partial class AppInsightsConfiguration : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AppInsightsConfiguration)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(ConnectionString)) + { + writer.WritePropertyName("connectionString"u8); + writer.WriteStringValue(ConnectionString); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + AppInsightsConfiguration IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AppInsightsConfiguration)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAppInsightsConfiguration(document.RootElement, options); + } + + internal static AppInsightsConfiguration DeserializeAppInsightsConfiguration(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string connectionString = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("connectionString"u8)) + { + connectionString = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new AppInsightsConfiguration(connectionString, serializedAdditionalRawData); + } + + private BinaryData SerializeBicep(ModelReaderWriterOptions options) + { + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(ConnectionString), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" connectionString: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(ConnectionString)) + { + builder.Append(" connectionString: "); + if (ConnectionString.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{ConnectionString}'''"); + } + else + { + builder.AppendLine($"'{ConnectionString}'"); + } + } + } + + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerAppContainersContext.Default); + case "bicep": + return SerializeBicep(options); + default: + throw new FormatException($"The model {nameof(AppInsightsConfiguration)} does not support writing '{options.Format}' format."); + } + } + + AppInsightsConfiguration IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeAppInsightsConfiguration(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(AppInsightsConfiguration)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/AppInsightsConfiguration.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/AppInsightsConfiguration.cs new file mode 100644 index 000000000000..e69d78beeaba --- /dev/null +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/AppInsightsConfiguration.cs @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.AppContainers.Models +{ + /// Configuration of Application Insights. + internal partial class AppInsightsConfiguration + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public AppInsightsConfiguration() + { + } + + /// Initializes a new instance of . + /// Application Insights connection string. + /// Keeps track of any properties unknown to the library. + internal AppInsightsConfiguration(string connectionString, IDictionary serializedAdditionalRawData) + { + ConnectionString = connectionString; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Application Insights connection string. + [WirePath("connectionString")] + public string ConnectionString { get; set; } + } +} diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/AppResiliencyCollection.Serialization.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/AppResiliencyCollection.Serialization.cs new file mode 100644 index 000000000000..593460b685cd --- /dev/null +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/AppResiliencyCollection.Serialization.cs @@ -0,0 +1,212 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.AppContainers.Models +{ + internal partial class AppResiliencyCollection : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AppResiliencyCollection)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("value"u8); + writer.WriteStartArray(); + foreach (var item in Value) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + if (options.Format != "W" && Optional.IsDefined(NextLink)) + { + writer.WritePropertyName("nextLink"u8); + writer.WriteStringValue(NextLink); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + AppResiliencyCollection IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AppResiliencyCollection)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAppResiliencyCollection(document.RootElement, options); + } + + internal static AppResiliencyCollection DeserializeAppResiliencyCollection(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IReadOnlyList value = default; + string nextLink = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(AppResiliencyData.DeserializeAppResiliencyData(item, options)); + } + value = array; + continue; + } + if (property.NameEquals("nextLink"u8)) + { + nextLink = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new AppResiliencyCollection(value, nextLink, serializedAdditionalRawData); + } + + private BinaryData SerializeBicep(ModelReaderWriterOptions options) + { + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Value), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" value: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsCollectionDefined(Value)) + { + if (Value.Any()) + { + builder.Append(" value: "); + builder.AppendLine("["); + foreach (var item in Value) + { + BicepSerializationHelpers.AppendChildObject(builder, item, options, 4, true, " value: "); + } + builder.AppendLine(" ]"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(NextLink), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" nextLink: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(NextLink)) + { + builder.Append(" nextLink: "); + if (NextLink.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{NextLink}'''"); + } + else + { + builder.AppendLine($"'{NextLink}'"); + } + } + } + + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerAppContainersContext.Default); + case "bicep": + return SerializeBicep(options); + default: + throw new FormatException($"The model {nameof(AppResiliencyCollection)} does not support writing '{options.Format}' format."); + } + } + + AppResiliencyCollection IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeAppResiliencyCollection(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(AppResiliencyCollection)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/AppResiliencyCollection.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/AppResiliencyCollection.cs new file mode 100644 index 000000000000..0578e18fac80 --- /dev/null +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/AppResiliencyCollection.cs @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.ResourceManager.AppContainers.Models +{ + /// Collection of AppResiliency policies. + internal partial class AppResiliencyCollection + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// Collection of resources. + /// is null. + internal AppResiliencyCollection(IEnumerable value) + { + Argument.AssertNotNull(value, nameof(value)); + + Value = value.ToList(); + } + + /// Initializes a new instance of . + /// Collection of resources. + /// Link to next page of resources. + /// Keeps track of any properties unknown to the library. + internal AppResiliencyCollection(IReadOnlyList value, string nextLink, IDictionary serializedAdditionalRawData) + { + Value = value; + NextLink = nextLink; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal AppResiliencyCollection() + { + } + + /// Collection of resources. + public IReadOnlyList Value { get; } + /// Link to next page of resources. + public string NextLink { get; } + } +} diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/BuildCollection.Serialization.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/BuildCollection.Serialization.cs new file mode 100644 index 000000000000..185552073936 --- /dev/null +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/BuildCollection.Serialization.cs @@ -0,0 +1,208 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.AppContainers.Models +{ + internal partial class BuildCollection : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(BuildCollection)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("value"u8); + writer.WriteStartArray(); + foreach (var item in Value) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + if (Optional.IsDefined(NextLink)) + { + writer.WritePropertyName("nextLink"u8); + writer.WriteStringValue(NextLink.AbsoluteUri); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + BuildCollection IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(BuildCollection)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeBuildCollection(document.RootElement, options); + } + + internal static BuildCollection DeserializeBuildCollection(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IReadOnlyList value = default; + Uri nextLink = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(BuildResourceData.DeserializeBuildResourceData(item, options)); + } + value = array; + continue; + } + if (property.NameEquals("nextLink"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + nextLink = new Uri(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new BuildCollection(value, nextLink, serializedAdditionalRawData); + } + + private BinaryData SerializeBicep(ModelReaderWriterOptions options) + { + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Value), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" value: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsCollectionDefined(Value)) + { + if (Value.Any()) + { + builder.Append(" value: "); + builder.AppendLine("["); + foreach (var item in Value) + { + BicepSerializationHelpers.AppendChildObject(builder, item, options, 4, true, " value: "); + } + builder.AppendLine(" ]"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(NextLink), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" nextLink: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(NextLink)) + { + builder.Append(" nextLink: "); + builder.AppendLine($"'{NextLink.AbsoluteUri}'"); + } + } + + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerAppContainersContext.Default); + case "bicep": + return SerializeBicep(options); + default: + throw new FormatException($"The model {nameof(BuildCollection)} does not support writing '{options.Format}' format."); + } + } + + BuildCollection IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeBuildCollection(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(BuildCollection)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/BlobStorageTokenStore.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/BuildCollection.cs similarity index 62% rename from sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/BlobStorageTokenStore.cs rename to sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/BuildCollection.cs index 1654328b5c56..aa854ec5f300 100644 --- a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/BlobStorageTokenStore.cs +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/BuildCollection.cs @@ -7,11 +7,12 @@ using System; using System.Collections.Generic; +using System.Linq; namespace Azure.ResourceManager.AppContainers.Models { - /// The configuration settings of the storage of the tokens if blob storage is used. - internal partial class BlobStorageTokenStore + /// The response of a BuildResource list operation. + internal partial class BuildCollection { /// /// Keeps track of any properties unknown to the library. @@ -45,32 +46,35 @@ internal partial class BlobStorageTokenStore /// private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . - /// The name of the app secrets containing the SAS URL of the blob storage containing the tokens. - /// is null. - public BlobStorageTokenStore(string sasUrlSettingName) + /// Initializes a new instance of . + /// The BuildResource items on this page. + /// is null. + internal BuildCollection(IEnumerable value) { - Argument.AssertNotNull(sasUrlSettingName, nameof(sasUrlSettingName)); + Argument.AssertNotNull(value, nameof(value)); - SasUrlSettingName = sasUrlSettingName; + Value = value.ToList(); } - /// Initializes a new instance of . - /// The name of the app secrets containing the SAS URL of the blob storage containing the tokens. + /// Initializes a new instance of . + /// The BuildResource items on this page. + /// The link to the next page of items. /// Keeps track of any properties unknown to the library. - internal BlobStorageTokenStore(string sasUrlSettingName, IDictionary serializedAdditionalRawData) + internal BuildCollection(IReadOnlyList value, Uri nextLink, IDictionary serializedAdditionalRawData) { - SasUrlSettingName = sasUrlSettingName; + Value = value; + NextLink = nextLink; _serializedAdditionalRawData = serializedAdditionalRawData; } - /// Initializes a new instance of for deserialization. - internal BlobStorageTokenStore() + /// Initializes a new instance of for deserialization. + internal BuildCollection() { } - /// The name of the app secrets containing the SAS URL of the blob storage containing the tokens. - [WirePath("sasUrlSettingName")] - public string SasUrlSettingName { get; set; } + /// The BuildResource items on this page. + public IReadOnlyList Value { get; } + /// The link to the next page of items. + public Uri NextLink { get; } } } diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/BuilderCollection.Serialization.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/BuilderCollection.Serialization.cs new file mode 100644 index 000000000000..9490a6208fd9 --- /dev/null +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/BuilderCollection.Serialization.cs @@ -0,0 +1,208 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.AppContainers.Models +{ + internal partial class BuilderCollection : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(BuilderCollection)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("value"u8); + writer.WriteStartArray(); + foreach (var item in Value) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + if (Optional.IsDefined(NextLink)) + { + writer.WritePropertyName("nextLink"u8); + writer.WriteStringValue(NextLink.AbsoluteUri); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + BuilderCollection IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(BuilderCollection)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeBuilderCollection(document.RootElement, options); + } + + internal static BuilderCollection DeserializeBuilderCollection(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IReadOnlyList value = default; + Uri nextLink = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(BuilderResourceData.DeserializeBuilderResourceData(item, options)); + } + value = array; + continue; + } + if (property.NameEquals("nextLink"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + nextLink = new Uri(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new BuilderCollection(value, nextLink, serializedAdditionalRawData); + } + + private BinaryData SerializeBicep(ModelReaderWriterOptions options) + { + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Value), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" value: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsCollectionDefined(Value)) + { + if (Value.Any()) + { + builder.Append(" value: "); + builder.AppendLine("["); + foreach (var item in Value) + { + BicepSerializationHelpers.AppendChildObject(builder, item, options, 4, true, " value: "); + } + builder.AppendLine(" ]"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(NextLink), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" nextLink: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(NextLink)) + { + builder.Append(" nextLink: "); + builder.AppendLine($"'{NextLink.AbsoluteUri}'"); + } + } + + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerAppContainersContext.Default); + case "bicep": + return SerializeBicep(options); + default: + throw new FormatException($"The model {nameof(BuilderCollection)} does not support writing '{options.Format}' format."); + } + } + + BuilderCollection IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeBuilderCollection(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(BuilderCollection)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/BuilderCollection.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/BuilderCollection.cs new file mode 100644 index 000000000000..47a971a36352 --- /dev/null +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/BuilderCollection.cs @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.ResourceManager.AppContainers.Models +{ + /// The response of a BuilderResource list operation. + internal partial class BuilderCollection + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The BuilderResource items on this page. + /// is null. + internal BuilderCollection(IEnumerable value) + { + Argument.AssertNotNull(value, nameof(value)); + + Value = value.ToList(); + } + + /// Initializes a new instance of . + /// The BuilderResource items on this page. + /// The link to the next page of items. + /// Keeps track of any properties unknown to the library. + internal BuilderCollection(IReadOnlyList value, Uri nextLink, IDictionary serializedAdditionalRawData) + { + Value = value; + NextLink = nextLink; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal BuilderCollection() + { + } + + /// The BuilderResource items on this page. + public IReadOnlyList Value { get; } + /// The link to the next page of items. + public Uri NextLink { get; } + } +} diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/BuilderResourcePatch.Serialization.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/BuilderResourcePatch.Serialization.cs new file mode 100644 index 000000000000..4fc82d98a2fc --- /dev/null +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/BuilderResourcePatch.Serialization.cs @@ -0,0 +1,192 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.AppContainers.Models +{ + public partial class BuilderResourcePatch : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(BuilderResourcePatch)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(Identity)) + { + writer.WritePropertyName("identity"u8); + var serializeOptions = new JsonSerializerOptions { Converters = { new ManagedServiceIdentityTypeV3Converter() } }; + JsonSerializer.Serialize(writer, Identity, serializeOptions); + } + 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("properties"u8); + writer.WriteStartObject(); + if (Optional.IsDefined(EnvironmentId)) + { + writer.WritePropertyName("environmentId"u8); + writer.WriteStringValue(EnvironmentId); + } + writer.WriteEndObject(); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + BuilderResourcePatch IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(BuilderResourcePatch)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeBuilderResourcePatch(document.RootElement, options); + } + + internal static BuilderResourcePatch DeserializeBuilderResourcePatch(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ManagedServiceIdentity identity = default; + IDictionary tags = default; + ResourceIdentifier environmentId = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("identity"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + var serializeOptions = new JsonSerializerOptions { Converters = { new ManagedServiceIdentityTypeV3Converter() } }; + identity = JsonSerializer.Deserialize(property.Value.GetRawText(), serializeOptions); + continue; + } + if (property.NameEquals("tags"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + Dictionary dictionary = new Dictionary(); + foreach (var property0 in property.Value.EnumerateObject()) + { + dictionary.Add(property0.Name, property0.Value.GetString()); + } + tags = dictionary; + continue; + } + if (property.NameEquals("properties"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + foreach (var property0 in property.Value.EnumerateObject()) + { + if (property0.NameEquals("environmentId"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + environmentId = new ResourceIdentifier(property0.Value.GetString()); + continue; + } + } + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new BuilderResourcePatch(identity, tags ?? new ChangeTrackingDictionary(), environmentId, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerAppContainersContext.Default); + default: + throw new FormatException($"The model {nameof(BuilderResourcePatch)} does not support writing '{options.Format}' format."); + } + } + + BuilderResourcePatch IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeBuilderResourcePatch(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(BuilderResourcePatch)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/BuilderResourcePatch.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/BuilderResourcePatch.cs new file mode 100644 index 000000000000..91e42761960a --- /dev/null +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/BuilderResourcePatch.cs @@ -0,0 +1,79 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.AppContainers.Models +{ + /// The type used for update operations of the BuilderResource. + public partial class BuilderResourcePatch + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public BuilderResourcePatch() + { + Tags = new ChangeTrackingDictionary(); + } + + /// Initializes a new instance of . + /// The managed service identities assigned to this resource. + /// Resource tags. + /// Resource ID of the container apps environment that the builder is associated with. + /// Keeps track of any properties unknown to the library. + internal BuilderResourcePatch(ManagedServiceIdentity identity, IDictionary tags, ResourceIdentifier environmentId, IDictionary serializedAdditionalRawData) + { + Identity = identity; + Tags = tags; + EnvironmentId = environmentId; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The managed service identities assigned to this resource. + [WirePath("identity")] + public ManagedServiceIdentity Identity { get; set; } + /// Resource tags. + [WirePath("tags")] + public IDictionary Tags { get; } + /// Resource ID of the container apps environment that the builder is associated with. + [WirePath("properties.environmentId")] + public ResourceIdentifier EnvironmentId { get; set; } + } +} diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/CircuitBreakerPolicy.Serialization.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/CircuitBreakerPolicy.Serialization.cs new file mode 100644 index 000000000000..b8c026d5f8ae --- /dev/null +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/CircuitBreakerPolicy.Serialization.cs @@ -0,0 +1,226 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.AppContainers.Models +{ + public partial class CircuitBreakerPolicy : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(CircuitBreakerPolicy)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(ConsecutiveErrors)) + { + writer.WritePropertyName("consecutiveErrors"u8); + writer.WriteNumberValue(ConsecutiveErrors.Value); + } + if (Optional.IsDefined(IntervalInSeconds)) + { + writer.WritePropertyName("intervalInSeconds"u8); + writer.WriteNumberValue(IntervalInSeconds.Value); + } + if (Optional.IsDefined(MaxEjectionPercent)) + { + writer.WritePropertyName("maxEjectionPercent"u8); + writer.WriteNumberValue(MaxEjectionPercent.Value); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + CircuitBreakerPolicy IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(CircuitBreakerPolicy)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeCircuitBreakerPolicy(document.RootElement, options); + } + + internal static CircuitBreakerPolicy DeserializeCircuitBreakerPolicy(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + int? consecutiveErrors = default; + int? intervalInSeconds = default; + int? maxEjectionPercent = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("consecutiveErrors"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + consecutiveErrors = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("intervalInSeconds"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + intervalInSeconds = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("maxEjectionPercent"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + maxEjectionPercent = property.Value.GetInt32(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new CircuitBreakerPolicy(consecutiveErrors, intervalInSeconds, maxEjectionPercent, serializedAdditionalRawData); + } + + private BinaryData SerializeBicep(ModelReaderWriterOptions options) + { + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(ConsecutiveErrors), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" consecutiveErrors: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(ConsecutiveErrors)) + { + builder.Append(" consecutiveErrors: "); + builder.AppendLine($"{ConsecutiveErrors.Value}"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(IntervalInSeconds), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" intervalInSeconds: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(IntervalInSeconds)) + { + builder.Append(" intervalInSeconds: "); + builder.AppendLine($"{IntervalInSeconds.Value}"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(MaxEjectionPercent), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" maxEjectionPercent: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(MaxEjectionPercent)) + { + builder.Append(" maxEjectionPercent: "); + builder.AppendLine($"{MaxEjectionPercent.Value}"); + } + } + + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerAppContainersContext.Default); + case "bicep": + return SerializeBicep(options); + default: + throw new FormatException($"The model {nameof(CircuitBreakerPolicy)} does not support writing '{options.Format}' format."); + } + } + + CircuitBreakerPolicy IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeCircuitBreakerPolicy(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(CircuitBreakerPolicy)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/CircuitBreakerPolicy.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/CircuitBreakerPolicy.cs new file mode 100644 index 000000000000..29ced0c63f1a --- /dev/null +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/CircuitBreakerPolicy.cs @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.AppContainers.Models +{ + /// Policy that defines circuit breaker conditions. + public partial class CircuitBreakerPolicy + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public CircuitBreakerPolicy() + { + } + + /// Initializes a new instance of . + /// Number of consecutive errors before the circuit breaker opens. + /// The time interval, in seconds, between endpoint checks. This can result in opening the circuit breaker if the check fails as well as closing the circuit breaker if the check succeeds. Defaults to 10s. + /// Maximum percentage of hosts that will be ejected after failure threshold has been met. + /// Keeps track of any properties unknown to the library. + internal CircuitBreakerPolicy(int? consecutiveErrors, int? intervalInSeconds, int? maxEjectionPercent, IDictionary serializedAdditionalRawData) + { + ConsecutiveErrors = consecutiveErrors; + IntervalInSeconds = intervalInSeconds; + MaxEjectionPercent = maxEjectionPercent; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Number of consecutive errors before the circuit breaker opens. + [WirePath("consecutiveErrors")] + public int? ConsecutiveErrors { get; set; } + /// The time interval, in seconds, between endpoint checks. This can result in opening the circuit breaker if the check fails as well as closing the circuit breaker if the check succeeds. Defaults to 10s. + [WirePath("intervalInSeconds")] + public int? IntervalInSeconds { get; set; } + /// Maximum percentage of hosts that will be ejected after failure threshold has been met. + [WirePath("maxEjectionPercent")] + public int? MaxEjectionPercent { get; set; } + } +} diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/ConnectedEnvironmentDaprComponentProvisioningState.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/ConnectedEnvironmentDaprComponentProvisioningState.cs new file mode 100644 index 000000000000..1181f195c6f0 --- /dev/null +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/ConnectedEnvironmentDaprComponentProvisioningState.cs @@ -0,0 +1,60 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.AppContainers.Models +{ + /// Provisioning state of the Connected Environment Dapr Component. + public readonly partial struct ConnectedEnvironmentDaprComponentProvisioningState : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public ConnectedEnvironmentDaprComponentProvisioningState(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string SucceededValue = "Succeeded"; + private const string FailedValue = "Failed"; + private const string CanceledValue = "Canceled"; + private const string InProgressValue = "InProgress"; + private const string DeletingValue = "Deleting"; + + /// Succeeded. + public static ConnectedEnvironmentDaprComponentProvisioningState Succeeded { get; } = new ConnectedEnvironmentDaprComponentProvisioningState(SucceededValue); + /// Failed. + public static ConnectedEnvironmentDaprComponentProvisioningState Failed { get; } = new ConnectedEnvironmentDaprComponentProvisioningState(FailedValue); + /// Canceled. + public static ConnectedEnvironmentDaprComponentProvisioningState Canceled { get; } = new ConnectedEnvironmentDaprComponentProvisioningState(CanceledValue); + /// InProgress. + public static ConnectedEnvironmentDaprComponentProvisioningState InProgress { get; } = new ConnectedEnvironmentDaprComponentProvisioningState(InProgressValue); + /// Deleting. + public static ConnectedEnvironmentDaprComponentProvisioningState Deleting { get; } = new ConnectedEnvironmentDaprComponentProvisioningState(DeletingValue); + /// Determines if two values are the same. + public static bool operator ==(ConnectedEnvironmentDaprComponentProvisioningState left, ConnectedEnvironmentDaprComponentProvisioningState right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(ConnectedEnvironmentDaprComponentProvisioningState left, ConnectedEnvironmentDaprComponentProvisioningState right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator ConnectedEnvironmentDaprComponentProvisioningState(string value) => new ConnectedEnvironmentDaprComponentProvisioningState(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is ConnectedEnvironmentDaprComponentProvisioningState other && Equals(other); + /// + public bool Equals(ConnectedEnvironmentDaprComponentProvisioningState other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/ConnectedEnvironmentDaprComponentsCollection.Serialization.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/ConnectedEnvironmentDaprComponentsCollection.Serialization.cs new file mode 100644 index 000000000000..e0adef5e20b4 --- /dev/null +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/ConnectedEnvironmentDaprComponentsCollection.Serialization.cs @@ -0,0 +1,212 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.AppContainers.Models +{ + internal partial class ConnectedEnvironmentDaprComponentsCollection : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ConnectedEnvironmentDaprComponentsCollection)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("value"u8); + writer.WriteStartArray(); + foreach (var item in Value) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + if (options.Format != "W" && Optional.IsDefined(NextLink)) + { + writer.WritePropertyName("nextLink"u8); + writer.WriteStringValue(NextLink); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + ConnectedEnvironmentDaprComponentsCollection IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ConnectedEnvironmentDaprComponentsCollection)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeConnectedEnvironmentDaprComponentsCollection(document.RootElement, options); + } + + internal static ConnectedEnvironmentDaprComponentsCollection DeserializeConnectedEnvironmentDaprComponentsCollection(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IReadOnlyList value = default; + string nextLink = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(ConnectedEnvironmentDaprComponentData.DeserializeConnectedEnvironmentDaprComponentData(item, options)); + } + value = array; + continue; + } + if (property.NameEquals("nextLink"u8)) + { + nextLink = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ConnectedEnvironmentDaprComponentsCollection(value, nextLink, serializedAdditionalRawData); + } + + private BinaryData SerializeBicep(ModelReaderWriterOptions options) + { + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Value), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" value: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsCollectionDefined(Value)) + { + if (Value.Any()) + { + builder.Append(" value: "); + builder.AppendLine("["); + foreach (var item in Value) + { + BicepSerializationHelpers.AppendChildObject(builder, item, options, 4, true, " value: "); + } + builder.AppendLine(" ]"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(NextLink), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" nextLink: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(NextLink)) + { + builder.Append(" nextLink: "); + if (NextLink.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{NextLink}'''"); + } + else + { + builder.AppendLine($"'{NextLink}'"); + } + } + } + + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerAppContainersContext.Default); + case "bicep": + return SerializeBicep(options); + default: + throw new FormatException($"The model {nameof(ConnectedEnvironmentDaprComponentsCollection)} does not support writing '{options.Format}' format."); + } + } + + ConnectedEnvironmentDaprComponentsCollection IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeConnectedEnvironmentDaprComponentsCollection(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ConnectedEnvironmentDaprComponentsCollection)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/ConnectedEnvironmentDaprComponentsCollection.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/ConnectedEnvironmentDaprComponentsCollection.cs new file mode 100644 index 000000000000..b066696d50e6 --- /dev/null +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/ConnectedEnvironmentDaprComponentsCollection.cs @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.ResourceManager.AppContainers.Models +{ + /// Collection of Dapr Components for Environments. + internal partial class ConnectedEnvironmentDaprComponentsCollection + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// Collection of Dapr component resources. + /// is null. + internal ConnectedEnvironmentDaprComponentsCollection(IEnumerable value) + { + Argument.AssertNotNull(value, nameof(value)); + + Value = value.ToList(); + } + + /// Initializes a new instance of . + /// Collection of Dapr component resources. + /// Link to next page of resources. + /// Keeps track of any properties unknown to the library. + internal ConnectedEnvironmentDaprComponentsCollection(IReadOnlyList value, string nextLink, IDictionary serializedAdditionalRawData) + { + Value = value; + NextLink = nextLink; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal ConnectedEnvironmentDaprComponentsCollection() + { + } + + /// Collection of Dapr component resources. + public IReadOnlyList Value { get; } + /// Link to next page of resources. + public string NextLink { get; } + } +} diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/ConnectedEnvironmentStorageProperties.Serialization.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/ConnectedEnvironmentStorageProperties.Serialization.cs index 03c8c7111807..399f9bd9fbf5 100644 --- a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/ConnectedEnvironmentStorageProperties.Serialization.cs +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/ConnectedEnvironmentStorageProperties.Serialization.cs @@ -14,7 +14,7 @@ namespace Azure.ResourceManager.AppContainers.Models { - internal partial class ConnectedEnvironmentStorageProperties : IUtf8JsonSerializable, IJsonModel + public partial class ConnectedEnvironmentStorageProperties : IUtf8JsonSerializable, IJsonModel { void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); @@ -35,11 +35,26 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit throw new FormatException($"The model {nameof(ConnectedEnvironmentStorageProperties)} does not support writing '{format}' format."); } + if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) + { + writer.WritePropertyName("provisioningState"u8); + writer.WriteStringValue(ProvisioningState.Value.ToString()); + } + if (options.Format != "W" && Optional.IsDefined(DeploymentErrors)) + { + writer.WritePropertyName("deploymentErrors"u8); + writer.WriteStringValue(DeploymentErrors); + } if (Optional.IsDefined(AzureFile)) { writer.WritePropertyName("azureFile"u8); writer.WriteObjectValue(AzureFile, options); } + if (Optional.IsDefined(Smb)) + { + writer.WritePropertyName("smb"u8); + writer.WriteObjectValue(Smb, options); + } if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) @@ -77,11 +92,28 @@ internal static ConnectedEnvironmentStorageProperties DeserializeConnectedEnviro { return null; } + ConnectedEnvironmentStorageProvisioningState? provisioningState = default; + string deploymentErrors = default; ContainerAppAzureFileProperties azureFile = default; + SmbStorage smb = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { + if (property.NameEquals("provisioningState"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + provisioningState = new ConnectedEnvironmentStorageProvisioningState(property.Value.GetString()); + continue; + } + if (property.NameEquals("deploymentErrors"u8)) + { + deploymentErrors = property.Value.GetString(); + continue; + } if (property.NameEquals("azureFile"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -91,13 +123,22 @@ internal static ConnectedEnvironmentStorageProperties DeserializeConnectedEnviro azureFile = ContainerAppAzureFileProperties.DeserializeContainerAppAzureFileProperties(property.Value, options); continue; } + if (property.NameEquals("smb"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + smb = SmbStorage.DeserializeSmbStorage(property.Value, options); + continue; + } if (options.Format != "W") { rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); } } serializedAdditionalRawData = rawDataDictionary; - return new ConnectedEnvironmentStorageProperties(azureFile, serializedAdditionalRawData); + return new ConnectedEnvironmentStorageProperties(provisioningState, deploymentErrors, azureFile, smb, serializedAdditionalRawData); } private BinaryData SerializeBicep(ModelReaderWriterOptions options) @@ -111,6 +152,44 @@ private BinaryData SerializeBicep(ModelReaderWriterOptions options) builder.AppendLine("{"); + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(ProvisioningState), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" provisioningState: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(ProvisioningState)) + { + builder.Append(" provisioningState: "); + builder.AppendLine($"'{ProvisioningState.Value.ToString()}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(DeploymentErrors), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" deploymentErrors: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(DeploymentErrors)) + { + builder.Append(" deploymentErrors: "); + if (DeploymentErrors.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{DeploymentErrors}'''"); + } + else + { + builder.AppendLine($"'{DeploymentErrors}'"); + } + } + } + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(AzureFile), out propertyOverride); if (hasPropertyOverride) { @@ -126,6 +205,21 @@ private BinaryData SerializeBicep(ModelReaderWriterOptions options) } } + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Smb), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" smb: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Smb)) + { + builder.Append(" smb: "); + BicepSerializationHelpers.AppendChildObject(builder, Smb, options, 2, false, " smb: "); + } + } + builder.AppendLine("}"); return BinaryData.FromString(builder.ToString()); } diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/ConnectedEnvironmentStorageProperties.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/ConnectedEnvironmentStorageProperties.cs index ea2e28b5d74c..40ed996ec8db 100644 --- a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/ConnectedEnvironmentStorageProperties.cs +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/ConnectedEnvironmentStorageProperties.cs @@ -11,7 +11,7 @@ namespace Azure.ResourceManager.AppContainers.Models { /// Storage properties. - internal partial class ConnectedEnvironmentStorageProperties + public partial class ConnectedEnvironmentStorageProperties { /// /// Keeps track of any properties unknown to the library. @@ -51,16 +51,31 @@ public ConnectedEnvironmentStorageProperties() } /// Initializes a new instance of . + /// Provisioning state of the storage. + /// Any errors that occurred during deployment or deployment validation. /// Azure file properties. + /// SMB storage properties. /// Keeps track of any properties unknown to the library. - internal ConnectedEnvironmentStorageProperties(ContainerAppAzureFileProperties azureFile, IDictionary serializedAdditionalRawData) + internal ConnectedEnvironmentStorageProperties(ConnectedEnvironmentStorageProvisioningState? provisioningState, string deploymentErrors, ContainerAppAzureFileProperties azureFile, SmbStorage smb, IDictionary serializedAdditionalRawData) { + ProvisioningState = provisioningState; + DeploymentErrors = deploymentErrors; AzureFile = azureFile; + Smb = smb; _serializedAdditionalRawData = serializedAdditionalRawData; } + /// Provisioning state of the storage. + [WirePath("provisioningState")] + public ConnectedEnvironmentStorageProvisioningState? ProvisioningState { get; } + /// Any errors that occurred during deployment or deployment validation. + [WirePath("deploymentErrors")] + public string DeploymentErrors { get; } /// Azure file properties. [WirePath("azureFile")] public ContainerAppAzureFileProperties AzureFile { get; set; } + /// SMB storage properties. + [WirePath("smb")] + public SmbStorage Smb { get; set; } } } diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/ConnectedEnvironmentStorageProvisioningState.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/ConnectedEnvironmentStorageProvisioningState.cs new file mode 100644 index 000000000000..b0824f613246 --- /dev/null +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/ConnectedEnvironmentStorageProvisioningState.cs @@ -0,0 +1,60 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.AppContainers.Models +{ + /// Provisioning state of the storage. + public readonly partial struct ConnectedEnvironmentStorageProvisioningState : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public ConnectedEnvironmentStorageProvisioningState(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string SucceededValue = "Succeeded"; + private const string FailedValue = "Failed"; + private const string CanceledValue = "Canceled"; + private const string InProgressValue = "InProgress"; + private const string DeletingValue = "Deleting"; + + /// Succeeded. + public static ConnectedEnvironmentStorageProvisioningState Succeeded { get; } = new ConnectedEnvironmentStorageProvisioningState(SucceededValue); + /// Failed. + public static ConnectedEnvironmentStorageProvisioningState Failed { get; } = new ConnectedEnvironmentStorageProvisioningState(FailedValue); + /// Canceled. + public static ConnectedEnvironmentStorageProvisioningState Canceled { get; } = new ConnectedEnvironmentStorageProvisioningState(CanceledValue); + /// InProgress. + public static ConnectedEnvironmentStorageProvisioningState InProgress { get; } = new ConnectedEnvironmentStorageProvisioningState(InProgressValue); + /// Deleting. + public static ConnectedEnvironmentStorageProvisioningState Deleting { get; } = new ConnectedEnvironmentStorageProvisioningState(DeletingValue); + /// Determines if two values are the same. + public static bool operator ==(ConnectedEnvironmentStorageProvisioningState left, ConnectedEnvironmentStorageProvisioningState right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(ConnectedEnvironmentStorageProvisioningState left, ConnectedEnvironmentStorageProvisioningState right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator ConnectedEnvironmentStorageProvisioningState(string value) => new ConnectedEnvironmentStorageProvisioningState(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is ConnectedEnvironmentStorageProvisioningState other && Equals(other); + /// + public bool Equals(ConnectedEnvironmentStorageProvisioningState other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/ContainerAppActiveRevisionsMode.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/ContainerAppActiveRevisionsMode.cs index ee72bd48c807..7357a051a451 100644 --- a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/ContainerAppActiveRevisionsMode.cs +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/ContainerAppActiveRevisionsMode.cs @@ -12,7 +12,7 @@ namespace Azure.ResourceManager.AppContainers.Models { /// /// ActiveRevisionsMode controls how active revisions are handled for the Container app: - /// <list><item>Multiple: multiple revisions can be active.</item><item>Single: Only one revision can be active at a time. Revision weights can not be used in this mode. If no value if provided, this is the default.</item></list> + /// <list><item>Single: Only one revision can be active at a time. Traffic weights cannot be used. This is the default.</item><item>Multiple: Multiple revisions can be active, including optional traffic weights and labels.</item><item>Labels: Only revisions with labels are active. Traffic weights can be applied to labels.</item></list> /// public readonly partial struct ContainerAppActiveRevisionsMode : IEquatable { @@ -27,11 +27,14 @@ public ContainerAppActiveRevisionsMode(string value) private const string MultipleValue = "Multiple"; private const string SingleValue = "Single"; + private const string LabelsValue = "Labels"; /// Multiple. public static ContainerAppActiveRevisionsMode Multiple { get; } = new ContainerAppActiveRevisionsMode(MultipleValue); /// Single. public static ContainerAppActiveRevisionsMode Single { get; } = new ContainerAppActiveRevisionsMode(SingleValue); + /// Labels. + public static ContainerAppActiveRevisionsMode Labels { get; } = new ContainerAppActiveRevisionsMode(LabelsValue); /// Determines if two values are the same. public static bool operator ==(ContainerAppActiveRevisionsMode left, ContainerAppActiveRevisionsMode right) => left.Equals(right); /// Determines if two values are not the same. diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/ContainerAppAzureFileProperties.Serialization.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/ContainerAppAzureFileProperties.Serialization.cs index 5af41275d458..730a16eabc83 100644 --- a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/ContainerAppAzureFileProperties.Serialization.cs +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/ContainerAppAzureFileProperties.Serialization.cs @@ -45,6 +45,11 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WritePropertyName("accountKey"u8); writer.WriteStringValue(AccountKey); } + if (Optional.IsDefined(AccountKeyVaultProperties)) + { + writer.WritePropertyName("accountKeyVaultProperties"u8); + writer.WriteObjectValue(AccountKeyVaultProperties, options); + } if (Optional.IsDefined(AccessMode)) { writer.WritePropertyName("accessMode"u8); @@ -94,6 +99,7 @@ internal static ContainerAppAzureFileProperties DeserializeContainerAppAzureFile } string accountName = default; string accountKey = default; + SecretKeyVaultProperties accountKeyVaultProperties = default; ContainerAppAccessMode? accessMode = default; string shareName = default; IDictionary serializedAdditionalRawData = default; @@ -110,6 +116,15 @@ internal static ContainerAppAzureFileProperties DeserializeContainerAppAzureFile accountKey = property.Value.GetString(); continue; } + if (property.NameEquals("accountKeyVaultProperties"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + accountKeyVaultProperties = SecretKeyVaultProperties.DeserializeSecretKeyVaultProperties(property.Value, options); + continue; + } if (property.NameEquals("accessMode"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -130,7 +145,13 @@ internal static ContainerAppAzureFileProperties DeserializeContainerAppAzureFile } } serializedAdditionalRawData = rawDataDictionary; - return new ContainerAppAzureFileProperties(accountName, accountKey, accessMode, shareName, serializedAdditionalRawData); + return new ContainerAppAzureFileProperties( + accountName, + accountKey, + accountKeyVaultProperties, + accessMode, + shareName, + serializedAdditionalRawData); } private BinaryData SerializeBicep(ModelReaderWriterOptions options) @@ -190,6 +211,21 @@ private BinaryData SerializeBicep(ModelReaderWriterOptions options) } } + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(AccountKeyVaultProperties), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" accountKeyVaultProperties: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(AccountKeyVaultProperties)) + { + builder.Append(" accountKeyVaultProperties: "); + BicepSerializationHelpers.AppendChildObject(builder, AccountKeyVaultProperties, options, 2, false, " accountKeyVaultProperties: "); + } + } + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(AccessMode), out propertyOverride); if (hasPropertyOverride) { diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/ContainerAppAzureFileProperties.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/ContainerAppAzureFileProperties.cs index 09d51e992470..16d1e3cf6fb9 100644 --- a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/ContainerAppAzureFileProperties.cs +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/ContainerAppAzureFileProperties.cs @@ -53,13 +53,15 @@ public ContainerAppAzureFileProperties() /// Initializes a new instance of . /// Storage account name for azure file. /// Storage account key for azure file. + /// Storage account key stored as an Azure Key Vault secret. /// Access mode for storage. /// Azure file share name. /// Keeps track of any properties unknown to the library. - internal ContainerAppAzureFileProperties(string accountName, string accountKey, ContainerAppAccessMode? accessMode, string shareName, IDictionary serializedAdditionalRawData) + internal ContainerAppAzureFileProperties(string accountName, string accountKey, SecretKeyVaultProperties accountKeyVaultProperties, ContainerAppAccessMode? accessMode, string shareName, IDictionary serializedAdditionalRawData) { AccountName = accountName; AccountKey = accountKey; + AccountKeyVaultProperties = accountKeyVaultProperties; AccessMode = accessMode; ShareName = shareName; _serializedAdditionalRawData = serializedAdditionalRawData; @@ -71,6 +73,9 @@ internal ContainerAppAzureFileProperties(string accountName, string accountKey, /// Storage account key for azure file. [WirePath("accountKey")] public string AccountKey { get; set; } + /// Storage account key stored as an Azure Key Vault secret. + [WirePath("accountKeyVaultProperties")] + public SecretKeyVaultProperties AccountKeyVaultProperties { get; set; } /// Access mode for storage. [WirePath("accessMode")] public ContainerAppAccessMode? AccessMode { get; set; } diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/ContainerAppBaseContainer.Serialization.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/ContainerAppBaseContainer.Serialization.cs index a854b4fc81bb..f02541bdab4d 100644 --- a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/ContainerAppBaseContainer.Serialization.cs +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/ContainerAppBaseContainer.Serialization.cs @@ -41,6 +41,11 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WritePropertyName("image"u8); writer.WriteStringValue(Image); } + if (Optional.IsDefined(ImageType)) + { + writer.WritePropertyName("imageType"u8); + writer.WriteStringValue(ImageType.Value.ToString()); + } if (Optional.IsDefined(Name)) { writer.WritePropertyName("name"u8); @@ -129,6 +134,7 @@ internal static ContainerAppBaseContainer DeserializeContainerAppBaseContainer(J return null; } string image = default; + ImageType? imageType = default; string name = default; IList command = default; IList args = default; @@ -144,6 +150,15 @@ internal static ContainerAppBaseContainer DeserializeContainerAppBaseContainer(J image = property.Value.GetString(); continue; } + if (property.NameEquals("imageType"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + imageType = new ImageType(property.Value.GetString()); + continue; + } if (property.NameEquals("name"u8)) { name = property.Value.GetString(); @@ -222,6 +237,7 @@ internal static ContainerAppBaseContainer DeserializeContainerAppBaseContainer(J serializedAdditionalRawData = rawDataDictionary; return new ContainerAppBaseContainer( image, + imageType, name, command ?? new ChangeTrackingList(), args ?? new ChangeTrackingList(), @@ -265,6 +281,21 @@ private BinaryData SerializeBicep(ModelReaderWriterOptions options) } } + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(ImageType), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" imageType: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(ImageType)) + { + builder.Append(" imageType: "); + builder.AppendLine($"'{ImageType.Value.ToString()}'"); + } + } + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Name), out propertyOverride); if (hasPropertyOverride) { diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/ContainerAppBaseContainer.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/ContainerAppBaseContainer.cs index 5b9c048fdc02..8ae5568e2c3d 100644 --- a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/ContainerAppBaseContainer.cs +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/ContainerAppBaseContainer.cs @@ -56,6 +56,7 @@ public ContainerAppBaseContainer() /// Initializes a new instance of . /// Container image tag. + /// The type of the image. Set to CloudBuild to let the system manages the image, where user will not be able to update image through image field. Set to ContainerImage for user provided image. /// Custom container name. /// Container start command. /// Container start command arguments. @@ -63,9 +64,10 @@ public ContainerAppBaseContainer() /// Container resource requirements. /// Container volume mounts. /// Keeps track of any properties unknown to the library. - internal ContainerAppBaseContainer(string image, string name, IList command, IList args, IList env, AppContainerResources resources, IList volumeMounts, IDictionary serializedAdditionalRawData) + internal ContainerAppBaseContainer(string image, ImageType? imageType, string name, IList command, IList args, IList env, AppContainerResources resources, IList volumeMounts, IDictionary serializedAdditionalRawData) { Image = image; + ImageType = imageType; Name = name; Command = command; Args = args; @@ -78,6 +80,9 @@ internal ContainerAppBaseContainer(string image, string name, IList comm /// Container image tag. [WirePath("image")] public string Image { get; set; } + /// The type of the image. Set to CloudBuild to let the system manages the image, where user will not be able to update image through image field. Set to ContainerImage for user provided image. + [WirePath("imageType")] + public ImageType? ImageType { get; set; } /// Custom container name. [WirePath("name")] public string Name { get; set; } diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/ContainerAppBillingMeter.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/ContainerAppBillingMeter.cs index fb1cafe2405a..bef8308390e9 100644 --- a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/ContainerAppBillingMeter.cs +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/ContainerAppBillingMeter.cs @@ -48,7 +48,7 @@ public partial class ContainerAppBillingMeter : ResourceData private IDictionary _serializedAdditionalRawData; /// Initializes a new instance of . - public ContainerAppBillingMeter() + internal ContainerAppBillingMeter() { } @@ -69,9 +69,9 @@ internal ContainerAppBillingMeter(ResourceIdentifier id, string name, ResourceTy /// Region for the billing meter. [WirePath("location")] - public AzureLocation? Location { get; set; } + public AzureLocation? Location { get; } /// Revision resource specific properties. [WirePath("properties")] - public ContainerAppBillingMeterProperties Properties { get; set; } + public ContainerAppBillingMeterProperties Properties { get; } } } diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/ContainerAppBillingMeterProperties.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/ContainerAppBillingMeterProperties.cs index 9c184abe179a..3a80c643b4bd 100644 --- a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/ContainerAppBillingMeterProperties.cs +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/ContainerAppBillingMeterProperties.cs @@ -46,7 +46,7 @@ public partial class ContainerAppBillingMeterProperties private IDictionary _serializedAdditionalRawData; /// Initializes a new instance of . - public ContainerAppBillingMeterProperties() + internal ContainerAppBillingMeterProperties() { } @@ -65,12 +65,12 @@ internal ContainerAppBillingMeterProperties(string workloadProfileCategory, stri /// Used to categorize billing meters. [WirePath("category")] - public string WorkloadProfileCategory { get; set; } + public string WorkloadProfileCategory { get; } /// Billing meter type. [WirePath("meterType")] - public string MeterType { get; set; } + public string MeterType { get; } /// The everyday name of the billing meter. [WirePath("displayName")] - public string DisplayName { get; set; } + public string DisplayName { get; } } } diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/ContainerAppBlobStorageTokenStore.Serialization.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/ContainerAppBlobStorageTokenStore.Serialization.cs new file mode 100644 index 000000000000..88b392e96776 --- /dev/null +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/ContainerAppBlobStorageTokenStore.Serialization.cs @@ -0,0 +1,268 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.AppContainers.Models +{ + public partial class ContainerAppBlobStorageTokenStore : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ContainerAppBlobStorageTokenStore)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(SasUrlSettingName)) + { + writer.WritePropertyName("sasUrlSettingName"u8); + writer.WriteStringValue(SasUrlSettingName); + } + if (Optional.IsDefined(BlobContainerUri)) + { + writer.WritePropertyName("blobContainerUri"u8); + writer.WriteStringValue(BlobContainerUri.AbsoluteUri); + } + if (Optional.IsDefined(ClientId)) + { + writer.WritePropertyName("clientId"u8); + writer.WriteStringValue(ClientId); + } + if (Optional.IsDefined(ManagedIdentityResourceId)) + { + writer.WritePropertyName("managedIdentityResourceId"u8); + writer.WriteStringValue(ManagedIdentityResourceId); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + ContainerAppBlobStorageTokenStore IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ContainerAppBlobStorageTokenStore)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeContainerAppBlobStorageTokenStore(document.RootElement, options); + } + + internal static ContainerAppBlobStorageTokenStore DeserializeContainerAppBlobStorageTokenStore(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string sasUrlSettingName = default; + Uri blobContainerUri = default; + string clientId = default; + string managedIdentityResourceId = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("sasUrlSettingName"u8)) + { + sasUrlSettingName = property.Value.GetString(); + continue; + } + if (property.NameEquals("blobContainerUri"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + blobContainerUri = new Uri(property.Value.GetString()); + continue; + } + if (property.NameEquals("clientId"u8)) + { + clientId = property.Value.GetString(); + continue; + } + if (property.NameEquals("managedIdentityResourceId"u8)) + { + managedIdentityResourceId = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ContainerAppBlobStorageTokenStore(sasUrlSettingName, blobContainerUri, clientId, managedIdentityResourceId, serializedAdditionalRawData); + } + + private BinaryData SerializeBicep(ModelReaderWriterOptions options) + { + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(SasUrlSettingName), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" sasUrlSettingName: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(SasUrlSettingName)) + { + builder.Append(" sasUrlSettingName: "); + if (SasUrlSettingName.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{SasUrlSettingName}'''"); + } + else + { + builder.AppendLine($"'{SasUrlSettingName}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(BlobContainerUri), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" blobContainerUri: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(BlobContainerUri)) + { + builder.Append(" blobContainerUri: "); + builder.AppendLine($"'{BlobContainerUri.AbsoluteUri}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(ClientId), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" clientId: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(ClientId)) + { + builder.Append(" clientId: "); + if (ClientId.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{ClientId}'''"); + } + else + { + builder.AppendLine($"'{ClientId}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(ManagedIdentityResourceId), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" managedIdentityResourceId: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(ManagedIdentityResourceId)) + { + builder.Append(" managedIdentityResourceId: "); + if (ManagedIdentityResourceId.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{ManagedIdentityResourceId}'''"); + } + else + { + builder.AppendLine($"'{ManagedIdentityResourceId}'"); + } + } + } + + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerAppContainersContext.Default); + case "bicep": + return SerializeBicep(options); + default: + throw new FormatException($"The model {nameof(ContainerAppBlobStorageTokenStore)} does not support writing '{options.Format}' format."); + } + } + + ContainerAppBlobStorageTokenStore IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeContainerAppBlobStorageTokenStore(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ContainerAppBlobStorageTokenStore)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/ContainerAppBlobStorageTokenStore.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/ContainerAppBlobStorageTokenStore.cs new file mode 100644 index 000000000000..2cc44875ca9f --- /dev/null +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/ContainerAppBlobStorageTokenStore.cs @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.AppContainers.Models +{ + /// The configuration settings of the storage of the tokens if blob storage is used. + public partial class ContainerAppBlobStorageTokenStore + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public ContainerAppBlobStorageTokenStore() + { + } + + /// Initializes a new instance of . + /// The name of the app secrets containing the SAS URL of the blob storage containing the tokens. Should not be used along with blobContainerUri. + /// The URI of the blob storage containing the tokens. Should not be used along with sasUrlSettingName. + /// The Client ID of a User-Assigned Managed Identity. Should not be used along with managedIdentityResourceId. + /// The Resource ID of a User-Assigned Managed Identity. Should not be used along with clientId. + /// Keeps track of any properties unknown to the library. + internal ContainerAppBlobStorageTokenStore(string sasUrlSettingName, Uri blobContainerUri, string clientId, string managedIdentityResourceId, IDictionary serializedAdditionalRawData) + { + SasUrlSettingName = sasUrlSettingName; + BlobContainerUri = blobContainerUri; + ClientId = clientId; + ManagedIdentityResourceId = managedIdentityResourceId; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The name of the app secrets containing the SAS URL of the blob storage containing the tokens. Should not be used along with blobContainerUri. + [WirePath("sasUrlSettingName")] + public string SasUrlSettingName { get; set; } + /// The URI of the blob storage containing the tokens. Should not be used along with sasUrlSettingName. + [WirePath("blobContainerUri")] + public Uri BlobContainerUri { get; set; } + /// The Client ID of a User-Assigned Managed Identity. Should not be used along with managedIdentityResourceId. + [WirePath("clientId")] + public string ClientId { get; set; } + /// The Resource ID of a User-Assigned Managed Identity. Should not be used along with clientId. + [WirePath("managedIdentityResourceId")] + public string ManagedIdentityResourceId { get; set; } + } +} diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/ContainerAppBuildConfiguration.Serialization.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/ContainerAppBuildConfiguration.Serialization.cs new file mode 100644 index 000000000000..a49c523da9d5 --- /dev/null +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/ContainerAppBuildConfiguration.Serialization.cs @@ -0,0 +1,341 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.AppContainers.Models +{ + public partial class ContainerAppBuildConfiguration : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ContainerAppBuildConfiguration)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(BaseOS)) + { + writer.WritePropertyName("baseOs"u8); + writer.WriteStringValue(BaseOS); + } + if (Optional.IsDefined(Platform)) + { + writer.WritePropertyName("platform"u8); + writer.WriteStringValue(Platform); + } + if (Optional.IsDefined(PlatformVersion)) + { + writer.WritePropertyName("platformVersion"u8); + writer.WriteStringValue(PlatformVersion); + } + if (Optional.IsCollectionDefined(EnvironmentVariables)) + { + writer.WritePropertyName("environmentVariables"u8); + writer.WriteStartArray(); + foreach (var item in EnvironmentVariables) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(PreBuildSteps)) + { + writer.WritePropertyName("preBuildSteps"u8); + writer.WriteStartArray(); + foreach (var item in PreBuildSteps) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + ContainerAppBuildConfiguration IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ContainerAppBuildConfiguration)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeContainerAppBuildConfiguration(document.RootElement, options); + } + + internal static ContainerAppBuildConfiguration DeserializeContainerAppBuildConfiguration(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string baseOS = default; + string platform = default; + string platformVersion = default; + IList environmentVariables = default; + IList preBuildSteps = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("baseOs"u8)) + { + baseOS = property.Value.GetString(); + continue; + } + if (property.NameEquals("platform"u8)) + { + platform = property.Value.GetString(); + continue; + } + if (property.NameEquals("platformVersion"u8)) + { + platformVersion = property.Value.GetString(); + continue; + } + if (property.NameEquals("environmentVariables"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(ContainerAppSimpleEnvironmentVariable.DeserializeContainerAppSimpleEnvironmentVariable(item, options)); + } + environmentVariables = array; + continue; + } + if (property.NameEquals("preBuildSteps"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(PreBuildStep.DeserializePreBuildStep(item, options)); + } + preBuildSteps = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ContainerAppBuildConfiguration( + baseOS, + platform, + platformVersion, + environmentVariables ?? new ChangeTrackingList(), + preBuildSteps ?? new ChangeTrackingList(), + serializedAdditionalRawData); + } + + private BinaryData SerializeBicep(ModelReaderWriterOptions options) + { + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(BaseOS), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" baseOs: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(BaseOS)) + { + builder.Append(" baseOs: "); + if (BaseOS.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{BaseOS}'''"); + } + else + { + builder.AppendLine($"'{BaseOS}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Platform), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" platform: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Platform)) + { + builder.Append(" platform: "); + if (Platform.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{Platform}'''"); + } + else + { + builder.AppendLine($"'{Platform}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(PlatformVersion), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" platformVersion: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(PlatformVersion)) + { + builder.Append(" platformVersion: "); + if (PlatformVersion.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{PlatformVersion}'''"); + } + else + { + builder.AppendLine($"'{PlatformVersion}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(EnvironmentVariables), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" environmentVariables: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsCollectionDefined(EnvironmentVariables)) + { + if (EnvironmentVariables.Any()) + { + builder.Append(" environmentVariables: "); + builder.AppendLine("["); + foreach (var item in EnvironmentVariables) + { + BicepSerializationHelpers.AppendChildObject(builder, item, options, 4, true, " environmentVariables: "); + } + builder.AppendLine(" ]"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(PreBuildSteps), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" preBuildSteps: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsCollectionDefined(PreBuildSteps)) + { + if (PreBuildSteps.Any()) + { + builder.Append(" preBuildSteps: "); + builder.AppendLine("["); + foreach (var item in PreBuildSteps) + { + BicepSerializationHelpers.AppendChildObject(builder, item, options, 4, true, " preBuildSteps: "); + } + builder.AppendLine(" ]"); + } + } + } + + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerAppContainersContext.Default); + case "bicep": + return SerializeBicep(options); + default: + throw new FormatException($"The model {nameof(ContainerAppBuildConfiguration)} does not support writing '{options.Format}' format."); + } + } + + ContainerAppBuildConfiguration IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeContainerAppBuildConfiguration(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ContainerAppBuildConfiguration)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/ContainerAppBuildConfiguration.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/ContainerAppBuildConfiguration.cs new file mode 100644 index 000000000000..adcec626674d --- /dev/null +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/ContainerAppBuildConfiguration.cs @@ -0,0 +1,88 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.AppContainers.Models +{ + /// Configuration of the build. + public partial class ContainerAppBuildConfiguration + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public ContainerAppBuildConfiguration() + { + EnvironmentVariables = new ChangeTrackingList(); + PreBuildSteps = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// Base OS used to build and run the app. + /// Platform to be used to build and run the app. + /// Platform version to be used to build and run the app. + /// List of environment variables to be passed to the build, secrets should not be used in environment variable. + /// List of steps to perform before the build. + /// Keeps track of any properties unknown to the library. + internal ContainerAppBuildConfiguration(string baseOS, string platform, string platformVersion, IList environmentVariables, IList preBuildSteps, IDictionary serializedAdditionalRawData) + { + BaseOS = baseOS; + Platform = platform; + PlatformVersion = platformVersion; + EnvironmentVariables = environmentVariables; + PreBuildSteps = preBuildSteps; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Base OS used to build and run the app. + [WirePath("baseOs")] + public string BaseOS { get; set; } + /// Platform to be used to build and run the app. + [WirePath("platform")] + public string Platform { get; set; } + /// Platform version to be used to build and run the app. + [WirePath("platformVersion")] + public string PlatformVersion { get; set; } + /// List of environment variables to be passed to the build, secrets should not be used in environment variable. + [WirePath("environmentVariables")] + public IList EnvironmentVariables { get; } + /// List of steps to perform before the build. + [WirePath("preBuildSteps")] + public IList PreBuildSteps { get; } + } +} diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/ContainerAppBuildProvisioningState.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/ContainerAppBuildProvisioningState.cs new file mode 100644 index 000000000000..4aff5328dc8b --- /dev/null +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/ContainerAppBuildProvisioningState.cs @@ -0,0 +1,63 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.AppContainers.Models +{ + /// Resource instance provisioning state. + public readonly partial struct ContainerAppBuildProvisioningState : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public ContainerAppBuildProvisioningState(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string SucceededValue = "Succeeded"; + private const string FailedValue = "Failed"; + private const string CanceledValue = "Canceled"; + private const string CreatingValue = "Creating"; + private const string UpdatingValue = "Updating"; + private const string DeletingValue = "Deleting"; + + /// Succeeded. + public static ContainerAppBuildProvisioningState Succeeded { get; } = new ContainerAppBuildProvisioningState(SucceededValue); + /// Failed. + public static ContainerAppBuildProvisioningState Failed { get; } = new ContainerAppBuildProvisioningState(FailedValue); + /// Canceled. + public static ContainerAppBuildProvisioningState Canceled { get; } = new ContainerAppBuildProvisioningState(CanceledValue); + /// Creating. + public static ContainerAppBuildProvisioningState Creating { get; } = new ContainerAppBuildProvisioningState(CreatingValue); + /// Updating. + public static ContainerAppBuildProvisioningState Updating { get; } = new ContainerAppBuildProvisioningState(UpdatingValue); + /// Deleting. + public static ContainerAppBuildProvisioningState Deleting { get; } = new ContainerAppBuildProvisioningState(DeletingValue); + /// Determines if two values are the same. + public static bool operator ==(ContainerAppBuildProvisioningState left, ContainerAppBuildProvisioningState right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(ContainerAppBuildProvisioningState left, ContainerAppBuildProvisioningState right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator ContainerAppBuildProvisioningState(string value) => new ContainerAppBuildProvisioningState(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is ContainerAppBuildProvisioningState other && Equals(other); + /// + public bool Equals(ContainerAppBuildProvisioningState other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/ContainerAppBuildStatus.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/ContainerAppBuildStatus.cs new file mode 100644 index 000000000000..513baab327b4 --- /dev/null +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/ContainerAppBuildStatus.cs @@ -0,0 +1,60 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.AppContainers.Models +{ + /// Status of the build once it has been provisioned. + public readonly partial struct ContainerAppBuildStatus : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public ContainerAppBuildStatus(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string NotStartedValue = "NotStarted"; + private const string InProgressValue = "InProgress"; + private const string SucceededValue = "Succeeded"; + private const string CanceledValue = "Canceled"; + private const string FailedValue = "Failed"; + + /// NotStarted. + public static ContainerAppBuildStatus NotStarted { get; } = new ContainerAppBuildStatus(NotStartedValue); + /// InProgress. + public static ContainerAppBuildStatus InProgress { get; } = new ContainerAppBuildStatus(InProgressValue); + /// Succeeded. + public static ContainerAppBuildStatus Succeeded { get; } = new ContainerAppBuildStatus(SucceededValue); + /// Canceled. + public static ContainerAppBuildStatus Canceled { get; } = new ContainerAppBuildStatus(CanceledValue); + /// Failed. + public static ContainerAppBuildStatus Failed { get; } = new ContainerAppBuildStatus(FailedValue); + /// Determines if two values are the same. + public static bool operator ==(ContainerAppBuildStatus left, ContainerAppBuildStatus right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(ContainerAppBuildStatus left, ContainerAppBuildStatus right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator ContainerAppBuildStatus(string value) => new ContainerAppBuildStatus(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is ContainerAppBuildStatus other && Equals(other); + /// + public bool Equals(ContainerAppBuildStatus other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/ContainerAppBuildToken.Serialization.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/ContainerAppBuildToken.Serialization.cs new file mode 100644 index 000000000000..c5900e4a0430 --- /dev/null +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/ContainerAppBuildToken.Serialization.cs @@ -0,0 +1,201 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.AppContainers.Models +{ + public partial class ContainerAppBuildToken : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ContainerAppBuildToken)} does not support writing '{format}' format."); + } + + if (options.Format != "W" && Optional.IsDefined(Token)) + { + writer.WritePropertyName("token"u8); + writer.WriteStringValue(Token); + } + if (options.Format != "W" && Optional.IsDefined(Expires)) + { + writer.WritePropertyName("expires"u8); + writer.WriteStringValue(Expires.Value, "O"); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + ContainerAppBuildToken IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ContainerAppBuildToken)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeContainerAppBuildToken(document.RootElement, options); + } + + internal static ContainerAppBuildToken DeserializeContainerAppBuildToken(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string token = default; + DateTimeOffset? expires = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("token"u8)) + { + token = property.Value.GetString(); + continue; + } + if (property.NameEquals("expires"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + expires = property.Value.GetDateTimeOffset("O"); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ContainerAppBuildToken(token, expires, serializedAdditionalRawData); + } + + private BinaryData SerializeBicep(ModelReaderWriterOptions options) + { + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Token), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" token: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Token)) + { + builder.Append(" token: "); + if (Token.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{Token}'''"); + } + else + { + builder.AppendLine($"'{Token}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Expires), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" expires: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Expires)) + { + builder.Append(" expires: "); + var formattedDateTimeString = TypeFormatters.ToString(Expires.Value, "o"); + builder.AppendLine($"'{formattedDateTimeString}'"); + } + } + + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerAppContainersContext.Default); + case "bicep": + return SerializeBicep(options); + default: + throw new FormatException($"The model {nameof(ContainerAppBuildToken)} does not support writing '{options.Format}' format."); + } + } + + ContainerAppBuildToken IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeContainerAppBuildToken(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ContainerAppBuildToken)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/ContainerAppBuildToken.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/ContainerAppBuildToken.cs new file mode 100644 index 000000000000..e5eb1ec765a4 --- /dev/null +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/ContainerAppBuildToken.cs @@ -0,0 +1,71 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.AppContainers.Models +{ + /// Build Auth Token. + public partial class ContainerAppBuildToken + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + internal ContainerAppBuildToken() + { + } + + /// Initializes a new instance of . + /// Authentication token. + /// Token expiration date. + /// Keeps track of any properties unknown to the library. + internal ContainerAppBuildToken(string token, DateTimeOffset? expires, IDictionary serializedAdditionalRawData) + { + Token = token; + Expires = expires; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Authentication token. + [WirePath("token")] + public string Token { get; } + /// Token expiration date. + [WirePath("expires")] + public DateTimeOffset? Expires { get; } + } +} diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/ContainerAppBuilderProvisioningState.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/ContainerAppBuilderProvisioningState.cs new file mode 100644 index 000000000000..58676fe6c73c --- /dev/null +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/ContainerAppBuilderProvisioningState.cs @@ -0,0 +1,63 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.AppContainers.Models +{ + /// Resource instance provisioning state. + public readonly partial struct ContainerAppBuilderProvisioningState : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public ContainerAppBuilderProvisioningState(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string SucceededValue = "Succeeded"; + private const string FailedValue = "Failed"; + private const string CanceledValue = "Canceled"; + private const string CreatingValue = "Creating"; + private const string UpdatingValue = "Updating"; + private const string DeletingValue = "Deleting"; + + /// Succeeded. + public static ContainerAppBuilderProvisioningState Succeeded { get; } = new ContainerAppBuilderProvisioningState(SucceededValue); + /// Failed. + public static ContainerAppBuilderProvisioningState Failed { get; } = new ContainerAppBuilderProvisioningState(FailedValue); + /// Canceled. + public static ContainerAppBuilderProvisioningState Canceled { get; } = new ContainerAppBuilderProvisioningState(CanceledValue); + /// Creating. + public static ContainerAppBuilderProvisioningState Creating { get; } = new ContainerAppBuilderProvisioningState(CreatingValue); + /// Updating. + public static ContainerAppBuilderProvisioningState Updating { get; } = new ContainerAppBuilderProvisioningState(UpdatingValue); + /// Deleting. + public static ContainerAppBuilderProvisioningState Deleting { get; } = new ContainerAppBuilderProvisioningState(DeletingValue); + /// Determines if two values are the same. + public static bool operator ==(ContainerAppBuilderProvisioningState left, ContainerAppBuilderProvisioningState right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(ContainerAppBuilderProvisioningState left, ContainerAppBuilderProvisioningState right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator ContainerAppBuilderProvisioningState(string value) => new ContainerAppBuilderProvisioningState(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is ContainerAppBuilderProvisioningState other && Equals(other); + /// + public bool Equals(ContainerAppBuilderProvisioningState other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/ContainerAppCertificateProperties.Serialization.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/ContainerAppCertificateProperties.Serialization.cs index e5e2bee6cfa7..f18cd63a5b92 100644 --- a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/ContainerAppCertificateProperties.Serialization.cs +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/ContainerAppCertificateProperties.Serialization.cs @@ -41,6 +41,11 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WritePropertyName("provisioningState"u8); writer.WriteStringValue(ProvisioningState.Value.ToString()); } + if (options.Format != "W" && Optional.IsDefined(DeploymentErrors)) + { + writer.WritePropertyName("deploymentErrors"u8); + writer.WriteStringValue(DeploymentErrors); + } if (Optional.IsDefined(CertificateKeyVaultProperties)) { writer.WritePropertyName("certificateKeyVaultProperties"u8); @@ -101,6 +106,11 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WritePropertyName("publicKeyHash"u8); writer.WriteStringValue(PublicKeyHash); } + if (Optional.IsDefined(CertificateType)) + { + writer.WritePropertyName("certificateType"u8); + writer.WriteStringValue(CertificateType.Value.ToString()); + } if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) @@ -139,6 +149,7 @@ internal static ContainerAppCertificateProperties DeserializeContainerAppCertifi return null; } ContainerAppCertificateProvisioningState? provisioningState = default; + string deploymentErrors = default; ContainerAppCertificateKeyVaultProperties certificateKeyVaultProperties = default; string password = default; string subjectName = default; @@ -150,6 +161,7 @@ internal static ContainerAppCertificateProperties DeserializeContainerAppCertifi string thumbprint = default; bool? valid = default; string publicKeyHash = default; + ContainerAppCertificateType? certificateType = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -163,6 +175,11 @@ internal static ContainerAppCertificateProperties DeserializeContainerAppCertifi provisioningState = new ContainerAppCertificateProvisioningState(property.Value.GetString()); continue; } + if (property.NameEquals("deploymentErrors"u8)) + { + deploymentErrors = property.Value.GetString(); + continue; + } if (property.NameEquals("certificateKeyVaultProperties"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -247,6 +264,15 @@ internal static ContainerAppCertificateProperties DeserializeContainerAppCertifi publicKeyHash = property.Value.GetString(); continue; } + if (property.NameEquals("certificateType"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + certificateType = new ContainerAppCertificateType(property.Value.GetString()); + continue; + } if (options.Format != "W") { rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); @@ -255,6 +281,7 @@ internal static ContainerAppCertificateProperties DeserializeContainerAppCertifi serializedAdditionalRawData = rawDataDictionary; return new ContainerAppCertificateProperties( provisioningState, + deploymentErrors, certificateKeyVaultProperties, password, subjectName, @@ -266,6 +293,7 @@ internal static ContainerAppCertificateProperties DeserializeContainerAppCertifi thumbprint, valid, publicKeyHash, + certificateType, serializedAdditionalRawData); } @@ -295,6 +323,29 @@ private BinaryData SerializeBicep(ModelReaderWriterOptions options) } } + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(DeploymentErrors), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" deploymentErrors: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(DeploymentErrors)) + { + builder.Append(" deploymentErrors: "); + if (DeploymentErrors.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{DeploymentErrors}'''"); + } + else + { + builder.AppendLine($"'{DeploymentErrors}'"); + } + } + } + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(CertificateKeyVaultProperties), out propertyOverride); if (hasPropertyOverride) { @@ -524,6 +575,21 @@ private BinaryData SerializeBicep(ModelReaderWriterOptions options) } } + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(CertificateType), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" certificateType: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(CertificateType)) + { + builder.Append(" certificateType: "); + builder.AppendLine($"'{CertificateType.Value.ToString()}'"); + } + } + builder.AppendLine("}"); return BinaryData.FromString(builder.ToString()); } diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/ContainerAppCertificateProperties.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/ContainerAppCertificateProperties.cs index d52056634934..7f7c8fab906b 100644 --- a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/ContainerAppCertificateProperties.cs +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/ContainerAppCertificateProperties.cs @@ -53,6 +53,7 @@ public ContainerAppCertificateProperties() /// Initializes a new instance of . /// Provisioning state of the certificate. + /// Any errors that occurred during deployment or deployment validation. /// Properties for a certificate stored in a Key Vault. /// Certificate password. /// Subject name of the certificate. @@ -64,10 +65,12 @@ public ContainerAppCertificateProperties() /// Certificate thumbprint. /// Is the certificate valid?. /// Public key hash. + /// The type of the certificate. Allowed values are `ServerSSLCertificate` and `ImagePullTrustedCA`. /// Keeps track of any properties unknown to the library. - internal ContainerAppCertificateProperties(ContainerAppCertificateProvisioningState? provisioningState, ContainerAppCertificateKeyVaultProperties certificateKeyVaultProperties, string password, string subjectName, IReadOnlyList subjectAlternativeNames, byte[] value, string issuer, DateTimeOffset? issueOn, DateTimeOffset? expireOn, string thumbprint, bool? isValid, string publicKeyHash, IDictionary serializedAdditionalRawData) + internal ContainerAppCertificateProperties(ContainerAppCertificateProvisioningState? provisioningState, string deploymentErrors, ContainerAppCertificateKeyVaultProperties certificateKeyVaultProperties, string password, string subjectName, IReadOnlyList subjectAlternativeNames, byte[] value, string issuer, DateTimeOffset? issueOn, DateTimeOffset? expireOn, string thumbprint, bool? isValid, string publicKeyHash, ContainerAppCertificateType? certificateType, IDictionary serializedAdditionalRawData) { ProvisioningState = provisioningState; + DeploymentErrors = deploymentErrors; CertificateKeyVaultProperties = certificateKeyVaultProperties; Password = password; SubjectName = subjectName; @@ -79,12 +82,16 @@ internal ContainerAppCertificateProperties(ContainerAppCertificateProvisioningSt Thumbprint = thumbprint; IsValid = isValid; PublicKeyHash = publicKeyHash; + CertificateType = certificateType; _serializedAdditionalRawData = serializedAdditionalRawData; } /// Provisioning state of the certificate. [WirePath("provisioningState")] public ContainerAppCertificateProvisioningState? ProvisioningState { get; } + /// Any errors that occurred during deployment or deployment validation. + [WirePath("deploymentErrors")] + public string DeploymentErrors { get; } /// Properties for a certificate stored in a Key Vault. [WirePath("certificateKeyVaultProperties")] public ContainerAppCertificateKeyVaultProperties CertificateKeyVaultProperties { get; set; } @@ -118,5 +125,8 @@ internal ContainerAppCertificateProperties(ContainerAppCertificateProvisioningSt /// Public key hash. [WirePath("publicKeyHash")] public string PublicKeyHash { get; } + /// The type of the certificate. Allowed values are `ServerSSLCertificate` and `ImagePullTrustedCA`. + [WirePath("certificateType")] + public ContainerAppCertificateType? CertificateType { get; set; } } } diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/ContainerAppCertificateProvisioningState.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/ContainerAppCertificateProvisioningState.cs index 3821f87a835d..766e7d7aa2a7 100644 --- a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/ContainerAppCertificateProvisioningState.cs +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/ContainerAppCertificateProvisioningState.cs @@ -27,6 +27,7 @@ public ContainerAppCertificateProvisioningState(string value) private const string CanceledValue = "Canceled"; private const string DeleteFailedValue = "DeleteFailed"; private const string PendingValue = "Pending"; + private const string DeletingValue = "Deleting"; /// Succeeded. public static ContainerAppCertificateProvisioningState Succeeded { get; } = new ContainerAppCertificateProvisioningState(SucceededValue); @@ -38,6 +39,8 @@ public ContainerAppCertificateProvisioningState(string value) public static ContainerAppCertificateProvisioningState DeleteFailed { get; } = new ContainerAppCertificateProvisioningState(DeleteFailedValue); /// Pending. public static ContainerAppCertificateProvisioningState Pending { get; } = new ContainerAppCertificateProvisioningState(PendingValue); + /// Deleting. + public static ContainerAppCertificateProvisioningState Deleting { get; } = new ContainerAppCertificateProvisioningState(DeletingValue); /// Determines if two values are the same. public static bool operator ==(ContainerAppCertificateProvisioningState left, ContainerAppCertificateProvisioningState right) => left.Equals(right); /// Determines if two values are not the same. diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/ContainerAppCertificateType.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/ContainerAppCertificateType.cs new file mode 100644 index 000000000000..2f856b523286 --- /dev/null +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/ContainerAppCertificateType.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.AppContainers.Models +{ + /// The type of the certificate. Allowed values are `ServerSSLCertificate` and `ImagePullTrustedCA`. + public readonly partial struct ContainerAppCertificateType : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public ContainerAppCertificateType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string ServerSSLCertificateValue = "ServerSSLCertificate"; + private const string ImagePullTrustedCAValue = "ImagePullTrustedCA"; + + /// ServerSSLCertificate. + public static ContainerAppCertificateType ServerSSLCertificate { get; } = new ContainerAppCertificateType(ServerSSLCertificateValue); + /// ImagePullTrustedCA. + public static ContainerAppCertificateType ImagePullTrustedCA { get; } = new ContainerAppCertificateType(ImagePullTrustedCAValue); + /// Determines if two values are the same. + public static bool operator ==(ContainerAppCertificateType left, ContainerAppCertificateType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(ContainerAppCertificateType left, ContainerAppCertificateType right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator ContainerAppCertificateType(string value) => new ContainerAppCertificateType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is ContainerAppCertificateType other && Equals(other); + /// + public bool Equals(ContainerAppCertificateType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/ContainerAppConfiguration.Serialization.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/ContainerAppConfiguration.Serialization.cs index 3b29d93db720..20c990c69dcb 100644 --- a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/ContainerAppConfiguration.Serialization.cs +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/ContainerAppConfiguration.Serialization.cs @@ -51,6 +51,11 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WritePropertyName("activeRevisionsMode"u8); writer.WriteStringValue(ActiveRevisionsMode.Value.ToString()); } + if (Optional.IsDefined(TargetLabel)) + { + writer.WritePropertyName("targetLabel"u8); + writer.WriteStringValue(TargetLabel); + } if (Optional.IsDefined(Ingress)) { writer.WritePropertyName("ingress"u8); @@ -81,6 +86,11 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WritePropertyName("maxInactiveRevisions"u8); writer.WriteNumberValue(MaxInactiveRevisions.Value); } + if (Optional.IsDefined(RevisionTransitionThreshold)) + { + writer.WritePropertyName("revisionTransitionThreshold"u8); + writer.WriteNumberValue(RevisionTransitionThreshold.Value); + } if (Optional.IsDefined(Service)) { writer.WritePropertyName("service"u8); @@ -135,11 +145,13 @@ internal static ContainerAppConfiguration DeserializeContainerAppConfiguration(J } IList secrets = default; ContainerAppActiveRevisionsMode? activeRevisionsMode = default; + string targetLabel = default; ContainerAppIngressConfiguration ingress = default; IList registries = default; ContainerAppDaprConfiguration dapr = default; - Runtime runtime = default; + ContainerAppRuntime runtime = default; int? maxInactiveRevisions = default; + int? revisionTransitionThreshold = default; Service service = default; IList identitySettings = default; IDictionary serializedAdditionalRawData = default; @@ -169,6 +181,11 @@ internal static ContainerAppConfiguration DeserializeContainerAppConfiguration(J activeRevisionsMode = new ContainerAppActiveRevisionsMode(property.Value.GetString()); continue; } + if (property.NameEquals("targetLabel"u8)) + { + targetLabel = property.Value.GetString(); + continue; + } if (property.NameEquals("ingress"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -207,7 +224,7 @@ internal static ContainerAppConfiguration DeserializeContainerAppConfiguration(J { continue; } - runtime = Runtime.DeserializeRuntime(property.Value, options); + runtime = ContainerAppRuntime.DeserializeContainerAppRuntime(property.Value, options); continue; } if (property.NameEquals("maxInactiveRevisions"u8)) @@ -219,6 +236,15 @@ internal static ContainerAppConfiguration DeserializeContainerAppConfiguration(J maxInactiveRevisions = property.Value.GetInt32(); continue; } + if (property.NameEquals("revisionTransitionThreshold"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + revisionTransitionThreshold = property.Value.GetInt32(); + continue; + } if (property.NameEquals("service"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -251,11 +277,13 @@ internal static ContainerAppConfiguration DeserializeContainerAppConfiguration(J return new ContainerAppConfiguration( secrets ?? new ChangeTrackingList(), activeRevisionsMode, + targetLabel, ingress, registries ?? new ChangeTrackingList(), dapr, runtime, maxInactiveRevisions, + revisionTransitionThreshold, service, identitySettings ?? new ChangeTrackingList(), serializedAdditionalRawData); @@ -310,6 +338,29 @@ private BinaryData SerializeBicep(ModelReaderWriterOptions options) } } + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(TargetLabel), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" targetLabel: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(TargetLabel)) + { + builder.Append(" targetLabel: "); + if (TargetLabel.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{TargetLabel}'''"); + } + else + { + builder.AppendLine($"'{TargetLabel}'"); + } + } + } + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Ingress), out propertyOverride); if (hasPropertyOverride) { @@ -363,16 +414,11 @@ private BinaryData SerializeBicep(ModelReaderWriterOptions options) } } - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue("EnableMetrics", out propertyOverride); + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Runtime), out propertyOverride); if (hasPropertyOverride) { builder.Append(" runtime: "); - builder.AppendLine("{"); - builder.AppendLine(" java: {"); - builder.Append(" enableMetrics: "); builder.AppendLine(propertyOverride); - builder.AppendLine(" }"); - builder.AppendLine(" }"); } else { @@ -398,6 +444,21 @@ private BinaryData SerializeBicep(ModelReaderWriterOptions options) } } + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(RevisionTransitionThreshold), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" revisionTransitionThreshold: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(RevisionTransitionThreshold)) + { + builder.Append(" revisionTransitionThreshold: "); + builder.AppendLine($"{RevisionTransitionThreshold.Value}"); + } + } + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue("ServiceType", out propertyOverride); if (hasPropertyOverride) { diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/ContainerAppConfiguration.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/ContainerAppConfiguration.cs index 9a3631a019b7..2af11ea34e2b 100644 --- a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/ContainerAppConfiguration.cs +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/ContainerAppConfiguration.cs @@ -57,25 +57,29 @@ public ContainerAppConfiguration() /// 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.</item><item>Single: Only one revision can be active at a time. Revision weights can not be used in this mode. If no value if provided, this is the default.</item></list> + /// <list><item>Single: Only one revision can be active at a time. Traffic weights cannot be used. This is the default.</item><item>Multiple: Multiple revisions can be active, including optional traffic weights and labels.</item><item>Labels: Only revisions with labels are active. Traffic weights can be applied to labels.</item></list> /// + /// Required in labels revisions mode. Label to apply to newly created revision. /// Ingress configurations. /// Collection of private container registry credentials for containers used by the Container app. /// Dapr configuration for the Container App. /// App runtime configuration for the Container App. /// Optional. Max inactive revisions a Container App can have. + /// Optional. The percent of the total number of replicas that must be brought up before revision transition occurs. Defaults to 100 when none is given. Value must be greater than 0 and less than or equal to 100. /// Container App to be a dev Container App Service. /// Optional settings for Managed Identities that are assigned to the Container App. If a Managed Identity is not specified here, default settings will be used. /// Keeps track of any properties unknown to the library. - internal ContainerAppConfiguration(IList secrets, ContainerAppActiveRevisionsMode? activeRevisionsMode, ContainerAppIngressConfiguration ingress, IList registries, ContainerAppDaprConfiguration dapr, Runtime runtime, int? maxInactiveRevisions, Service service, IList identitySettings, IDictionary serializedAdditionalRawData) + internal ContainerAppConfiguration(IList secrets, ContainerAppActiveRevisionsMode? activeRevisionsMode, string targetLabel, ContainerAppIngressConfiguration ingress, IList registries, ContainerAppDaprConfiguration dapr, ContainerAppRuntime runtime, int? maxInactiveRevisions, int? revisionTransitionThreshold, Service service, IList identitySettings, IDictionary serializedAdditionalRawData) { Secrets = secrets; ActiveRevisionsMode = activeRevisionsMode; + TargetLabel = targetLabel; Ingress = ingress; Registries = registries; Dapr = dapr; Runtime = runtime; MaxInactiveRevisions = maxInactiveRevisions; + RevisionTransitionThreshold = revisionTransitionThreshold; Service = service; IdentitySettings = identitySettings; _serializedAdditionalRawData = serializedAdditionalRawData; @@ -86,10 +90,13 @@ internal ContainerAppConfiguration(IList secrets, Co public IList Secrets { get; } /// /// ActiveRevisionsMode controls how active revisions are handled for the Container app: - /// <list><item>Multiple: multiple revisions can be active.</item><item>Single: Only one revision can be active at a time. Revision weights can not be used in this mode. If no value if provided, this is the default.</item></list> + /// <list><item>Single: Only one revision can be active at a time. Traffic weights cannot be used. This is the default.</item><item>Multiple: Multiple revisions can be active, including optional traffic weights and labels.</item><item>Labels: Only revisions with labels are active. Traffic weights can be applied to labels.</item></list> /// [WirePath("activeRevisionsMode")] public ContainerAppActiveRevisionsMode? ActiveRevisionsMode { get; set; } + /// Required in labels revisions mode. Label to apply to newly created revision. + [WirePath("targetLabel")] + public string TargetLabel { get; set; } /// Ingress configurations. [WirePath("ingress")] public ContainerAppIngressConfiguration Ingress { get; set; } @@ -100,23 +107,14 @@ internal ContainerAppConfiguration(IList secrets, Co [WirePath("dapr")] public ContainerAppDaprConfiguration Dapr { get; set; } /// App runtime configuration for the Container App. - internal Runtime Runtime { get; set; } - /// Enable jmx core metrics for the java app. - [WirePath("runtime.java.enableMetrics")] - public bool? EnableMetrics - { - get => Runtime is null ? default : Runtime.EnableMetrics; - set - { - if (Runtime is null) - Runtime = new Runtime(); - Runtime.EnableMetrics = value; - } - } - + [WirePath("runtime")] + public ContainerAppRuntime Runtime { get; set; } /// Optional. Max inactive revisions a Container App can have. [WirePath("maxInactiveRevisions")] public int? MaxInactiveRevisions { get; set; } + /// Optional. The percent of the total number of replicas that must be brought up before revision transition occurs. Defaults to 100 when none is given. Value must be greater than 0 and less than or equal to 100. + [WirePath("revisionTransitionThreshold")] + public int? RevisionTransitionThreshold { get; set; } /// Container App to be a dev Container App Service. internal Service Service { get; set; } /// Dev ContainerApp service type. diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/ContainerAppConnectedEnvironmentPatch.Serialization.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/ContainerAppConnectedEnvironmentPatch.Serialization.cs new file mode 100644 index 000000000000..6b7bb723ef54 --- /dev/null +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/ContainerAppConnectedEnvironmentPatch.Serialization.cs @@ -0,0 +1,119 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.AppContainers.Models +{ + public partial class ContainerAppConnectedEnvironmentPatch : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ContainerAppConnectedEnvironmentPatch)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + } + + ContainerAppConnectedEnvironmentPatch IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ContainerAppConnectedEnvironmentPatch)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeContainerAppConnectedEnvironmentPatch(document.RootElement, options); + } + + internal static ContainerAppConnectedEnvironmentPatch DeserializeContainerAppConnectedEnvironmentPatch(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IDictionary tags = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("tags"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + Dictionary dictionary = new Dictionary(); + foreach (var property0 in property.Value.EnumerateObject()) + { + dictionary.Add(property0.Name, property0.Value.GetString()); + } + tags = dictionary; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ContainerAppConnectedEnvironmentPatch(tags ?? new ChangeTrackingDictionary(), serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerAppContainersContext.Default); + default: + throw new FormatException($"The model {nameof(ContainerAppConnectedEnvironmentPatch)} does not support writing '{options.Format}' format."); + } + } + + ContainerAppConnectedEnvironmentPatch IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeContainerAppConnectedEnvironmentPatch(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ContainerAppConnectedEnvironmentPatch)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/ContainerAppConnectedEnvironmentPatch.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/ContainerAppConnectedEnvironmentPatch.cs new file mode 100644 index 000000000000..28db9b9f5e6a --- /dev/null +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/ContainerAppConnectedEnvironmentPatch.cs @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.AppContainers.Models +{ + /// Connected environment patch properties. + public partial class ContainerAppConnectedEnvironmentPatch : ContainerAppResourceTags + { + /// Initializes a new instance of . + public ContainerAppConnectedEnvironmentPatch() + { + } + + /// Initializes a new instance of . + /// Resource tags. + /// Keeps track of any properties unknown to the library. + internal ContainerAppConnectedEnvironmentPatch(IDictionary tags, IDictionary serializedAdditionalRawData) : base(tags, serializedAdditionalRawData) + { + } + } +} diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/ContainerAppContainer.Serialization.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/ContainerAppContainer.Serialization.cs index f62d3cadc10b..fb5e03998a66 100644 --- a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/ContainerAppContainer.Serialization.cs +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/ContainerAppContainer.Serialization.cs @@ -71,6 +71,7 @@ internal static ContainerAppContainer DeserializeContainerAppContainer(JsonEleme } IList probes = default; string image = default; + ImageType? imageType = default; string name = default; IList command = default; IList args = default; @@ -100,6 +101,15 @@ internal static ContainerAppContainer DeserializeContainerAppContainer(JsonEleme image = property.Value.GetString(); continue; } + if (property.NameEquals("imageType"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + imageType = new ImageType(property.Value.GetString()); + continue; + } if (property.NameEquals("name"u8)) { name = property.Value.GetString(); @@ -178,6 +188,7 @@ internal static ContainerAppContainer DeserializeContainerAppContainer(JsonEleme serializedAdditionalRawData = rawDataDictionary; return new ContainerAppContainer( image, + imageType, name, command ?? new ChangeTrackingList(), args ?? new ChangeTrackingList(), @@ -245,6 +256,21 @@ private BinaryData SerializeBicep(ModelReaderWriterOptions options) } } + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(ImageType), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" imageType: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(ImageType)) + { + builder.Append(" imageType: "); + builder.AppendLine($"'{ImageType.Value.ToString()}'"); + } + } + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Name), out propertyOverride); if (hasPropertyOverride) { diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/ContainerAppContainer.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/ContainerAppContainer.cs index ab389a1583d2..dcf3c819d6e9 100644 --- a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/ContainerAppContainer.cs +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/ContainerAppContainer.cs @@ -21,6 +21,7 @@ public ContainerAppContainer() /// Initializes a new instance of . /// Container image tag. + /// The type of the image. Set to CloudBuild to let the system manages the image, where user will not be able to update image through image field. Set to ContainerImage for user provided image. /// Custom container name. /// Container start command. /// Container start command arguments. @@ -29,7 +30,7 @@ public ContainerAppContainer() /// Container volume mounts. /// Keeps track of any properties unknown to the library. /// List of probes for the container. - internal ContainerAppContainer(string image, string name, IList command, IList args, IList env, AppContainerResources resources, IList volumeMounts, IDictionary serializedAdditionalRawData, IList probes) : base(image, name, command, args, env, resources, volumeMounts, serializedAdditionalRawData) + internal ContainerAppContainer(string image, ImageType? imageType, string name, IList command, IList args, IList env, AppContainerResources resources, IList volumeMounts, IDictionary serializedAdditionalRawData, IList probes) : base(image, imageType, name, command, args, env, resources, volumeMounts, serializedAdditionalRawData) { Probes = probes; } diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/ContainerAppContainerRegistry.Serialization.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/ContainerAppContainerRegistry.Serialization.cs new file mode 100644 index 000000000000..271c6556c8db --- /dev/null +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/ContainerAppContainerRegistry.Serialization.cs @@ -0,0 +1,190 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.AppContainers.Models +{ + public partial class ContainerAppContainerRegistry : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ContainerAppContainerRegistry)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("containerRegistryServer"u8); + writer.WriteStringValue(ContainerRegistryServer); + writer.WritePropertyName("identityResourceId"u8); + writer.WriteStringValue(IdentityResourceId); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + ContainerAppContainerRegistry IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ContainerAppContainerRegistry)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeContainerAppContainerRegistry(document.RootElement, options); + } + + internal static ContainerAppContainerRegistry DeserializeContainerAppContainerRegistry(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string containerRegistryServer = default; + ResourceIdentifier identityResourceId = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("containerRegistryServer"u8)) + { + containerRegistryServer = property.Value.GetString(); + continue; + } + if (property.NameEquals("identityResourceId"u8)) + { + identityResourceId = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ContainerAppContainerRegistry(containerRegistryServer, identityResourceId, serializedAdditionalRawData); + } + + private BinaryData SerializeBicep(ModelReaderWriterOptions options) + { + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(ContainerRegistryServer), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" containerRegistryServer: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(ContainerRegistryServer)) + { + builder.Append(" containerRegistryServer: "); + if (ContainerRegistryServer.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{ContainerRegistryServer}'''"); + } + else + { + builder.AppendLine($"'{ContainerRegistryServer}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(IdentityResourceId), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" identityResourceId: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(IdentityResourceId)) + { + builder.Append(" identityResourceId: "); + builder.AppendLine($"'{IdentityResourceId.ToString()}'"); + } + } + + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerAppContainersContext.Default); + case "bicep": + return SerializeBicep(options); + default: + throw new FormatException($"The model {nameof(ContainerAppContainerRegistry)} does not support writing '{options.Format}' format."); + } + } + + ContainerAppContainerRegistry IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeContainerAppContainerRegistry(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ContainerAppContainerRegistry)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/ContainerAppContainerRegistry.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/ContainerAppContainerRegistry.cs new file mode 100644 index 000000000000..3e1692e75924 --- /dev/null +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/ContainerAppContainerRegistry.cs @@ -0,0 +1,85 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.ResourceManager.AppContainers.Models +{ + /// Model representing a mapping from a container registry to the identity used to connect to it. + public partial class ContainerAppContainerRegistry + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// Login server of the container registry. + /// Resource ID of the managed identity. + /// or is null. + public ContainerAppContainerRegistry(string containerRegistryServer, ResourceIdentifier identityResourceId) + { + Argument.AssertNotNull(containerRegistryServer, nameof(containerRegistryServer)); + Argument.AssertNotNull(identityResourceId, nameof(identityResourceId)); + + ContainerRegistryServer = containerRegistryServer; + IdentityResourceId = identityResourceId; + } + + /// Initializes a new instance of . + /// Login server of the container registry. + /// Resource ID of the managed identity. + /// Keeps track of any properties unknown to the library. + internal ContainerAppContainerRegistry(string containerRegistryServer, ResourceIdentifier identityResourceId, IDictionary serializedAdditionalRawData) + { + ContainerRegistryServer = containerRegistryServer; + IdentityResourceId = identityResourceId; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal ContainerAppContainerRegistry() + { + } + + /// Login server of the container registry. + [WirePath("containerRegistryServer")] + public string ContainerRegistryServer { get; set; } + /// Resource ID of the managed identity. + [WirePath("identityResourceId")] + public ResourceIdentifier IdentityResourceId { get; set; } + } +} diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/ContainerAppCustomDomainBindingType.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/ContainerAppCustomDomainBindingType.cs index b806a0e18e81..a179d11f4e62 100644 --- a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/ContainerAppCustomDomainBindingType.cs +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/ContainerAppCustomDomainBindingType.cs @@ -24,11 +24,14 @@ public ContainerAppCustomDomainBindingType(string value) private const string DisabledValue = "Disabled"; private const string SniEnabledValue = "SniEnabled"; + private const string AutoValue = "Auto"; /// Disabled. public static ContainerAppCustomDomainBindingType Disabled { get; } = new ContainerAppCustomDomainBindingType(DisabledValue); /// SniEnabled. public static ContainerAppCustomDomainBindingType SniEnabled { get; } = new ContainerAppCustomDomainBindingType(SniEnabledValue); + /// Auto. + public static ContainerAppCustomDomainBindingType Auto { get; } = new ContainerAppCustomDomainBindingType(AutoValue); /// Determines if two values are the same. public static bool operator ==(ContainerAppCustomDomainBindingType left, ContainerAppCustomDomainBindingType right) => left.Equals(right); /// Determines if two values are not the same. diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/ContainerAppDaprConfiguration.Serialization.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/ContainerAppDaprConfiguration.Serialization.cs index 637e02629a58..46b155b1cf51 100644 --- a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/ContainerAppDaprConfiguration.Serialization.cs +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/ContainerAppDaprConfiguration.Serialization.cs @@ -75,6 +75,16 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WritePropertyName("enableApiLogging"u8); writer.WriteBooleanValue(IsApiLoggingEnabled.Value); } + if (Optional.IsDefined(AppHealth)) + { + writer.WritePropertyName("appHealth"u8); + writer.WriteObjectValue(AppHealth, options); + } + if (Optional.IsDefined(MaxConcurrency)) + { + writer.WritePropertyName("maxConcurrency"u8); + writer.WriteNumberValue(MaxConcurrency.Value); + } if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) @@ -120,6 +130,8 @@ internal static ContainerAppDaprConfiguration DeserializeContainerAppDaprConfigu int? httpMaxRequestSize = default; ContainerAppDaprLogLevel? logLevel = default; bool? enableApiLogging = default; + DaprAppHealth appHealth = default; + int? maxConcurrency = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -192,6 +204,24 @@ internal static ContainerAppDaprConfiguration DeserializeContainerAppDaprConfigu enableApiLogging = property.Value.GetBoolean(); continue; } + if (property.NameEquals("appHealth"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + appHealth = DaprAppHealth.DeserializeDaprAppHealth(property.Value, options); + continue; + } + if (property.NameEquals("maxConcurrency"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + maxConcurrency = property.Value.GetInt32(); + continue; + } if (options.Format != "W") { rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); @@ -207,6 +237,8 @@ internal static ContainerAppDaprConfiguration DeserializeContainerAppDaprConfigu httpMaxRequestSize, logLevel, enableApiLogging, + appHealth, + maxConcurrency, serializedAdditionalRawData); } @@ -351,6 +383,36 @@ private BinaryData SerializeBicep(ModelReaderWriterOptions options) } } + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(AppHealth), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" appHealth: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(AppHealth)) + { + builder.Append(" appHealth: "); + BicepSerializationHelpers.AppendChildObject(builder, AppHealth, options, 2, false, " appHealth: "); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(MaxConcurrency), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" maxConcurrency: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(MaxConcurrency)) + { + builder.Append(" maxConcurrency: "); + builder.AppendLine($"{MaxConcurrency.Value}"); + } + } + builder.AppendLine("}"); return BinaryData.FromString(builder.ToString()); } diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/ContainerAppDaprConfiguration.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/ContainerAppDaprConfiguration.cs index 1649cabfd26c..52a59ea95928 100644 --- a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/ContainerAppDaprConfiguration.cs +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/ContainerAppDaprConfiguration.cs @@ -59,8 +59,10 @@ public ContainerAppDaprConfiguration() /// Increasing max size of request body http and grpc servers parameter in MB to handle uploading of big files. Default is 4 MB. /// Sets the log level for the Dapr sidecar. Allowed values are debug, info, warn, error. Default is info. /// Enables API logging for the Dapr sidecar. + /// Dapr application health check configuration. + /// Maximum number of concurrent requests, events handled by the Dapr sidecar. /// Keeps track of any properties unknown to the library. - internal ContainerAppDaprConfiguration(bool? isEnabled, string appId, ContainerAppProtocol? appProtocol, int? appPort, int? httpReadBufferSize, int? httpMaxRequestSize, ContainerAppDaprLogLevel? logLevel, bool? isApiLoggingEnabled, IDictionary serializedAdditionalRawData) + internal ContainerAppDaprConfiguration(bool? isEnabled, string appId, ContainerAppProtocol? appProtocol, int? appPort, int? httpReadBufferSize, int? httpMaxRequestSize, ContainerAppDaprLogLevel? logLevel, bool? isApiLoggingEnabled, DaprAppHealth appHealth, int? maxConcurrency, IDictionary serializedAdditionalRawData) { IsEnabled = isEnabled; AppId = appId; @@ -70,6 +72,8 @@ internal ContainerAppDaprConfiguration(bool? isEnabled, string appId, ContainerA HttpMaxRequestSize = httpMaxRequestSize; LogLevel = logLevel; IsApiLoggingEnabled = isApiLoggingEnabled; + AppHealth = appHealth; + MaxConcurrency = maxConcurrency; _serializedAdditionalRawData = serializedAdditionalRawData; } @@ -97,5 +101,11 @@ internal ContainerAppDaprConfiguration(bool? isEnabled, string appId, ContainerA /// Enables API logging for the Dapr sidecar. [WirePath("enableApiLogging")] public bool? IsApiLoggingEnabled { get; set; } + /// Dapr application health check configuration. + [WirePath("appHealth")] + public DaprAppHealth AppHealth { get; set; } + /// Maximum number of concurrent requests, events handled by the Dapr sidecar. + [WirePath("maxConcurrency")] + public int? MaxConcurrency { get; set; } } } diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/ContainerAppGitHubActionConfiguration.Serialization.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/ContainerAppGitHubActionConfiguration.Serialization.cs index c2b9a19e117e..e096d7b3586e 100644 --- a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/ContainerAppGitHubActionConfiguration.Serialization.cs +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/ContainerAppGitHubActionConfiguration.Serialization.cs @@ -8,6 +8,7 @@ using System; using System.ClientModel.Primitives; using System.Collections.Generic; +using System.Linq; using System.Text; using System.Text.Json; using Azure.Core; @@ -50,6 +51,11 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WritePropertyName("contextPath"u8); writer.WriteStringValue(ContextPath); } + if (Optional.IsDefined(DockerfilePath)) + { + writer.WritePropertyName("dockerfilePath"u8); + writer.WriteStringValue(DockerfilePath); + } if (Optional.IsDefined(GitHubPersonalAccessToken)) { writer.WritePropertyName("githubPersonalAccessToken"u8); @@ -80,6 +86,16 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WritePropertyName("runtimeVersion"u8); writer.WriteStringValue(RuntimeVersion); } + if (Optional.IsCollectionDefined(BuildEnvironmentVariables)) + { + writer.WritePropertyName("buildEnvironmentVariables"u8); + writer.WriteStartArray(); + foreach (var item in BuildEnvironmentVariables) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) @@ -120,12 +136,14 @@ internal static ContainerAppGitHubActionConfiguration DeserializeContainerAppGit ContainerAppRegistryInfo registryInfo = default; ContainerAppCredentials azureCredentials = default; string contextPath = default; + string dockerfilePath = default; string gitHubPersonalAccessToken = default; string image = default; string publishType = default; string os = default; string runtimeStack = default; string runtimeVersion = default; + IList buildEnvironmentVariables = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -153,6 +171,11 @@ internal static ContainerAppGitHubActionConfiguration DeserializeContainerAppGit contextPath = property.Value.GetString(); continue; } + if (property.NameEquals("dockerfilePath"u8)) + { + dockerfilePath = property.Value.GetString(); + continue; + } if (property.NameEquals("githubPersonalAccessToken"u8)) { gitHubPersonalAccessToken = property.Value.GetString(); @@ -183,6 +206,20 @@ internal static ContainerAppGitHubActionConfiguration DeserializeContainerAppGit runtimeVersion = property.Value.GetString(); continue; } + if (property.NameEquals("buildEnvironmentVariables"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(ContainerAppSimpleEnvironmentVariable.DeserializeContainerAppSimpleEnvironmentVariable(item, options)); + } + buildEnvironmentVariables = array; + continue; + } if (options.Format != "W") { rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); @@ -193,12 +230,14 @@ internal static ContainerAppGitHubActionConfiguration DeserializeContainerAppGit registryInfo, azureCredentials, contextPath, + dockerfilePath, gitHubPersonalAccessToken, image, publishType, os, runtimeStack, runtimeVersion, + buildEnvironmentVariables ?? new ChangeTrackingList(), serializedAdditionalRawData); } @@ -266,6 +305,29 @@ private BinaryData SerializeBicep(ModelReaderWriterOptions options) } } + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(DockerfilePath), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" dockerfilePath: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(DockerfilePath)) + { + builder.Append(" dockerfilePath: "); + if (DockerfilePath.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{DockerfilePath}'''"); + } + else + { + builder.AppendLine($"'{DockerfilePath}'"); + } + } + } + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(GitHubPersonalAccessToken), out propertyOverride); if (hasPropertyOverride) { @@ -404,6 +466,29 @@ private BinaryData SerializeBicep(ModelReaderWriterOptions options) } } + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(BuildEnvironmentVariables), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" buildEnvironmentVariables: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsCollectionDefined(BuildEnvironmentVariables)) + { + if (BuildEnvironmentVariables.Any()) + { + builder.Append(" buildEnvironmentVariables: "); + builder.AppendLine("["); + foreach (var item in BuildEnvironmentVariables) + { + BicepSerializationHelpers.AppendChildObject(builder, item, options, 4, true, " buildEnvironmentVariables: "); + } + builder.AppendLine(" ]"); + } + } + } + builder.AppendLine("}"); return BinaryData.FromString(builder.ToString()); } diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/ContainerAppGitHubActionConfiguration.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/ContainerAppGitHubActionConfiguration.cs index d1221df73902..04d49ec93a09 100644 --- a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/ContainerAppGitHubActionConfiguration.cs +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/ContainerAppGitHubActionConfiguration.cs @@ -48,30 +48,35 @@ public partial class ContainerAppGitHubActionConfiguration /// Initializes a new instance of . public ContainerAppGitHubActionConfiguration() { + BuildEnvironmentVariables = new ChangeTrackingList(); } /// Initializes a new instance of . /// Registry configurations. /// AzureCredentials configurations. /// Context path. + /// Dockerfile path. /// One time Github PAT to configure github environment. /// Image name. /// Code or Image. /// Operation system. /// Runtime stack. /// Runtime version. + /// List of environment variables to be passed to the build. /// Keeps track of any properties unknown to the library. - internal ContainerAppGitHubActionConfiguration(ContainerAppRegistryInfo registryInfo, ContainerAppCredentials azureCredentials, string contextPath, string gitHubPersonalAccessToken, string image, string publishType, string os, string runtimeStack, string runtimeVersion, IDictionary serializedAdditionalRawData) + internal ContainerAppGitHubActionConfiguration(ContainerAppRegistryInfo registryInfo, ContainerAppCredentials azureCredentials, string contextPath, string dockerfilePath, string gitHubPersonalAccessToken, string image, string publishType, string os, string runtimeStack, string runtimeVersion, IList buildEnvironmentVariables, IDictionary serializedAdditionalRawData) { RegistryInfo = registryInfo; AzureCredentials = azureCredentials; ContextPath = contextPath; + DockerfilePath = dockerfilePath; GitHubPersonalAccessToken = gitHubPersonalAccessToken; Image = image; PublishType = publishType; OS = os; RuntimeStack = runtimeStack; RuntimeVersion = runtimeVersion; + BuildEnvironmentVariables = buildEnvironmentVariables; _serializedAdditionalRawData = serializedAdditionalRawData; } @@ -84,6 +89,9 @@ internal ContainerAppGitHubActionConfiguration(ContainerAppRegistryInfo registry /// Context path. [WirePath("contextPath")] public string ContextPath { get; set; } + /// Dockerfile path. + [WirePath("dockerfilePath")] + public string DockerfilePath { get; set; } /// One time Github PAT to configure github environment. [WirePath("githubPersonalAccessToken")] public string GitHubPersonalAccessToken { get; set; } @@ -102,5 +110,8 @@ internal ContainerAppGitHubActionConfiguration(ContainerAppRegistryInfo registry /// Runtime version. [WirePath("runtimeVersion")] public string RuntimeVersion { get; set; } + /// List of environment variables to be passed to the build. + [WirePath("buildEnvironmentVariables")] + public IList BuildEnvironmentVariables { get; } } } diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/ContainerAppIngressConfiguration.Serialization.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/ContainerAppIngressConfiguration.Serialization.cs index 2a75179273dd..817a0d53a308 100644 --- a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/ContainerAppIngressConfiguration.Serialization.cs +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/ContainerAppIngressConfiguration.Serialization.cs @@ -121,6 +121,11 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } writer.WriteEndArray(); } + if (Optional.IsDefined(TargetPortHttpScheme)) + { + writer.WritePropertyName("targetPortHttpScheme"u8); + writer.WriteStringValue(TargetPortHttpScheme.Value.ToString()); + } if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) @@ -171,6 +176,7 @@ internal static ContainerAppIngressConfiguration DeserializeContainerAppIngressC ContainerAppIngressClientCertificateMode? clientCertificateMode = default; ContainerAppCorsPolicy corsPolicy = default; IList additionalPortMappings = default; + IngressTargetPortHttpScheme? targetPortHttpScheme = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -308,6 +314,15 @@ internal static ContainerAppIngressConfiguration DeserializeContainerAppIngressC additionalPortMappings = array; continue; } + if (property.NameEquals("targetPortHttpScheme"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + targetPortHttpScheme = new IngressTargetPortHttpScheme(property.Value.GetString()); + continue; + } if (options.Format != "W") { rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); @@ -328,6 +343,7 @@ internal static ContainerAppIngressConfiguration DeserializeContainerAppIngressC clientCertificateMode, corsPolicy, additionalPortMappings ?? new ChangeTrackingList(), + targetPortHttpScheme, serializedAdditionalRawData); } @@ -582,6 +598,21 @@ private BinaryData SerializeBicep(ModelReaderWriterOptions options) } } + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(TargetPortHttpScheme), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" targetPortHttpScheme: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(TargetPortHttpScheme)) + { + builder.Append(" targetPortHttpScheme: "); + builder.AppendLine($"'{TargetPortHttpScheme.Value.ToString()}'"); + } + } + builder.AppendLine("}"); return BinaryData.FromString(builder.ToString()); } diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/ContainerAppIngressConfiguration.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/ContainerAppIngressConfiguration.cs index 6a8733180a10..ec4dd21448bf 100644 --- a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/ContainerAppIngressConfiguration.cs +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/ContainerAppIngressConfiguration.cs @@ -68,8 +68,9 @@ public ContainerAppIngressConfiguration() /// Client certificate mode for mTLS authentication. Ignore indicates server drops client certificate on forwarding. Accept indicates server forwards client certificate but does not require a client certificate. Require indicates server requires a client certificate. /// CORS policy for container app. /// Settings to expose additional ports on container app. + /// Whether an http app listens on http or https. /// Keeps track of any properties unknown to the library. - internal ContainerAppIngressConfiguration(string fqdn, bool? external, int? targetPort, int? exposedPort, ContainerAppIngressTransportMethod? transport, IList traffic, IList customDomains, bool? allowInsecure, IList ipSecurityRestrictions, IngressStickySessions stickySessions, ContainerAppIngressClientCertificateMode? clientCertificateMode, ContainerAppCorsPolicy corsPolicy, IList additionalPortMappings, IDictionary serializedAdditionalRawData) + internal ContainerAppIngressConfiguration(string fqdn, bool? external, int? targetPort, int? exposedPort, ContainerAppIngressTransportMethod? transport, IList traffic, IList customDomains, bool? allowInsecure, IList ipSecurityRestrictions, IngressStickySessions stickySessions, ContainerAppIngressClientCertificateMode? clientCertificateMode, ContainerAppCorsPolicy corsPolicy, IList additionalPortMappings, IngressTargetPortHttpScheme? targetPortHttpScheme, IDictionary serializedAdditionalRawData) { Fqdn = fqdn; External = external; @@ -84,6 +85,7 @@ internal ContainerAppIngressConfiguration(string fqdn, bool? external, int? targ ClientCertificateMode = clientCertificateMode; CorsPolicy = corsPolicy; AdditionalPortMappings = additionalPortMappings; + TargetPortHttpScheme = targetPortHttpScheme; _serializedAdditionalRawData = serializedAdditionalRawData; } @@ -138,5 +140,8 @@ public Affinity? StickySessionsAffinity /// Settings to expose additional ports on container app. [WirePath("additionalPortMappings")] public IList AdditionalPortMappings { get; } + /// Whether an http app listens on http or https. + [WirePath("targetPortHttpScheme")] + public IngressTargetPortHttpScheme? TargetPortHttpScheme { get; set; } } } diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/ContainerAppInitContainer.Serialization.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/ContainerAppInitContainer.Serialization.cs index e544324884ae..63d638c98edf 100644 --- a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/ContainerAppInitContainer.Serialization.cs +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/ContainerAppInitContainer.Serialization.cs @@ -60,6 +60,7 @@ internal static ContainerAppInitContainer DeserializeContainerAppInitContainer(J return null; } string image = default; + ImageType? imageType = default; string name = default; IList command = default; IList args = default; @@ -75,6 +76,15 @@ internal static ContainerAppInitContainer DeserializeContainerAppInitContainer(J image = property.Value.GetString(); continue; } + if (property.NameEquals("imageType"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + imageType = new ImageType(property.Value.GetString()); + continue; + } if (property.NameEquals("name"u8)) { name = property.Value.GetString(); @@ -153,6 +163,7 @@ internal static ContainerAppInitContainer DeserializeContainerAppInitContainer(J serializedAdditionalRawData = rawDataDictionary; return new ContainerAppInitContainer( image, + imageType, name, command ?? new ChangeTrackingList(), args ?? new ChangeTrackingList(), @@ -196,6 +207,21 @@ private BinaryData SerializeBicep(ModelReaderWriterOptions options) } } + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(ImageType), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" imageType: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(ImageType)) + { + builder.Append(" imageType: "); + builder.AppendLine($"'{ImageType.Value.ToString()}'"); + } + } + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Name), out propertyOverride); if (hasPropertyOverride) { diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/ContainerAppInitContainer.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/ContainerAppInitContainer.cs index e3f05ba422c4..a7aa04cf8492 100644 --- a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/ContainerAppInitContainer.cs +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/ContainerAppInitContainer.cs @@ -20,6 +20,7 @@ public ContainerAppInitContainer() /// Initializes a new instance of . /// Container image tag. + /// The type of the image. Set to CloudBuild to let the system manages the image, where user will not be able to update image through image field. Set to ContainerImage for user provided image. /// Custom container name. /// Container start command. /// Container start command arguments. @@ -27,7 +28,7 @@ public ContainerAppInitContainer() /// Container resource requirements. /// Container volume mounts. /// Keeps track of any properties unknown to the library. - internal ContainerAppInitContainer(string image, string name, IList command, IList args, IList env, AppContainerResources resources, IList volumeMounts, IDictionary serializedAdditionalRawData) : base(image, name, command, args, env, resources, volumeMounts, serializedAdditionalRawData) + internal ContainerAppInitContainer(string image, ImageType? imageType, string name, IList command, IList args, IList env, AppContainerResources resources, IList volumeMounts, IDictionary serializedAdditionalRawData) : base(image, imageType, name, command, args, env, resources, volumeMounts, serializedAdditionalRawData) { } } diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/ContainerAppJobPatch.Serialization.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/ContainerAppJobPatch.Serialization.cs index cbe8d808a585..1087c0fa8f65 100644 --- a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/ContainerAppJobPatch.Serialization.cs +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/ContainerAppJobPatch.Serialization.cs @@ -35,6 +35,11 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit throw new FormatException($"The model {nameof(ContainerAppJobPatch)} does not support writing '{format}' format."); } + if (Optional.IsDefined(ExtendedLocation)) + { + writer.WritePropertyName("extendedLocation"u8); + writer.WriteObjectValue(ExtendedLocation, options); + } if (Optional.IsDefined(Identity)) { writer.WritePropertyName("identity"u8); @@ -94,6 +99,7 @@ internal static ContainerAppJobPatch DeserializeContainerAppJobPatch(JsonElement { return null; } + ContainerAppExtendedLocation extendedLocation = default; ManagedServiceIdentity identity = default; IDictionary tags = default; ContainerAppJobPatchProperties properties = default; @@ -101,6 +107,15 @@ internal static ContainerAppJobPatch DeserializeContainerAppJobPatch(JsonElement Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { + if (property.NameEquals("extendedLocation"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + extendedLocation = ContainerAppExtendedLocation.DeserializeContainerAppExtendedLocation(property.Value, options); + continue; + } if (property.NameEquals("identity"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -140,7 +155,7 @@ internal static ContainerAppJobPatch DeserializeContainerAppJobPatch(JsonElement } } serializedAdditionalRawData = rawDataDictionary; - return new ContainerAppJobPatch(identity, tags ?? new ChangeTrackingDictionary(), properties, serializedAdditionalRawData); + return new ContainerAppJobPatch(extendedLocation, identity, tags ?? new ChangeTrackingDictionary(), properties, serializedAdditionalRawData); } BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/ContainerAppJobPatch.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/ContainerAppJobPatch.cs index 4367700245d1..9ee618bd63f6 100644 --- a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/ContainerAppJobPatch.cs +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/ContainerAppJobPatch.cs @@ -53,18 +53,23 @@ public ContainerAppJobPatch() } /// Initializes a new instance of . + /// The complex type of the extended location. /// Managed identities needed by a container app job to interact with other Azure services to not maintain any secrets or credentials in code. /// Resource tags. /// /// Keeps track of any properties unknown to the library. - internal ContainerAppJobPatch(ManagedServiceIdentity identity, IDictionary tags, ContainerAppJobPatchProperties properties, IDictionary serializedAdditionalRawData) + internal ContainerAppJobPatch(ContainerAppExtendedLocation extendedLocation, ManagedServiceIdentity identity, IDictionary tags, ContainerAppJobPatchProperties properties, IDictionary serializedAdditionalRawData) { + ExtendedLocation = extendedLocation; Identity = identity; Tags = tags; Properties = properties; _serializedAdditionalRawData = serializedAdditionalRawData; } + /// The complex type of the extended location. + [WirePath("extendedLocation")] + public ContainerAppExtendedLocation ExtendedLocation { get; set; } /// Managed identities needed by a container app job to interact with other Azure services to not maintain any secrets or credentials in code. [WirePath("identity")] public ManagedServiceIdentity Identity { get; set; } diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/ContainerAppJobRunningState.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/ContainerAppJobRunningState.cs new file mode 100644 index 000000000000..130817cd9ba0 --- /dev/null +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/ContainerAppJobRunningState.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.AppContainers.Models +{ + /// Current running state of the job. + public readonly partial struct ContainerAppJobRunningState : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public ContainerAppJobRunningState(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string ReadyValue = "Ready"; + private const string ProgressingValue = "Progressing"; + private const string SuspendedValue = "Suspended"; + + /// Ready. + public static ContainerAppJobRunningState Ready { get; } = new ContainerAppJobRunningState(ReadyValue); + /// Progressing. + public static ContainerAppJobRunningState Progressing { get; } = new ContainerAppJobRunningState(ProgressingValue); + /// Suspended. + public static ContainerAppJobRunningState Suspended { get; } = new ContainerAppJobRunningState(SuspendedValue); + /// Determines if two values are the same. + public static bool operator ==(ContainerAppJobRunningState left, ContainerAppJobRunningState right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(ContainerAppJobRunningState left, ContainerAppJobRunningState right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator ContainerAppJobRunningState(string value) => new ContainerAppJobRunningState(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is ContainerAppJobRunningState other && Equals(other); + /// + public bool Equals(ContainerAppJobRunningState other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/ContainerAppJobScaleRule.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/ContainerAppJobScaleRule.cs index c78e1b77ac65..28341bd7f8de 100644 --- a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/ContainerAppJobScaleRule.cs +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/ContainerAppJobScaleRule.cs @@ -59,7 +59,7 @@ public ContainerAppJobScaleRule() /// /// Metadata properties to describe the scale rule. /// Authentication secrets for the scale rule. - /// The resource ID of a user-assigned managed identity that is assigned to the Container App, or 'system' for system-assigned identity. + /// The resource ID of a user-assigned managed identity that is assigned to the job, or 'system' for system-assigned identity. /// Keeps track of any properties unknown to the library. internal ContainerAppJobScaleRule(string name, string jobScaleRuleType, BinaryData metadata, IList auth, string identity, IDictionary serializedAdditionalRawData) { @@ -115,7 +115,7 @@ internal ContainerAppJobScaleRule(string name, string jobScaleRuleType, BinaryDa /// Authentication secrets for the scale rule. [WirePath("auth")] public IList Auth { get; } - /// The resource ID of a user-assigned managed identity that is assigned to the Container App, or 'system' for system-assigned identity. + /// The resource ID of a user-assigned managed identity that is assigned to the job, or 'system' for system-assigned identity. [WirePath("identity")] public string Identity { get; set; } } diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/ContainerAppLogAnalyticsConfiguration.Serialization.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/ContainerAppLogAnalyticsConfiguration.Serialization.cs index ec79aff61803..4ee8bfe2fe32 100644 --- a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/ContainerAppLogAnalyticsConfiguration.Serialization.cs +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/ContainerAppLogAnalyticsConfiguration.Serialization.cs @@ -45,6 +45,11 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WritePropertyName("sharedKey"u8); writer.WriteStringValue(SharedKey); } + if (Optional.IsDefined(DynamicJsonColumns)) + { + writer.WritePropertyName("dynamicJsonColumns"u8); + writer.WriteBooleanValue(DynamicJsonColumns.Value); + } if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) @@ -84,6 +89,7 @@ internal static ContainerAppLogAnalyticsConfiguration DeserializeContainerAppLog } string customerId = default; string sharedKey = default; + bool? dynamicJsonColumns = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -98,13 +104,22 @@ internal static ContainerAppLogAnalyticsConfiguration DeserializeContainerAppLog sharedKey = property.Value.GetString(); continue; } + if (property.NameEquals("dynamicJsonColumns"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + dynamicJsonColumns = property.Value.GetBoolean(); + continue; + } if (options.Format != "W") { rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); } } serializedAdditionalRawData = rawDataDictionary; - return new ContainerAppLogAnalyticsConfiguration(customerId, sharedKey, serializedAdditionalRawData); + return new ContainerAppLogAnalyticsConfiguration(customerId, sharedKey, dynamicJsonColumns, serializedAdditionalRawData); } private BinaryData SerializeBicep(ModelReaderWriterOptions options) @@ -164,6 +179,22 @@ private BinaryData SerializeBicep(ModelReaderWriterOptions options) } } + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(DynamicJsonColumns), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" dynamicJsonColumns: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(DynamicJsonColumns)) + { + builder.Append(" dynamicJsonColumns: "); + var boolValue = DynamicJsonColumns.Value == true ? "true" : "false"; + builder.AppendLine($"{boolValue}"); + } + } + builder.AppendLine("}"); return BinaryData.FromString(builder.ToString()); } diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/ContainerAppLogAnalyticsConfiguration.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/ContainerAppLogAnalyticsConfiguration.cs index bf87fce14176..ff34a3477b75 100644 --- a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/ContainerAppLogAnalyticsConfiguration.cs +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/ContainerAppLogAnalyticsConfiguration.cs @@ -53,11 +53,13 @@ public ContainerAppLogAnalyticsConfiguration() /// Initializes a new instance of . /// Log analytics customer id. /// Log analytics customer key. + /// Boolean indicating whether to parse json string log into dynamic json columns. /// Keeps track of any properties unknown to the library. - internal ContainerAppLogAnalyticsConfiguration(string customerId, string sharedKey, IDictionary serializedAdditionalRawData) + internal ContainerAppLogAnalyticsConfiguration(string customerId, string sharedKey, bool? dynamicJsonColumns, IDictionary serializedAdditionalRawData) { CustomerId = customerId; SharedKey = sharedKey; + DynamicJsonColumns = dynamicJsonColumns; _serializedAdditionalRawData = serializedAdditionalRawData; } @@ -67,5 +69,8 @@ internal ContainerAppLogAnalyticsConfiguration(string customerId, string sharedK /// Log analytics customer key. [WirePath("sharedKey")] public string SharedKey { get; set; } + /// Boolean indicating whether to parse json string log into dynamic json columns. + [WirePath("dynamicJsonColumns")] + public bool? DynamicJsonColumns { get; set; } } } diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/ContainerAppNfsAzureFileProperties.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/ContainerAppNfsAzureFileProperties.cs index ad4f82589e88..8c3df896df9e 100644 --- a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/ContainerAppNfsAzureFileProperties.cs +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/ContainerAppNfsAzureFileProperties.cs @@ -51,7 +51,7 @@ public ContainerAppNfsAzureFileProperties() } /// Initializes a new instance of . - /// Server for NFS azure file. Specify the Azure storage account server address. + /// Server for NFS azure file. /// Access mode for storage. /// NFS Azure file share name. /// Keeps track of any properties unknown to the library. @@ -63,7 +63,7 @@ internal ContainerAppNfsAzureFileProperties(string server, ContainerAppAccessMod _serializedAdditionalRawData = serializedAdditionalRawData; } - /// Server for NFS azure file. Specify the Azure storage account server address. + /// Server for NFS azure file. [WirePath("server")] public string Server { get; set; } /// Access mode for storage. diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/ContainerAppPropertiesPatchingConfiguration.Serialization.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/ContainerAppPropertiesPatchingConfiguration.Serialization.cs new file mode 100644 index 000000000000..540977729278 --- /dev/null +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/ContainerAppPropertiesPatchingConfiguration.Serialization.cs @@ -0,0 +1,166 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.AppContainers.Models +{ + internal partial class ContainerAppPropertiesPatchingConfiguration : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ContainerAppPropertiesPatchingConfiguration)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(PatchingMode)) + { + writer.WritePropertyName("patchingMode"u8); + writer.WriteStringValue(PatchingMode.Value.ToString()); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + ContainerAppPropertiesPatchingConfiguration IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ContainerAppPropertiesPatchingConfiguration)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeContainerAppPropertiesPatchingConfiguration(document.RootElement, options); + } + + internal static ContainerAppPropertiesPatchingConfiguration DeserializeContainerAppPropertiesPatchingConfiguration(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + PatchingMode? patchingMode = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("patchingMode"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + patchingMode = new PatchingMode(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ContainerAppPropertiesPatchingConfiguration(patchingMode, serializedAdditionalRawData); + } + + private BinaryData SerializeBicep(ModelReaderWriterOptions options) + { + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(PatchingMode), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" patchingMode: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(PatchingMode)) + { + builder.Append(" patchingMode: "); + builder.AppendLine($"'{PatchingMode.Value.ToString()}'"); + } + } + + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerAppContainersContext.Default); + case "bicep": + return SerializeBicep(options); + default: + throw new FormatException($"The model {nameof(ContainerAppPropertiesPatchingConfiguration)} does not support writing '{options.Format}' format."); + } + } + + ContainerAppPropertiesPatchingConfiguration IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeContainerAppPropertiesPatchingConfiguration(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ContainerAppPropertiesPatchingConfiguration)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/ContainerAppPropertiesPatchingConfiguration.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/ContainerAppPropertiesPatchingConfiguration.cs new file mode 100644 index 000000000000..64d23e810f0d --- /dev/null +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/ContainerAppPropertiesPatchingConfiguration.cs @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.AppContainers.Models +{ + /// Container App auto patch configuration. + internal partial class ContainerAppPropertiesPatchingConfiguration + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public ContainerAppPropertiesPatchingConfiguration() + { + } + + /// Initializes a new instance of . + /// Patching mode for the container app. Null or default in this field will be interpreted as Automatic by RP. Automatic mode will automatically apply available patches. Manual mode will require the user to manually apply patches. Disabled mode will stop patch detection and auto patching. + /// Keeps track of any properties unknown to the library. + internal ContainerAppPropertiesPatchingConfiguration(PatchingMode? patchingMode, IDictionary serializedAdditionalRawData) + { + PatchingMode = patchingMode; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Patching mode for the container app. Null or default in this field will be interpreted as Automatic by RP. Automatic mode will automatically apply available patches. Manual mode will require the user to manually apply patches. Disabled mode will stop patch detection and auto patching. + [WirePath("patchingMode")] + public PatchingMode? PatchingMode { get; set; } + } +} diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/ContainerAppReplicaContainer.Serialization.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/ContainerAppReplicaContainer.Serialization.cs index c3b2adade690..f1518563549a 100644 --- a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/ContainerAppReplicaContainer.Serialization.cs +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/ContainerAppReplicaContainer.Serialization.cs @@ -80,6 +80,11 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WritePropertyName("execEndpoint"u8); writer.WriteStringValue(ExecEndpoint); } + if (options.Format != "W" && Optional.IsDefined(DebugEndpoint)) + { + writer.WritePropertyName("debugEndpoint"u8); + writer.WriteStringValue(DebugEndpoint); + } if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) @@ -126,6 +131,7 @@ internal static ContainerAppReplicaContainer DeserializeContainerAppReplicaConta string runningStateDetails = default; string logStreamEndpoint = default; string execEndpoint = default; + string debugEndpoint = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -191,6 +197,11 @@ internal static ContainerAppReplicaContainer DeserializeContainerAppReplicaConta execEndpoint = property.Value.GetString(); continue; } + if (property.NameEquals("debugEndpoint"u8)) + { + debugEndpoint = property.Value.GetString(); + continue; + } if (options.Format != "W") { rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); @@ -207,6 +218,7 @@ internal static ContainerAppReplicaContainer DeserializeContainerAppReplicaConta runningStateDetails, logStreamEndpoint, execEndpoint, + debugEndpoint, serializedAdditionalRawData); } @@ -398,6 +410,29 @@ private BinaryData SerializeBicep(ModelReaderWriterOptions options) } } + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(DebugEndpoint), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" debugEndpoint: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(DebugEndpoint)) + { + builder.Append(" debugEndpoint: "); + if (DebugEndpoint.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{DebugEndpoint}'''"); + } + else + { + builder.AppendLine($"'{DebugEndpoint}'"); + } + } + } + builder.AppendLine("}"); return BinaryData.FromString(builder.ToString()); } diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/ContainerAppReplicaContainer.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/ContainerAppReplicaContainer.cs index 2aa59e0405bc..5ade3b33ebea 100644 --- a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/ContainerAppReplicaContainer.cs +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/ContainerAppReplicaContainer.cs @@ -60,8 +60,9 @@ public ContainerAppReplicaContainer() /// The details of container current running state. /// Log Stream endpoint. /// Container exec endpoint. + /// Container debug endpoint. /// Keeps track of any properties unknown to the library. - internal ContainerAppReplicaContainer(string name, string containerId, bool? isReady, bool? isStarted, int? restartCount, ContainerAppContainerRunningState? runningState, string runningStateDetails, string logStreamEndpoint, string execEndpoint, IDictionary serializedAdditionalRawData) + internal ContainerAppReplicaContainer(string name, string containerId, bool? isReady, bool? isStarted, int? restartCount, ContainerAppContainerRunningState? runningState, string runningStateDetails, string logStreamEndpoint, string execEndpoint, string debugEndpoint, IDictionary serializedAdditionalRawData) { Name = name; ContainerId = containerId; @@ -72,6 +73,7 @@ internal ContainerAppReplicaContainer(string name, string containerId, bool? isR RunningStateDetails = runningStateDetails; LogStreamEndpoint = logStreamEndpoint; ExecEndpoint = execEndpoint; + DebugEndpoint = debugEndpoint; _serializedAdditionalRawData = serializedAdditionalRawData; } @@ -102,5 +104,8 @@ internal ContainerAppReplicaContainer(string name, string containerId, bool? isR /// Container exec endpoint. [WirePath("execEndpoint")] public string ExecEndpoint { get; } + /// Container debug endpoint. + [WirePath("debugEndpoint")] + public string DebugEndpoint { get; } } } diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/ContainerAppResourceTags.Serialization.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/ContainerAppResourceTags.Serialization.cs new file mode 100644 index 000000000000..1ecbf2e9501f --- /dev/null +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/ContainerAppResourceTags.Serialization.cs @@ -0,0 +1,144 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.AppContainers.Models +{ + public partial class ContainerAppResourceTags : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ContainerAppResourceTags)} does not support writing '{format}' format."); + } + + 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(); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + ContainerAppResourceTags IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ContainerAppResourceTags)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeContainerAppResourceTags(document.RootElement, options); + } + + internal static ContainerAppResourceTags DeserializeContainerAppResourceTags(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IDictionary tags = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("tags"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + Dictionary dictionary = new Dictionary(); + foreach (var property0 in property.Value.EnumerateObject()) + { + dictionary.Add(property0.Name, property0.Value.GetString()); + } + tags = dictionary; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ContainerAppResourceTags(tags ?? new ChangeTrackingDictionary(), serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerAppContainersContext.Default); + default: + throw new FormatException($"The model {nameof(ContainerAppResourceTags)} does not support writing '{options.Format}' format."); + } + } + + ContainerAppResourceTags IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeContainerAppResourceTags(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ContainerAppResourceTags)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/ContainerAppResourceTags.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/ContainerAppResourceTags.cs new file mode 100644 index 000000000000..882fe18695a9 --- /dev/null +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/ContainerAppResourceTags.cs @@ -0,0 +1,67 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.AppContainers.Models +{ + /// List of key value pairs that describe the resource. This will overwrite the existing tags. + public partial class ContainerAppResourceTags + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private protected IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public ContainerAppResourceTags() + { + Tags = new ChangeTrackingDictionary(); + } + + /// Initializes a new instance of . + /// Resource tags. + /// Keeps track of any properties unknown to the library. + internal ContainerAppResourceTags(IDictionary tags, IDictionary serializedAdditionalRawData) + { + Tags = tags; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Resource tags. + [WirePath("tags")] + public IDictionary Tags { get; } + } +} diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/ContainerAppRuntime.Serialization.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/ContainerAppRuntime.Serialization.cs new file mode 100644 index 000000000000..c8c705d816c1 --- /dev/null +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/ContainerAppRuntime.Serialization.cs @@ -0,0 +1,199 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.AppContainers.Models +{ + public partial class ContainerAppRuntime : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ContainerAppRuntime)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(Java)) + { + writer.WritePropertyName("java"u8); + writer.WriteObjectValue(Java, options); + } + if (Optional.IsDefined(Dotnet)) + { + writer.WritePropertyName("dotnet"u8); + writer.WriteObjectValue(Dotnet, options); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + ContainerAppRuntime IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ContainerAppRuntime)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeContainerAppRuntime(document.RootElement, options); + } + + internal static ContainerAppRuntime DeserializeContainerAppRuntime(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ContainerAppRuntimeJava java = default; + RuntimeDotnet dotnet = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("java"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + java = ContainerAppRuntimeJava.DeserializeContainerAppRuntimeJava(property.Value, options); + continue; + } + if (property.NameEquals("dotnet"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + dotnet = RuntimeDotnet.DeserializeRuntimeDotnet(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ContainerAppRuntime(java, dotnet, serializedAdditionalRawData); + } + + private BinaryData SerializeBicep(ModelReaderWriterOptions options) + { + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Java), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" java: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Java)) + { + builder.Append(" java: "); + BicepSerializationHelpers.AppendChildObject(builder, Java, options, 2, false, " java: "); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue("AutoConfigureDataProtection", out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" dotnet: "); + builder.AppendLine("{"); + builder.Append(" autoConfigureDataProtection: "); + builder.AppendLine(propertyOverride); + builder.AppendLine(" }"); + } + else + { + if (Optional.IsDefined(Dotnet)) + { + builder.Append(" dotnet: "); + BicepSerializationHelpers.AppendChildObject(builder, Dotnet, options, 2, false, " dotnet: "); + } + } + + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerAppContainersContext.Default); + case "bicep": + return SerializeBicep(options); + default: + throw new FormatException($"The model {nameof(ContainerAppRuntime)} does not support writing '{options.Format}' format."); + } + } + + ContainerAppRuntime IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeContainerAppRuntime(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ContainerAppRuntime)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/ContainerAppRuntime.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/ContainerAppRuntime.cs new file mode 100644 index 000000000000..879e0413677a --- /dev/null +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/ContainerAppRuntime.cs @@ -0,0 +1,82 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.AppContainers.Models +{ + /// Container App Runtime configuration. + public partial class ContainerAppRuntime + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public ContainerAppRuntime() + { + } + + /// Initializes a new instance of . + /// Java app configuration. + /// .NET app configuration. + /// Keeps track of any properties unknown to the library. + internal ContainerAppRuntime(ContainerAppRuntimeJava java, RuntimeDotnet dotnet, IDictionary serializedAdditionalRawData) + { + Java = java; + Dotnet = dotnet; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Java app configuration. + [WirePath("java")] + public ContainerAppRuntimeJava Java { get; set; } + /// .NET app configuration. + internal RuntimeDotnet Dotnet { get; set; } + /// Auto configure the ASP.NET Core Data Protection feature. + [WirePath("dotnet.autoConfigureDataProtection")] + public bool? AutoConfigureDataProtection + { + get => Dotnet is null ? default : Dotnet.AutoConfigureDataProtection; + set + { + if (Dotnet is null) + Dotnet = new RuntimeDotnet(); + Dotnet.AutoConfigureDataProtection = value; + } + } + } +} diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/ContainerAppRuntimeJava.Serialization.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/ContainerAppRuntimeJava.Serialization.cs new file mode 100644 index 000000000000..2c096ea730c9 --- /dev/null +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/ContainerAppRuntimeJava.Serialization.cs @@ -0,0 +1,197 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.AppContainers.Models +{ + public partial class ContainerAppRuntimeJava : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ContainerAppRuntimeJava)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(EnableMetrics)) + { + writer.WritePropertyName("enableMetrics"u8); + writer.WriteBooleanValue(EnableMetrics.Value); + } + if (Optional.IsDefined(JavaAgent)) + { + writer.WritePropertyName("javaAgent"u8); + writer.WriteObjectValue(JavaAgent, options); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + ContainerAppRuntimeJava IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ContainerAppRuntimeJava)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeContainerAppRuntimeJava(document.RootElement, options); + } + + internal static ContainerAppRuntimeJava DeserializeContainerAppRuntimeJava(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + bool? enableMetrics = default; + ContainerAppRuntimeJavaAgent javaAgent = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("enableMetrics"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + enableMetrics = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("javaAgent"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + javaAgent = ContainerAppRuntimeJavaAgent.DeserializeContainerAppRuntimeJavaAgent(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ContainerAppRuntimeJava(enableMetrics, javaAgent, serializedAdditionalRawData); + } + + private BinaryData SerializeBicep(ModelReaderWriterOptions options) + { + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(EnableMetrics), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" enableMetrics: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(EnableMetrics)) + { + builder.Append(" enableMetrics: "); + var boolValue = EnableMetrics.Value == true ? "true" : "false"; + builder.AppendLine($"{boolValue}"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(JavaAgent), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" javaAgent: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(JavaAgent)) + { + builder.Append(" javaAgent: "); + BicepSerializationHelpers.AppendChildObject(builder, JavaAgent, options, 2, false, " javaAgent: "); + } + } + + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerAppContainersContext.Default); + case "bicep": + return SerializeBicep(options); + default: + throw new FormatException($"The model {nameof(ContainerAppRuntimeJava)} does not support writing '{options.Format}' format."); + } + } + + ContainerAppRuntimeJava IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeContainerAppRuntimeJava(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ContainerAppRuntimeJava)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/RuntimeJava.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/ContainerAppRuntimeJava.cs similarity index 74% rename from sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/RuntimeJava.cs rename to sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/ContainerAppRuntimeJava.cs index 79048c735494..49a7f20b2c67 100644 --- a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/RuntimeJava.cs +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/ContainerAppRuntimeJava.cs @@ -11,7 +11,7 @@ namespace Azure.ResourceManager.AppContainers.Models { /// Java app configuration. - internal partial class RuntimeJava + public partial class ContainerAppRuntimeJava { /// /// Keeps track of any properties unknown to the library. @@ -45,22 +45,27 @@ internal partial class RuntimeJava /// private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . - public RuntimeJava() + /// Initializes a new instance of . + public ContainerAppRuntimeJava() { } - /// Initializes a new instance of . + /// Initializes a new instance of . /// Enable jmx core metrics for the java app. + /// Diagnostic capabilities achieved by java agent. /// Keeps track of any properties unknown to the library. - internal RuntimeJava(bool? enableMetrics, IDictionary serializedAdditionalRawData) + internal ContainerAppRuntimeJava(bool? enableMetrics, ContainerAppRuntimeJavaAgent javaAgent, IDictionary serializedAdditionalRawData) { EnableMetrics = enableMetrics; + JavaAgent = javaAgent; _serializedAdditionalRawData = serializedAdditionalRawData; } /// Enable jmx core metrics for the java app. [WirePath("enableMetrics")] public bool? EnableMetrics { get; set; } + /// Diagnostic capabilities achieved by java agent. + [WirePath("javaAgent")] + public ContainerAppRuntimeJavaAgent JavaAgent { get; set; } } } diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/ContainerAppRuntimeJavaAgent.Serialization.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/ContainerAppRuntimeJavaAgent.Serialization.cs new file mode 100644 index 000000000000..a3903addaab3 --- /dev/null +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/ContainerAppRuntimeJavaAgent.Serialization.cs @@ -0,0 +1,200 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.AppContainers.Models +{ + public partial class ContainerAppRuntimeJavaAgent : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ContainerAppRuntimeJavaAgent)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(IsEnabled)) + { + writer.WritePropertyName("enabled"u8); + writer.WriteBooleanValue(IsEnabled.Value); + } + if (Optional.IsDefined(Logging)) + { + writer.WritePropertyName("logging"u8); + writer.WriteObjectValue(Logging, options); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + ContainerAppRuntimeJavaAgent IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ContainerAppRuntimeJavaAgent)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeContainerAppRuntimeJavaAgent(document.RootElement, options); + } + + internal static ContainerAppRuntimeJavaAgent DeserializeContainerAppRuntimeJavaAgent(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + bool? enabled = default; + RuntimeJavaAgentLogging logging = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("enabled"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + enabled = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("logging"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + logging = RuntimeJavaAgentLogging.DeserializeRuntimeJavaAgentLogging(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ContainerAppRuntimeJavaAgent(enabled, logging, serializedAdditionalRawData); + } + + private BinaryData SerializeBicep(ModelReaderWriterOptions options) + { + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(IsEnabled), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" enabled: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(IsEnabled)) + { + builder.Append(" enabled: "); + var boolValue = IsEnabled.Value == true ? "true" : "false"; + builder.AppendLine($"{boolValue}"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue("LoggingLoggerSettings", out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" logging: "); + builder.AppendLine("{"); + builder.Append(" loggerSettings: "); + builder.AppendLine(propertyOverride); + builder.AppendLine(" }"); + } + else + { + if (Optional.IsDefined(Logging)) + { + builder.Append(" logging: "); + BicepSerializationHelpers.AppendChildObject(builder, Logging, options, 2, false, " logging: "); + } + } + + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerAppContainersContext.Default); + case "bicep": + return SerializeBicep(options); + default: + throw new FormatException($"The model {nameof(ContainerAppRuntimeJavaAgent)} does not support writing '{options.Format}' format."); + } + } + + ContainerAppRuntimeJavaAgent IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeContainerAppRuntimeJavaAgent(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ContainerAppRuntimeJavaAgent)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/ContainerAppRuntimeJavaAgent.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/ContainerAppRuntimeJavaAgent.cs new file mode 100644 index 000000000000..debe3ead8a1e --- /dev/null +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/ContainerAppRuntimeJavaAgent.cs @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.AppContainers.Models +{ + /// Diagnostic capabilities achieved by java agent. + public partial class ContainerAppRuntimeJavaAgent + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public ContainerAppRuntimeJavaAgent() + { + } + + /// Initializes a new instance of . + /// Enable java agent injection for the java app. + /// Capabilities on the java logging scenario. + /// Keeps track of any properties unknown to the library. + internal ContainerAppRuntimeJavaAgent(bool? isEnabled, RuntimeJavaAgentLogging logging, IDictionary serializedAdditionalRawData) + { + IsEnabled = isEnabled; + Logging = logging; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Enable java agent injection for the java app. + [WirePath("enabled")] + public bool? IsEnabled { get; set; } + /// Capabilities on the java logging scenario. + internal RuntimeJavaAgentLogging Logging { get; set; } + /// Settings of the logger for the java app. + [WirePath("logging.loggerSettings")] + public IList LoggingLoggerSettings + { + get + { + if (Logging is null) + Logging = new RuntimeJavaAgentLogging(); + return Logging.LoggerSettings; + } + } + } +} diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/ContainerAppScale.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/ContainerAppScale.cs index 62619cdb672f..e5235f3a7aa2 100644 --- a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/ContainerAppScale.cs +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/ContainerAppScale.cs @@ -54,8 +54,8 @@ public ContainerAppScale() /// Initializes a new instance of . /// Optional. Minimum number of container replicas. /// Optional. Maximum number of container replicas. Defaults to 10 if not set. - /// Optional. KEDA Cooldown Period in seconds. Defaults to 300 seconds if not set. - /// Optional. KEDA Polling Interval in seconds. Defaults to 30 seconds if not set. + /// Optional. KEDA Cooldown Period. Defaults to 300 seconds if not set. + /// Optional. KEDA Polling Interval. Defaults to 30 seconds if not set. /// Scaling rules. /// Keeps track of any properties unknown to the library. internal ContainerAppScale(int? minReplicas, int? maxReplicas, int? cooldownPeriod, int? pollingInterval, IList rules, IDictionary serializedAdditionalRawData) @@ -74,10 +74,10 @@ internal ContainerAppScale(int? minReplicas, int? maxReplicas, int? cooldownPeri /// Optional. Maximum number of container replicas. Defaults to 10 if not set. [WirePath("maxReplicas")] public int? MaxReplicas { get; set; } - /// Optional. KEDA Cooldown Period in seconds. Defaults to 300 seconds if not set. + /// Optional. KEDA Cooldown Period. Defaults to 300 seconds if not set. [WirePath("cooldownPeriod")] public int? CooldownPeriod { get; set; } - /// Optional. KEDA Polling Interval in seconds. Defaults to 30 seconds if not set. + /// Optional. KEDA Polling Interval. Defaults to 30 seconds if not set. [WirePath("pollingInterval")] public int? PollingInterval { get; set; } /// Scaling rules. diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/ContainerAppServiceBind.Serialization.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/ContainerAppServiceBind.Serialization.cs index 6226e1b123ab..fd49d0ce3b03 100644 --- a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/ContainerAppServiceBind.Serialization.cs +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/ContainerAppServiceBind.Serialization.cs @@ -8,6 +8,7 @@ using System; using System.ClientModel.Primitives; using System.Collections.Generic; +using System.Linq; using System.Text; using System.Text.Json; using Azure.Core; @@ -45,6 +46,22 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WritePropertyName("name"u8); writer.WriteStringValue(Name); } + if (Optional.IsDefined(ClientType)) + { + writer.WritePropertyName("clientType"u8); + writer.WriteStringValue(ClientType); + } + if (Optional.IsCollectionDefined(CustomizedKeys)) + { + writer.WritePropertyName("customizedKeys"u8); + writer.WriteStartObject(); + foreach (var item in CustomizedKeys) + { + writer.WritePropertyName(item.Key); + writer.WriteStringValue(item.Value); + } + writer.WriteEndObject(); + } if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) @@ -84,6 +101,8 @@ internal static ContainerAppServiceBind DeserializeContainerAppServiceBind(JsonE } ResourceIdentifier serviceId = default; string name = default; + string clientType = default; + IDictionary customizedKeys = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -102,13 +121,32 @@ internal static ContainerAppServiceBind DeserializeContainerAppServiceBind(JsonE name = property.Value.GetString(); continue; } + if (property.NameEquals("clientType"u8)) + { + clientType = property.Value.GetString(); + continue; + } + if (property.NameEquals("customizedKeys"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + Dictionary dictionary = new Dictionary(); + foreach (var property0 in property.Value.EnumerateObject()) + { + dictionary.Add(property0.Name, property0.Value.GetString()); + } + customizedKeys = dictionary; + continue; + } if (options.Format != "W") { rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); } } serializedAdditionalRawData = rawDataDictionary; - return new ContainerAppServiceBind(serviceId, name, serializedAdditionalRawData); + return new ContainerAppServiceBind(serviceId, name, clientType, customizedKeys ?? new ChangeTrackingDictionary(), serializedAdditionalRawData); } private BinaryData SerializeBicep(ModelReaderWriterOptions options) @@ -160,6 +198,66 @@ private BinaryData SerializeBicep(ModelReaderWriterOptions options) } } + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(ClientType), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" clientType: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(ClientType)) + { + builder.Append(" clientType: "); + if (ClientType.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{ClientType}'''"); + } + else + { + builder.AppendLine($"'{ClientType}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(CustomizedKeys), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" customizedKeys: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsCollectionDefined(CustomizedKeys)) + { + if (CustomizedKeys.Any()) + { + builder.Append(" customizedKeys: "); + builder.AppendLine("{"); + foreach (var item in CustomizedKeys) + { + builder.Append($" '{item.Key}': "); + if (item.Value == null) + { + builder.Append("null"); + continue; + } + if (item.Value.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{item.Value}'''"); + } + else + { + builder.AppendLine($"'{item.Value}'"); + } + } + builder.AppendLine(" }"); + } + } + } + builder.AppendLine("}"); return BinaryData.FromString(builder.ToString()); } diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/ContainerAppServiceBind.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/ContainerAppServiceBind.cs index 330156fee9ec..defd7ede70c2 100644 --- a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/ContainerAppServiceBind.cs +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/ContainerAppServiceBind.cs @@ -49,16 +49,21 @@ public partial class ContainerAppServiceBind /// Initializes a new instance of . public ContainerAppServiceBind() { + CustomizedKeys = new ChangeTrackingDictionary(); } /// Initializes a new instance of . /// Resource id of the target service. /// Name of the service bind. + /// Type of the client to be used to connect to the service. + /// Customized keys for customizing injected values to the app. /// Keeps track of any properties unknown to the library. - internal ContainerAppServiceBind(ResourceIdentifier serviceId, string name, IDictionary serializedAdditionalRawData) + internal ContainerAppServiceBind(ResourceIdentifier serviceId, string name, string clientType, IDictionary customizedKeys, IDictionary serializedAdditionalRawData) { ServiceId = serviceId; Name = name; + ClientType = clientType; + CustomizedKeys = customizedKeys; _serializedAdditionalRawData = serializedAdditionalRawData; } @@ -68,5 +73,11 @@ internal ContainerAppServiceBind(ResourceIdentifier serviceId, string name, IDic /// Name of the service bind. [WirePath("name")] public string Name { get; set; } + /// Type of the client to be used to connect to the service. + [WirePath("clientType")] + public string ClientType { get; set; } + /// Customized keys for customizing injected values to the app. + [WirePath("customizedKeys")] + public IDictionary CustomizedKeys { get; } } } diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/ContainerAppSimpleEnvironmentVariable.Serialization.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/ContainerAppSimpleEnvironmentVariable.Serialization.cs new file mode 100644 index 000000000000..a813e1e6a6d6 --- /dev/null +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/ContainerAppSimpleEnvironmentVariable.Serialization.cs @@ -0,0 +1,198 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.AppContainers.Models +{ + public partial class ContainerAppSimpleEnvironmentVariable : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ContainerAppSimpleEnvironmentVariable)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("name"u8); + writer.WriteStringValue(Name); + writer.WritePropertyName("value"u8); + writer.WriteStringValue(Value); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + ContainerAppSimpleEnvironmentVariable IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ContainerAppSimpleEnvironmentVariable)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeContainerAppSimpleEnvironmentVariable(document.RootElement, options); + } + + internal static ContainerAppSimpleEnvironmentVariable DeserializeContainerAppSimpleEnvironmentVariable(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string name = default; + string value = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("value"u8)) + { + value = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ContainerAppSimpleEnvironmentVariable(name, value, serializedAdditionalRawData); + } + + private BinaryData SerializeBicep(ModelReaderWriterOptions options) + { + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Name), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" name: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Name)) + { + builder.Append(" name: "); + if (Name.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{Name}'''"); + } + else + { + builder.AppendLine($"'{Name}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Value), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" value: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Value)) + { + builder.Append(" value: "); + if (Value.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{Value}'''"); + } + else + { + builder.AppendLine($"'{Value}'"); + } + } + } + + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerAppContainersContext.Default); + case "bicep": + return SerializeBicep(options); + default: + throw new FormatException($"The model {nameof(ContainerAppSimpleEnvironmentVariable)} does not support writing '{options.Format}' format."); + } + } + + ContainerAppSimpleEnvironmentVariable IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeContainerAppSimpleEnvironmentVariable(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ContainerAppSimpleEnvironmentVariable)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/ContainerAppSimpleEnvironmentVariable.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/ContainerAppSimpleEnvironmentVariable.cs new file mode 100644 index 000000000000..20ad419a07d3 --- /dev/null +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/ContainerAppSimpleEnvironmentVariable.cs @@ -0,0 +1,84 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.AppContainers.Models +{ + /// Model representing an environment variable. + public partial class ContainerAppSimpleEnvironmentVariable + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// Environment variable name. + /// Environment variable value. + /// or is null. + public ContainerAppSimpleEnvironmentVariable(string name, string value) + { + Argument.AssertNotNull(name, nameof(name)); + Argument.AssertNotNull(value, nameof(value)); + + Name = name; + Value = value; + } + + /// Initializes a new instance of . + /// Environment variable name. + /// Environment variable value. + /// Keeps track of any properties unknown to the library. + internal ContainerAppSimpleEnvironmentVariable(string name, string value, IDictionary serializedAdditionalRawData) + { + Name = name; + Value = value; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal ContainerAppSimpleEnvironmentVariable() + { + } + + /// Environment variable name. + [WirePath("name")] + public string Name { get; set; } + /// Environment variable value. + [WirePath("value")] + public string Value { get; set; } + } +} diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/ContainerAppStorageType.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/ContainerAppStorageType.cs index 8df8d53791d0..d84c199e19e3 100644 --- a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/ContainerAppStorageType.cs +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/ContainerAppStorageType.cs @@ -26,6 +26,7 @@ public ContainerAppStorageType(string value) private const string EmptyDirValue = "EmptyDir"; private const string SecretValue = "Secret"; private const string NfsAzureFileValue = "NfsAzureFile"; + private const string SmbValue = "Smb"; /// AzureFile. public static ContainerAppStorageType AzureFile { get; } = new ContainerAppStorageType(AzureFileValue); @@ -35,6 +36,8 @@ public ContainerAppStorageType(string value) public static ContainerAppStorageType Secret { get; } = new ContainerAppStorageType(SecretValue); /// NfsAzureFile. public static ContainerAppStorageType NfsAzureFile { get; } = new ContainerAppStorageType(NfsAzureFileValue); + /// Smb. + public static ContainerAppStorageType Smb { get; } = new ContainerAppStorageType(SmbValue); /// Determines if two values are the same. public static bool operator ==(ContainerAppStorageType left, ContainerAppStorageType right) => left.Equals(right); /// Determines if two values are not the same. diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/ContainerAppTimeoutPolicy.Serialization.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/ContainerAppTimeoutPolicy.Serialization.cs new file mode 100644 index 000000000000..bae1448a9c6d --- /dev/null +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/ContainerAppTimeoutPolicy.Serialization.cs @@ -0,0 +1,196 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.AppContainers.Models +{ + public partial class ContainerAppTimeoutPolicy : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ContainerAppTimeoutPolicy)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(ResponseTimeoutInSeconds)) + { + writer.WritePropertyName("responseTimeoutInSeconds"u8); + writer.WriteNumberValue(ResponseTimeoutInSeconds.Value); + } + if (Optional.IsDefined(ConnectionTimeoutInSeconds)) + { + writer.WritePropertyName("connectionTimeoutInSeconds"u8); + writer.WriteNumberValue(ConnectionTimeoutInSeconds.Value); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + ContainerAppTimeoutPolicy IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ContainerAppTimeoutPolicy)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeContainerAppTimeoutPolicy(document.RootElement, options); + } + + internal static ContainerAppTimeoutPolicy DeserializeContainerAppTimeoutPolicy(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + int? responseTimeoutInSeconds = default; + int? connectionTimeoutInSeconds = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("responseTimeoutInSeconds"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + responseTimeoutInSeconds = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("connectionTimeoutInSeconds"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + connectionTimeoutInSeconds = property.Value.GetInt32(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ContainerAppTimeoutPolicy(responseTimeoutInSeconds, connectionTimeoutInSeconds, serializedAdditionalRawData); + } + + private BinaryData SerializeBicep(ModelReaderWriterOptions options) + { + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(ResponseTimeoutInSeconds), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" responseTimeoutInSeconds: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(ResponseTimeoutInSeconds)) + { + builder.Append(" responseTimeoutInSeconds: "); + builder.AppendLine($"{ResponseTimeoutInSeconds.Value}"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(ConnectionTimeoutInSeconds), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" connectionTimeoutInSeconds: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(ConnectionTimeoutInSeconds)) + { + builder.Append(" connectionTimeoutInSeconds: "); + builder.AppendLine($"{ConnectionTimeoutInSeconds.Value}"); + } + } + + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerAppContainersContext.Default); + case "bicep": + return SerializeBicep(options); + default: + throw new FormatException($"The model {nameof(ContainerAppTimeoutPolicy)} does not support writing '{options.Format}' format."); + } + } + + ContainerAppTimeoutPolicy IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeContainerAppTimeoutPolicy(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ContainerAppTimeoutPolicy)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/ContainerAppTimeoutPolicy.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/ContainerAppTimeoutPolicy.cs new file mode 100644 index 000000000000..c096dd85bb2c --- /dev/null +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/ContainerAppTimeoutPolicy.cs @@ -0,0 +1,71 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.AppContainers.Models +{ + /// Policy to set request timeouts. + public partial class ContainerAppTimeoutPolicy + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public ContainerAppTimeoutPolicy() + { + } + + /// Initializes a new instance of . + /// Timeout, in seconds, for a request to respond. + /// Timeout, in seconds, for a request to initiate a connection. + /// Keeps track of any properties unknown to the library. + internal ContainerAppTimeoutPolicy(int? responseTimeoutInSeconds, int? connectionTimeoutInSeconds, IDictionary serializedAdditionalRawData) + { + ResponseTimeoutInSeconds = responseTimeoutInSeconds; + ConnectionTimeoutInSeconds = connectionTimeoutInSeconds; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Timeout, in seconds, for a request to respond. + [WirePath("responseTimeoutInSeconds")] + public int? ResponseTimeoutInSeconds { get; set; } + /// Timeout, in seconds, for a request to initiate a connection. + [WirePath("connectionTimeoutInSeconds")] + public int? ConnectionTimeoutInSeconds { get; set; } + } +} diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/ContainerAppTokenStore.Serialization.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/ContainerAppTokenStore.Serialization.cs index f9995086d790..7cb3663c76fb 100644 --- a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/ContainerAppTokenStore.Serialization.cs +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/ContainerAppTokenStore.Serialization.cs @@ -89,7 +89,7 @@ internal static ContainerAppTokenStore DeserializeContainerAppTokenStore(JsonEle } bool? enabled = default; double? tokenRefreshExtensionHours = default; - BlobStorageTokenStore azureBlobStorage = default; + ContainerAppBlobStorageTokenStore azureBlobStorage = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -118,7 +118,7 @@ internal static ContainerAppTokenStore DeserializeContainerAppTokenStore(JsonEle { continue; } - azureBlobStorage = BlobStorageTokenStore.DeserializeBlobStorageTokenStore(property.Value, options); + azureBlobStorage = ContainerAppBlobStorageTokenStore.DeserializeContainerAppBlobStorageTokenStore(property.Value, options); continue; } if (options.Format != "W") @@ -172,14 +172,11 @@ private BinaryData SerializeBicep(ModelReaderWriterOptions options) } } - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue("AzureBlobStorageSasUrlSettingName", out propertyOverride); + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(AzureBlobStorage), out propertyOverride); if (hasPropertyOverride) { builder.Append(" azureBlobStorage: "); - builder.AppendLine("{"); - builder.Append(" sasUrlSettingName: "); builder.AppendLine(propertyOverride); - builder.AppendLine(" }"); } else { diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/ContainerAppTokenStore.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/ContainerAppTokenStore.cs index 4f7a25bb431e..f7eb09892af1 100644 --- a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/ContainerAppTokenStore.cs +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/ContainerAppTokenStore.cs @@ -61,7 +61,7 @@ public ContainerAppTokenStore() /// /// The configuration settings of the storage of the tokens if blob storage is used. /// Keeps track of any properties unknown to the library. - internal ContainerAppTokenStore(bool? isEnabled, double? tokenRefreshExtensionHours, BlobStorageTokenStore azureBlobStorage, IDictionary serializedAdditionalRawData) + internal ContainerAppTokenStore(bool? isEnabled, double? tokenRefreshExtensionHours, ContainerAppBlobStorageTokenStore azureBlobStorage, IDictionary serializedAdditionalRawData) { IsEnabled = isEnabled; TokenRefreshExtensionHours = tokenRefreshExtensionHours; @@ -82,13 +82,7 @@ internal ContainerAppTokenStore(bool? isEnabled, double? tokenRefreshExtensionHo [WirePath("tokenRefreshExtensionHours")] public double? TokenRefreshExtensionHours { get; set; } /// The configuration settings of the storage of the tokens if blob storage is used. - internal BlobStorageTokenStore AzureBlobStorage { get; set; } - /// The name of the app secrets containing the SAS URL of the blob storage containing the tokens. - [WirePath("azureBlobStorage.sasUrlSettingName")] - public string AzureBlobStorageSasUrlSettingName - { - get => AzureBlobStorage is null ? default : AzureBlobStorage.SasUrlSettingName; - set => AzureBlobStorage = new BlobStorageTokenStore(value); - } + [WirePath("azureBlobStorage")] + public ContainerAppBlobStorageTokenStore AzureBlobStorage { get; set; } } } diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/ContainerAppWeekDay.Serialization.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/ContainerAppWeekDay.Serialization.cs new file mode 100644 index 000000000000..08546866e728 --- /dev/null +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/ContainerAppWeekDay.Serialization.cs @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Azure.ResourceManager.AppContainers.Models +{ + internal static partial class ContainerAppWeekDayExtensions + { + public static string ToSerialString(this ContainerAppWeekDay value) => value switch + { + ContainerAppWeekDay.Monday => "Monday", + ContainerAppWeekDay.Tuesday => "Tuesday", + ContainerAppWeekDay.Wednesday => "Wednesday", + ContainerAppWeekDay.Thursday => "Thursday", + ContainerAppWeekDay.Friday => "Friday", + ContainerAppWeekDay.Saturday => "Saturday", + ContainerAppWeekDay.Sunday => "Sunday", + _ => throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown ContainerAppWeekDay value.") + }; + + public static ContainerAppWeekDay ToContainerAppWeekDay(this string value) + { + if (StringComparer.OrdinalIgnoreCase.Equals(value, "Monday")) return ContainerAppWeekDay.Monday; + if (StringComparer.OrdinalIgnoreCase.Equals(value, "Tuesday")) return ContainerAppWeekDay.Tuesday; + if (StringComparer.OrdinalIgnoreCase.Equals(value, "Wednesday")) return ContainerAppWeekDay.Wednesday; + if (StringComparer.OrdinalIgnoreCase.Equals(value, "Thursday")) return ContainerAppWeekDay.Thursday; + if (StringComparer.OrdinalIgnoreCase.Equals(value, "Friday")) return ContainerAppWeekDay.Friday; + if (StringComparer.OrdinalIgnoreCase.Equals(value, "Saturday")) return ContainerAppWeekDay.Saturday; + if (StringComparer.OrdinalIgnoreCase.Equals(value, "Sunday")) return ContainerAppWeekDay.Sunday; + throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown ContainerAppWeekDay value."); + } + } +} diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/ContainerAppWeekDay.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/ContainerAppWeekDay.cs new file mode 100644 index 000000000000..c742bf2d2046 --- /dev/null +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/ContainerAppWeekDay.cs @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Azure.ResourceManager.AppContainers.Models +{ + /// Day of the week when a managed environment can be patched. + public enum ContainerAppWeekDay + { + /// Monday. + Monday, + /// Tuesday. + Tuesday, + /// Wednesday. + Wednesday, + /// Thursday. + Thursday, + /// Friday. + Friday, + /// Saturday. + Saturday, + /// Sunday. + Sunday + } +} diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/ContainerAppWorkflowArtifacts.Serialization.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/ContainerAppWorkflowArtifacts.Serialization.cs new file mode 100644 index 000000000000..9e3e7c545ea8 --- /dev/null +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/ContainerAppWorkflowArtifacts.Serialization.cs @@ -0,0 +1,187 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.AppContainers.Models +{ + public partial class ContainerAppWorkflowArtifacts : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ContainerAppWorkflowArtifacts)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(AppSettings)) + { + writer.WritePropertyName("appSettings"u8); +#if NET6_0_OR_GREATER + writer.WriteRawValue(AppSettings); +#else + using (JsonDocument document = JsonDocument.Parse(AppSettings, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + if (Optional.IsDefined(Files)) + { + writer.WritePropertyName("files"u8); +#if NET6_0_OR_GREATER + writer.WriteRawValue(Files); +#else + using (JsonDocument document = JsonDocument.Parse(Files, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + if (Optional.IsCollectionDefined(FilesToDelete)) + { + writer.WritePropertyName("filesToDelete"u8); + writer.WriteStartArray(); + foreach (var item in FilesToDelete) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + ContainerAppWorkflowArtifacts IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ContainerAppWorkflowArtifacts)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeContainerAppWorkflowArtifacts(document.RootElement, options); + } + + internal static ContainerAppWorkflowArtifacts DeserializeContainerAppWorkflowArtifacts(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + BinaryData appSettings = default; + BinaryData files = default; + IList filesToDelete = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("appSettings"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + appSettings = BinaryData.FromString(property.Value.GetRawText()); + continue; + } + if (property.NameEquals("files"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + files = BinaryData.FromString(property.Value.GetRawText()); + continue; + } + if (property.NameEquals("filesToDelete"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + filesToDelete = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ContainerAppWorkflowArtifacts(appSettings, files, filesToDelete ?? new ChangeTrackingList(), serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerAppContainersContext.Default); + default: + throw new FormatException($"The model {nameof(ContainerAppWorkflowArtifacts)} does not support writing '{options.Format}' format."); + } + } + + ContainerAppWorkflowArtifacts IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeContainerAppWorkflowArtifacts(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ContainerAppWorkflowArtifacts)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/ContainerAppWorkflowArtifacts.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/ContainerAppWorkflowArtifacts.cs new file mode 100644 index 000000000000..bf10e631034c --- /dev/null +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/ContainerAppWorkflowArtifacts.cs @@ -0,0 +1,135 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.AppContainers.Models +{ + /// The workflow filter. + public partial class ContainerAppWorkflowArtifacts + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public ContainerAppWorkflowArtifacts() + { + FilesToDelete = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// Application settings of the workflow. + /// Files of the app. + /// Files of the app to delete. + /// Keeps track of any properties unknown to the library. + internal ContainerAppWorkflowArtifacts(BinaryData appSettings, BinaryData files, IList filesToDelete, IDictionary serializedAdditionalRawData) + { + AppSettings = appSettings; + Files = files; + FilesToDelete = filesToDelete; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// + /// Application settings of the workflow. + /// + /// To assign an object to this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + [WirePath("appSettings")] + public BinaryData AppSettings { get; set; } + /// + /// Files of the app. + /// + /// To assign an object to this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + [WirePath("files")] + public BinaryData Files { get; set; } + /// Files of the app to delete. + [WirePath("filesToDelete")] + public IList FilesToDelete { get; } + } +} diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/ContainerAppWorkflowEnvelopeProperties.Serialization.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/ContainerAppWorkflowEnvelopeProperties.Serialization.cs new file mode 100644 index 000000000000..98c44435833f --- /dev/null +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/ContainerAppWorkflowEnvelopeProperties.Serialization.cs @@ -0,0 +1,233 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.AppContainers.Models +{ + public partial class ContainerAppWorkflowEnvelopeProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ContainerAppWorkflowEnvelopeProperties)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(Files)) + { + writer.WritePropertyName("files"u8); +#if NET6_0_OR_GREATER + writer.WriteRawValue(Files); +#else + using (JsonDocument document = JsonDocument.Parse(Files, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + if (Optional.IsDefined(FlowState)) + { + writer.WritePropertyName("flowState"u8); + writer.WriteStringValue(FlowState.Value.ToString()); + } + if (Optional.IsDefined(Health)) + { + writer.WritePropertyName("health"u8); + writer.WriteObjectValue(Health, options); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + ContainerAppWorkflowEnvelopeProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ContainerAppWorkflowEnvelopeProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeContainerAppWorkflowEnvelopeProperties(document.RootElement, options); + } + + internal static ContainerAppWorkflowEnvelopeProperties DeserializeContainerAppWorkflowEnvelopeProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + BinaryData files = default; + ContainerAppWorkflowState? flowState = default; + ContainerAppWorkflowHealth health = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("files"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + files = BinaryData.FromString(property.Value.GetRawText()); + continue; + } + if (property.NameEquals("flowState"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + flowState = new ContainerAppWorkflowState(property.Value.GetString()); + continue; + } + if (property.NameEquals("health"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + health = ContainerAppWorkflowHealth.DeserializeContainerAppWorkflowHealth(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ContainerAppWorkflowEnvelopeProperties(files, flowState, health, serializedAdditionalRawData); + } + + private BinaryData SerializeBicep(ModelReaderWriterOptions options) + { + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Files), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" files: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Files)) + { + builder.Append(" files: "); + builder.AppendLine($"'{Files.ToString()}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(FlowState), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" flowState: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(FlowState)) + { + builder.Append(" flowState: "); + builder.AppendLine($"'{FlowState.Value.ToString()}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Health), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" health: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Health)) + { + builder.Append(" health: "); + BicepSerializationHelpers.AppendChildObject(builder, Health, options, 2, false, " health: "); + } + } + + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerAppContainersContext.Default); + case "bicep": + return SerializeBicep(options); + default: + throw new FormatException($"The model {nameof(ContainerAppWorkflowEnvelopeProperties)} does not support writing '{options.Format}' format."); + } + } + + ContainerAppWorkflowEnvelopeProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeContainerAppWorkflowEnvelopeProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ContainerAppWorkflowEnvelopeProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/ContainerAppWorkflowEnvelopeProperties.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/ContainerAppWorkflowEnvelopeProperties.cs new file mode 100644 index 000000000000..65a20b023555 --- /dev/null +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/ContainerAppWorkflowEnvelopeProperties.cs @@ -0,0 +1,105 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.AppContainers.Models +{ + /// Additional workflow properties. + public partial class ContainerAppWorkflowEnvelopeProperties + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + internal ContainerAppWorkflowEnvelopeProperties() + { + } + + /// Initializes a new instance of . + /// Gets or sets the files. + /// Gets or sets the state of the workflow. + /// Gets or sets workflow health. + /// Keeps track of any properties unknown to the library. + internal ContainerAppWorkflowEnvelopeProperties(BinaryData files, ContainerAppWorkflowState? flowState, ContainerAppWorkflowHealth health, IDictionary serializedAdditionalRawData) + { + Files = files; + FlowState = flowState; + Health = health; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// + /// Gets or sets the files. + /// + /// To assign an object to this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + [WirePath("files")] + public BinaryData Files { get; } + /// Gets or sets the state of the workflow. + [WirePath("flowState")] + public ContainerAppWorkflowState? FlowState { get; } + /// Gets or sets workflow health. + [WirePath("health")] + public ContainerAppWorkflowHealth Health { get; } + } +} diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/ContainerAppWorkflowHealth.Serialization.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/ContainerAppWorkflowHealth.Serialization.cs new file mode 100644 index 000000000000..f7ec7aed89d7 --- /dev/null +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/ContainerAppWorkflowHealth.Serialization.cs @@ -0,0 +1,186 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.AppContainers.Models +{ + public partial class ContainerAppWorkflowHealth : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ContainerAppWorkflowHealth)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("state"u8); + writer.WriteStringValue(State.ToSerialString()); + if (Optional.IsDefined(Error)) + { + writer.WritePropertyName("error"u8); + JsonSerializer.Serialize(writer, Error); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + ContainerAppWorkflowHealth IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ContainerAppWorkflowHealth)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeContainerAppWorkflowHealth(document.RootElement, options); + } + + internal static ContainerAppWorkflowHealth DeserializeContainerAppWorkflowHealth(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ContainerAppWorkflowHealthState state = default; + ResponseError error = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("state"u8)) + { + state = property.Value.GetString().ToContainerAppWorkflowHealthState(); + continue; + } + if (property.NameEquals("error"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + error = JsonSerializer.Deserialize(property.Value.GetRawText()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ContainerAppWorkflowHealth(state, error, serializedAdditionalRawData); + } + + private BinaryData SerializeBicep(ModelReaderWriterOptions options) + { + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(State), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" state: "); + builder.AppendLine(propertyOverride); + } + else + { + builder.Append(" state: "); + builder.AppendLine($"'{State.ToSerialString()}'"); + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Error), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" error: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Error)) + { + builder.Append(" error: "); + BicepSerializationHelpers.AppendChildObject(builder, Error, options, 2, false, " error: "); + } + } + + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerAppContainersContext.Default); + case "bicep": + return SerializeBicep(options); + default: + throw new FormatException($"The model {nameof(ContainerAppWorkflowHealth)} does not support writing '{options.Format}' format."); + } + } + + ContainerAppWorkflowHealth IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeContainerAppWorkflowHealth(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ContainerAppWorkflowHealth)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/ContainerAppWorkflowHealth.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/ContainerAppWorkflowHealth.cs new file mode 100644 index 000000000000..4c14aa3b688f --- /dev/null +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/ContainerAppWorkflowHealth.cs @@ -0,0 +1,78 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.AppContainers.Models +{ + /// Represents the workflow health. + public partial class ContainerAppWorkflowHealth + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// Gets or sets the workflow health state. + internal ContainerAppWorkflowHealth(ContainerAppWorkflowHealthState state) + { + State = state; + } + + /// Initializes a new instance of . + /// Gets or sets the workflow health state. + /// Gets or sets the workflow error. + /// Keeps track of any properties unknown to the library. + internal ContainerAppWorkflowHealth(ContainerAppWorkflowHealthState state, ResponseError error, IDictionary serializedAdditionalRawData) + { + State = state; + Error = error; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal ContainerAppWorkflowHealth() + { + } + + /// Gets or sets the workflow health state. + [WirePath("state")] + public ContainerAppWorkflowHealthState State { get; } + /// Gets or sets the workflow error. + [WirePath("error")] + public ResponseError Error { get; } + } +} diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/ContainerAppWorkflowHealthState.Serialization.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/ContainerAppWorkflowHealthState.Serialization.cs new file mode 100644 index 000000000000..3fd8b64d5026 --- /dev/null +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/ContainerAppWorkflowHealthState.Serialization.cs @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Azure.ResourceManager.AppContainers.Models +{ + internal static partial class ContainerAppWorkflowHealthStateExtensions + { + public static string ToSerialString(this ContainerAppWorkflowHealthState value) => value switch + { + ContainerAppWorkflowHealthState.Unknown => "Unknown", + ContainerAppWorkflowHealthState.NotSpecified => "NotSpecified", + ContainerAppWorkflowHealthState.Healthy => "Healthy", + ContainerAppWorkflowHealthState.Unhealthy => "Unhealthy", + _ => throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown ContainerAppWorkflowHealthState value.") + }; + + public static ContainerAppWorkflowHealthState ToContainerAppWorkflowHealthState(this string value) + { + if (StringComparer.OrdinalIgnoreCase.Equals(value, "Unknown")) return ContainerAppWorkflowHealthState.Unknown; + if (StringComparer.OrdinalIgnoreCase.Equals(value, "NotSpecified")) return ContainerAppWorkflowHealthState.NotSpecified; + if (StringComparer.OrdinalIgnoreCase.Equals(value, "Healthy")) return ContainerAppWorkflowHealthState.Healthy; + if (StringComparer.OrdinalIgnoreCase.Equals(value, "Unhealthy")) return ContainerAppWorkflowHealthState.Unhealthy; + throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown ContainerAppWorkflowHealthState value."); + } + } +} diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/ContainerAppWorkflowHealthState.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/ContainerAppWorkflowHealthState.cs new file mode 100644 index 000000000000..32e6c6154500 --- /dev/null +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/ContainerAppWorkflowHealthState.cs @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Azure.ResourceManager.AppContainers.Models +{ + /// Gets or sets the workflow health state. + public enum ContainerAppWorkflowHealthState + { + /// Unknown. + Unknown, + /// NotSpecified. + NotSpecified, + /// Healthy. + Healthy, + /// Unhealthy. + Unhealthy + } +} diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/ContainerAppWorkflowState.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/ContainerAppWorkflowState.cs new file mode 100644 index 000000000000..69c995926e05 --- /dev/null +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/ContainerAppWorkflowState.cs @@ -0,0 +1,63 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.AppContainers.Models +{ + /// The workflow state. + public readonly partial struct ContainerAppWorkflowState : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public ContainerAppWorkflowState(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string NotSpecifiedValue = "NotSpecified"; + private const string CompletedValue = "Completed"; + private const string EnabledValue = "Enabled"; + private const string DisabledValue = "Disabled"; + private const string DeletedValue = "Deleted"; + private const string SuspendedValue = "Suspended"; + + /// NotSpecified. + public static ContainerAppWorkflowState NotSpecified { get; } = new ContainerAppWorkflowState(NotSpecifiedValue); + /// Completed. + public static ContainerAppWorkflowState Completed { get; } = new ContainerAppWorkflowState(CompletedValue); + /// Enabled. + public static ContainerAppWorkflowState Enabled { get; } = new ContainerAppWorkflowState(EnabledValue); + /// Disabled. + public static ContainerAppWorkflowState Disabled { get; } = new ContainerAppWorkflowState(DisabledValue); + /// Deleted. + public static ContainerAppWorkflowState Deleted { get; } = new ContainerAppWorkflowState(DeletedValue); + /// Suspended. + public static ContainerAppWorkflowState Suspended { get; } = new ContainerAppWorkflowState(SuspendedValue); + /// Determines if two values are the same. + public static bool operator ==(ContainerAppWorkflowState left, ContainerAppWorkflowState right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(ContainerAppWorkflowState left, ContainerAppWorkflowState right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator ContainerAppWorkflowState(string value) => new ContainerAppWorkflowState(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is ContainerAppWorkflowState other && Equals(other); + /// + public bool Equals(ContainerAppWorkflowState other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/ContainerAppWorkloadProfile.Serialization.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/ContainerAppWorkloadProfile.Serialization.cs index 8e52414fde1b..1cf0c25bb24a 100644 --- a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/ContainerAppWorkloadProfile.Serialization.cs +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/ContainerAppWorkloadProfile.Serialization.cs @@ -37,6 +37,11 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WritePropertyName("name"u8); writer.WriteStringValue(Name); + if (Optional.IsDefined(EnableFips)) + { + writer.WritePropertyName("enableFips"u8); + writer.WriteBooleanValue(EnableFips.Value); + } writer.WritePropertyName("workloadProfileType"u8); writer.WriteStringValue(WorkloadProfileType); if (Optional.IsDefined(MinimumNodeCount)) @@ -87,6 +92,7 @@ internal static ContainerAppWorkloadProfile DeserializeContainerAppWorkloadProfi return null; } string name = default; + bool? enableFips = default; string workloadProfileType = default; int? minimumCount = default; int? maximumCount = default; @@ -99,6 +105,15 @@ internal static ContainerAppWorkloadProfile DeserializeContainerAppWorkloadProfi name = property.Value.GetString(); continue; } + if (property.NameEquals("enableFips"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + enableFips = property.Value.GetBoolean(); + continue; + } if (property.NameEquals("workloadProfileType"u8)) { workloadProfileType = property.Value.GetString(); @@ -128,7 +143,13 @@ internal static ContainerAppWorkloadProfile DeserializeContainerAppWorkloadProfi } } serializedAdditionalRawData = rawDataDictionary; - return new ContainerAppWorkloadProfile(name, workloadProfileType, minimumCount, maximumCount, serializedAdditionalRawData); + return new ContainerAppWorkloadProfile( + name, + enableFips, + workloadProfileType, + minimumCount, + maximumCount, + serializedAdditionalRawData); } private BinaryData SerializeBicep(ModelReaderWriterOptions options) @@ -165,6 +186,22 @@ private BinaryData SerializeBicep(ModelReaderWriterOptions options) } } + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(EnableFips), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" enableFips: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(EnableFips)) + { + builder.Append(" enableFips: "); + var boolValue = EnableFips.Value == true ? "true" : "false"; + builder.AppendLine($"{boolValue}"); + } + } + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(WorkloadProfileType), out propertyOverride); if (hasPropertyOverride) { diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/ContainerAppWorkloadProfile.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/ContainerAppWorkloadProfile.cs index 506df6854a80..7fbd3364120a 100644 --- a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/ContainerAppWorkloadProfile.cs +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/ContainerAppWorkloadProfile.cs @@ -60,13 +60,15 @@ public ContainerAppWorkloadProfile(string name, string workloadProfileType) /// Initializes a new instance of . /// Workload profile type for the workloads to run on. + /// Whether to use a FIPS-enabled OS. Supported only for dedicated workload profiles. /// Workload profile type for the workloads to run on. /// The minimum capacity. /// The maximum capacity. /// Keeps track of any properties unknown to the library. - internal ContainerAppWorkloadProfile(string name, string workloadProfileType, int? minimumNodeCount, int? maximumNodeCount, IDictionary serializedAdditionalRawData) + internal ContainerAppWorkloadProfile(string name, bool? enableFips, string workloadProfileType, int? minimumNodeCount, int? maximumNodeCount, IDictionary serializedAdditionalRawData) { Name = name; + EnableFips = enableFips; WorkloadProfileType = workloadProfileType; MinimumNodeCount = minimumNodeCount; MaximumNodeCount = maximumNodeCount; @@ -81,6 +83,9 @@ internal ContainerAppWorkloadProfile() /// Workload profile type for the workloads to run on. [WirePath("name")] public string Name { get; set; } + /// Whether to use a FIPS-enabled OS. Supported only for dedicated workload profiles. + [WirePath("enableFips")] + public bool? EnableFips { get; set; } /// Workload profile type for the workloads to run on. [WirePath("workloadProfileType")] public string WorkloadProfileType { get; set; } diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/ContainerAppsBuildCollection.Serialization.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/ContainerAppsBuildCollection.Serialization.cs new file mode 100644 index 000000000000..6d5e682e667a --- /dev/null +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/ContainerAppsBuildCollection.Serialization.cs @@ -0,0 +1,208 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.AppContainers.Models +{ + internal partial class ContainerAppsBuildCollection : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ContainerAppsBuildCollection)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("value"u8); + writer.WriteStartArray(); + foreach (var item in Value) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + if (Optional.IsDefined(NextLink)) + { + writer.WritePropertyName("nextLink"u8); + writer.WriteStringValue(NextLink.AbsoluteUri); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + ContainerAppsBuildCollection IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ContainerAppsBuildCollection)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeContainerAppsBuildCollection(document.RootElement, options); + } + + internal static ContainerAppsBuildCollection DeserializeContainerAppsBuildCollection(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IReadOnlyList value = default; + Uri nextLink = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(ContainerAppsBuildResourceData.DeserializeContainerAppsBuildResourceData(item, options)); + } + value = array; + continue; + } + if (property.NameEquals("nextLink"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + nextLink = new Uri(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ContainerAppsBuildCollection(value, nextLink, serializedAdditionalRawData); + } + + private BinaryData SerializeBicep(ModelReaderWriterOptions options) + { + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Value), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" value: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsCollectionDefined(Value)) + { + if (Value.Any()) + { + builder.Append(" value: "); + builder.AppendLine("["); + foreach (var item in Value) + { + BicepSerializationHelpers.AppendChildObject(builder, item, options, 4, true, " value: "); + } + builder.AppendLine(" ]"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(NextLink), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" nextLink: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(NextLink)) + { + builder.Append(" nextLink: "); + builder.AppendLine($"'{NextLink.AbsoluteUri}'"); + } + } + + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerAppContainersContext.Default); + case "bicep": + return SerializeBicep(options); + default: + throw new FormatException($"The model {nameof(ContainerAppsBuildCollection)} does not support writing '{options.Format}' format."); + } + } + + ContainerAppsBuildCollection IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeContainerAppsBuildCollection(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ContainerAppsBuildCollection)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/ContainerAppsBuildCollection.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/ContainerAppsBuildCollection.cs new file mode 100644 index 000000000000..214acd39cd3f --- /dev/null +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/ContainerAppsBuildCollection.cs @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.ResourceManager.AppContainers.Models +{ + /// The response of a Container Apps Build Resource list operation. + internal partial class ContainerAppsBuildCollection + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The Container Apps Build Resource items on this page. + /// is null. + internal ContainerAppsBuildCollection(IEnumerable value) + { + Argument.AssertNotNull(value, nameof(value)); + + Value = value.ToList(); + } + + /// Initializes a new instance of . + /// The Container Apps Build Resource items on this page. + /// The link to the next page of items. + /// Keeps track of any properties unknown to the library. + internal ContainerAppsBuildCollection(IReadOnlyList value, Uri nextLink, IDictionary serializedAdditionalRawData) + { + Value = value; + NextLink = nextLink; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal ContainerAppsBuildCollection() + { + } + + /// The Container Apps Build Resource items on this page. + public IReadOnlyList Value { get; } + /// The link to the next page of items. + public Uri NextLink { get; } + } +} diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/ContainerAppsBuildConfiguration.Serialization.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/ContainerAppsBuildConfiguration.Serialization.cs new file mode 100644 index 000000000000..9e645cbdecac --- /dev/null +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/ContainerAppsBuildConfiguration.Serialization.cs @@ -0,0 +1,341 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.AppContainers.Models +{ + public partial class ContainerAppsBuildConfiguration : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ContainerAppsBuildConfiguration)} does not support writing '{format}' format."); + } + + if (options.Format != "W" && Optional.IsDefined(BaseOS)) + { + writer.WritePropertyName("baseOs"u8); + writer.WriteStringValue(BaseOS); + } + if (options.Format != "W" && Optional.IsDefined(Platform)) + { + writer.WritePropertyName("platform"u8); + writer.WriteStringValue(Platform); + } + if (options.Format != "W" && Optional.IsDefined(PlatformVersion)) + { + writer.WritePropertyName("platformVersion"u8); + writer.WriteStringValue(PlatformVersion); + } + if (options.Format != "W" && Optional.IsCollectionDefined(EnvironmentVariables)) + { + writer.WritePropertyName("environmentVariables"u8); + writer.WriteStartArray(); + foreach (var item in EnvironmentVariables) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && Optional.IsCollectionDefined(PreBuildSteps)) + { + writer.WritePropertyName("preBuildSteps"u8); + writer.WriteStartArray(); + foreach (var item in PreBuildSteps) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + ContainerAppsBuildConfiguration IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ContainerAppsBuildConfiguration)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeContainerAppsBuildConfiguration(document.RootElement, options); + } + + internal static ContainerAppsBuildConfiguration DeserializeContainerAppsBuildConfiguration(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string baseOS = default; + string platform = default; + string platformVersion = default; + IReadOnlyList environmentVariables = default; + IReadOnlyList preBuildSteps = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("baseOs"u8)) + { + baseOS = property.Value.GetString(); + continue; + } + if (property.NameEquals("platform"u8)) + { + platform = property.Value.GetString(); + continue; + } + if (property.NameEquals("platformVersion"u8)) + { + platformVersion = property.Value.GetString(); + continue; + } + if (property.NameEquals("environmentVariables"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(ContainerAppSimpleEnvironmentVariable.DeserializeContainerAppSimpleEnvironmentVariable(item, options)); + } + environmentVariables = array; + continue; + } + if (property.NameEquals("preBuildSteps"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(PreBuildStep.DeserializePreBuildStep(item, options)); + } + preBuildSteps = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ContainerAppsBuildConfiguration( + baseOS, + platform, + platformVersion, + environmentVariables ?? new ChangeTrackingList(), + preBuildSteps ?? new ChangeTrackingList(), + serializedAdditionalRawData); + } + + private BinaryData SerializeBicep(ModelReaderWriterOptions options) + { + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(BaseOS), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" baseOs: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(BaseOS)) + { + builder.Append(" baseOs: "); + if (BaseOS.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{BaseOS}'''"); + } + else + { + builder.AppendLine($"'{BaseOS}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Platform), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" platform: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Platform)) + { + builder.Append(" platform: "); + if (Platform.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{Platform}'''"); + } + else + { + builder.AppendLine($"'{Platform}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(PlatformVersion), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" platformVersion: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(PlatformVersion)) + { + builder.Append(" platformVersion: "); + if (PlatformVersion.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{PlatformVersion}'''"); + } + else + { + builder.AppendLine($"'{PlatformVersion}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(EnvironmentVariables), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" environmentVariables: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsCollectionDefined(EnvironmentVariables)) + { + if (EnvironmentVariables.Any()) + { + builder.Append(" environmentVariables: "); + builder.AppendLine("["); + foreach (var item in EnvironmentVariables) + { + BicepSerializationHelpers.AppendChildObject(builder, item, options, 4, true, " environmentVariables: "); + } + builder.AppendLine(" ]"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(PreBuildSteps), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" preBuildSteps: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsCollectionDefined(PreBuildSteps)) + { + if (PreBuildSteps.Any()) + { + builder.Append(" preBuildSteps: "); + builder.AppendLine("["); + foreach (var item in PreBuildSteps) + { + BicepSerializationHelpers.AppendChildObject(builder, item, options, 4, true, " preBuildSteps: "); + } + builder.AppendLine(" ]"); + } + } + } + + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerAppContainersContext.Default); + case "bicep": + return SerializeBicep(options); + default: + throw new FormatException($"The model {nameof(ContainerAppsBuildConfiguration)} does not support writing '{options.Format}' format."); + } + } + + ContainerAppsBuildConfiguration IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeContainerAppsBuildConfiguration(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ContainerAppsBuildConfiguration)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/ContainerAppsBuildConfiguration.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/ContainerAppsBuildConfiguration.cs new file mode 100644 index 000000000000..7560205f3033 --- /dev/null +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/ContainerAppsBuildConfiguration.cs @@ -0,0 +1,88 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.AppContainers.Models +{ + /// Configuration of the build. + public partial class ContainerAppsBuildConfiguration + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + internal ContainerAppsBuildConfiguration() + { + EnvironmentVariables = new ChangeTrackingList(); + PreBuildSteps = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// Base OS used to build and run the app. + /// Platform to be used to build and run the app. + /// Platform version to be used to build and run the app. + /// List of environment variables to be passed to the build, secrets should not be used in environment variable. + /// List of steps to perform before the build. + /// Keeps track of any properties unknown to the library. + internal ContainerAppsBuildConfiguration(string baseOS, string platform, string platformVersion, IReadOnlyList environmentVariables, IReadOnlyList preBuildSteps, IDictionary serializedAdditionalRawData) + { + BaseOS = baseOS; + Platform = platform; + PlatformVersion = platformVersion; + EnvironmentVariables = environmentVariables; + PreBuildSteps = preBuildSteps; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Base OS used to build and run the app. + [WirePath("baseOs")] + public string BaseOS { get; } + /// Platform to be used to build and run the app. + [WirePath("platform")] + public string Platform { get; } + /// Platform version to be used to build and run the app. + [WirePath("platformVersion")] + public string PlatformVersion { get; } + /// List of environment variables to be passed to the build, secrets should not be used in environment variable. + [WirePath("environmentVariables")] + public IReadOnlyList EnvironmentVariables { get; } + /// List of steps to perform before the build. + [WirePath("preBuildSteps")] + public IReadOnlyList PreBuildSteps { get; } + } +} diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/ContainerExecutionStatus.Serialization.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/ContainerExecutionStatus.Serialization.cs new file mode 100644 index 000000000000..c9e00cb730d9 --- /dev/null +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/ContainerExecutionStatus.Serialization.cs @@ -0,0 +1,268 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.AppContainers.Models +{ + public partial class ContainerExecutionStatus : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ContainerExecutionStatus)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(Name)) + { + writer.WritePropertyName("name"u8); + writer.WriteStringValue(Name); + } + if (Optional.IsDefined(Code)) + { + writer.WritePropertyName("code"u8); + writer.WriteNumberValue(Code.Value); + } + if (Optional.IsDefined(AdditionalInformation)) + { + writer.WritePropertyName("additionalInformation"u8); + writer.WriteStringValue(AdditionalInformation); + } + if (Optional.IsDefined(Status)) + { + writer.WritePropertyName("status"u8); + writer.WriteStringValue(Status); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + ContainerExecutionStatus IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ContainerExecutionStatus)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeContainerExecutionStatus(document.RootElement, options); + } + + internal static ContainerExecutionStatus DeserializeContainerExecutionStatus(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string name = default; + int? code = default; + string additionalInformation = default; + string status = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("code"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + code = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("additionalInformation"u8)) + { + additionalInformation = property.Value.GetString(); + continue; + } + if (property.NameEquals("status"u8)) + { + status = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ContainerExecutionStatus(name, code, additionalInformation, status, serializedAdditionalRawData); + } + + private BinaryData SerializeBicep(ModelReaderWriterOptions options) + { + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Name), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" name: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Name)) + { + builder.Append(" name: "); + if (Name.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{Name}'''"); + } + else + { + builder.AppendLine($"'{Name}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Code), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" code: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Code)) + { + builder.Append(" code: "); + builder.AppendLine($"{Code.Value}"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(AdditionalInformation), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" additionalInformation: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(AdditionalInformation)) + { + builder.Append(" additionalInformation: "); + if (AdditionalInformation.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{AdditionalInformation}'''"); + } + else + { + builder.AppendLine($"'{AdditionalInformation}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Status), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" status: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Status)) + { + builder.Append(" status: "); + if (Status.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{Status}'''"); + } + else + { + builder.AppendLine($"'{Status}'"); + } + } + } + + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerAppContainersContext.Default); + case "bicep": + return SerializeBicep(options); + default: + throw new FormatException($"The model {nameof(ContainerExecutionStatus)} does not support writing '{options.Format}' format."); + } + } + + ContainerExecutionStatus IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeContainerExecutionStatus(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ContainerExecutionStatus)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/ContainerExecutionStatus.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/ContainerExecutionStatus.cs new file mode 100644 index 000000000000..ca9ce74275a1 --- /dev/null +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/ContainerExecutionStatus.cs @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.AppContainers.Models +{ + /// Container Apps Job execution container status. Contains status code and reason. + public partial class ContainerExecutionStatus + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + internal ContainerExecutionStatus() + { + } + + /// Initializes a new instance of . + /// Container Name. + /// Exit code. + /// Additional information for the container status. + /// Status of the container. + /// Keeps track of any properties unknown to the library. + internal ContainerExecutionStatus(string name, int? code, string additionalInformation, string status, IDictionary serializedAdditionalRawData) + { + Name = name; + Code = code; + AdditionalInformation = additionalInformation; + Status = status; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Container Name. + [WirePath("name")] + public string Name { get; } + /// Exit code. + [WirePath("code")] + public int? Code { get; } + /// Additional information for the container status. + [WirePath("additionalInformation")] + public string AdditionalInformation { get; } + /// Status of the container. + [WirePath("status")] + public string Status { get; } + } +} diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/ContainerRegistryWithCustomImage.Serialization.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/ContainerRegistryWithCustomImage.Serialization.cs new file mode 100644 index 000000000000..234b89985c9b --- /dev/null +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/ContainerRegistryWithCustomImage.Serialization.cs @@ -0,0 +1,201 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.AppContainers.Models +{ + public partial class ContainerRegistryWithCustomImage : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ContainerRegistryWithCustomImage)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("server"u8); + writer.WriteStringValue(Server); + if (Optional.IsDefined(Image)) + { + writer.WritePropertyName("image"u8); + writer.WriteStringValue(Image); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + ContainerRegistryWithCustomImage IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ContainerRegistryWithCustomImage)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeContainerRegistryWithCustomImage(document.RootElement, options); + } + + internal static ContainerRegistryWithCustomImage DeserializeContainerRegistryWithCustomImage(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string server = default; + string image = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("server"u8)) + { + server = property.Value.GetString(); + continue; + } + if (property.NameEquals("image"u8)) + { + image = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ContainerRegistryWithCustomImage(server, image, serializedAdditionalRawData); + } + + private BinaryData SerializeBicep(ModelReaderWriterOptions options) + { + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Server), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" server: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Server)) + { + builder.Append(" server: "); + if (Server.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{Server}'''"); + } + else + { + builder.AppendLine($"'{Server}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Image), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" image: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Image)) + { + builder.Append(" image: "); + if (Image.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{Image}'''"); + } + else + { + builder.AppendLine($"'{Image}'"); + } + } + } + + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerAppContainersContext.Default); + case "bicep": + return SerializeBicep(options); + default: + throw new FormatException($"The model {nameof(ContainerRegistryWithCustomImage)} does not support writing '{options.Format}' format."); + } + } + + ContainerRegistryWithCustomImage IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeContainerRegistryWithCustomImage(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ContainerRegistryWithCustomImage)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/ContainerRegistryWithCustomImage.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/ContainerRegistryWithCustomImage.cs new file mode 100644 index 000000000000..768af58ce7b4 --- /dev/null +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/ContainerRegistryWithCustomImage.cs @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.AppContainers.Models +{ + /// Container registry that the final image will be uploaded to. + public partial class ContainerRegistryWithCustomImage + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// Login server of the container registry that the final image should be uploaded to. Builder resource needs to have this container registry defined along with an identity to use to access it. + /// is null. + public ContainerRegistryWithCustomImage(string server) + { + Argument.AssertNotNull(server, nameof(server)); + + Server = server; + } + + /// Initializes a new instance of . + /// Login server of the container registry that the final image should be uploaded to. Builder resource needs to have this container registry defined along with an identity to use to access it. + /// Full name that the final image should be uploaded as, including both image name and tag. + /// Keeps track of any properties unknown to the library. + internal ContainerRegistryWithCustomImage(string server, string image, IDictionary serializedAdditionalRawData) + { + Server = server; + Image = image; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal ContainerRegistryWithCustomImage() + { + } + + /// Login server of the container registry that the final image should be uploaded to. Builder resource needs to have this container registry defined along with an identity to use to access it. + [WirePath("server")] + public string Server { get; set; } + /// Full name that the final image should be uploaded as, including both image name and tag. + [WirePath("image")] + public string Image { get; set; } + } +} diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/DaprAppHealth.Serialization.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/DaprAppHealth.Serialization.cs new file mode 100644 index 000000000000..4a3991583b9b --- /dev/null +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/DaprAppHealth.Serialization.cs @@ -0,0 +1,297 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.AppContainers.Models +{ + public partial class DaprAppHealth : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DaprAppHealth)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(IsEnabled)) + { + writer.WritePropertyName("enabled"u8); + writer.WriteBooleanValue(IsEnabled.Value); + } + if (Optional.IsDefined(Path)) + { + writer.WritePropertyName("path"u8); + writer.WriteStringValue(Path); + } + if (Optional.IsDefined(ProbeIntervalSeconds)) + { + writer.WritePropertyName("probeIntervalSeconds"u8); + writer.WriteNumberValue(ProbeIntervalSeconds.Value); + } + if (Optional.IsDefined(ProbeTimeoutMilliseconds)) + { + writer.WritePropertyName("probeTimeoutMilliseconds"u8); + writer.WriteNumberValue(ProbeTimeoutMilliseconds.Value); + } + if (Optional.IsDefined(Threshold)) + { + writer.WritePropertyName("threshold"u8); + writer.WriteNumberValue(Threshold.Value); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + DaprAppHealth IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DaprAppHealth)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDaprAppHealth(document.RootElement, options); + } + + internal static DaprAppHealth DeserializeDaprAppHealth(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + bool? enabled = default; + string path = default; + int? probeIntervalSeconds = default; + int? probeTimeoutMilliseconds = default; + int? threshold = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("enabled"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + enabled = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("path"u8)) + { + path = property.Value.GetString(); + continue; + } + if (property.NameEquals("probeIntervalSeconds"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + probeIntervalSeconds = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("probeTimeoutMilliseconds"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + probeTimeoutMilliseconds = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("threshold"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + threshold = property.Value.GetInt32(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DaprAppHealth( + enabled, + path, + probeIntervalSeconds, + probeTimeoutMilliseconds, + threshold, + serializedAdditionalRawData); + } + + private BinaryData SerializeBicep(ModelReaderWriterOptions options) + { + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(IsEnabled), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" enabled: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(IsEnabled)) + { + builder.Append(" enabled: "); + var boolValue = IsEnabled.Value == true ? "true" : "false"; + builder.AppendLine($"{boolValue}"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Path), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" path: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Path)) + { + builder.Append(" path: "); + if (Path.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{Path}'''"); + } + else + { + builder.AppendLine($"'{Path}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(ProbeIntervalSeconds), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" probeIntervalSeconds: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(ProbeIntervalSeconds)) + { + builder.Append(" probeIntervalSeconds: "); + builder.AppendLine($"{ProbeIntervalSeconds.Value}"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(ProbeTimeoutMilliseconds), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" probeTimeoutMilliseconds: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(ProbeTimeoutMilliseconds)) + { + builder.Append(" probeTimeoutMilliseconds: "); + builder.AppendLine($"{ProbeTimeoutMilliseconds.Value}"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Threshold), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" threshold: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Threshold)) + { + builder.Append(" threshold: "); + builder.AppendLine($"{Threshold.Value}"); + } + } + + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerAppContainersContext.Default); + case "bicep": + return SerializeBicep(options); + default: + throw new FormatException($"The model {nameof(DaprAppHealth)} does not support writing '{options.Format}' format."); + } + } + + DaprAppHealth IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeDaprAppHealth(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DaprAppHealth)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/DaprAppHealth.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/DaprAppHealth.cs new file mode 100644 index 000000000000..fd93f9888354 --- /dev/null +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/DaprAppHealth.cs @@ -0,0 +1,86 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.AppContainers.Models +{ + /// Dapr application health check configuration. + public partial class DaprAppHealth + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public DaprAppHealth() + { + } + + /// Initializes a new instance of . + /// Boolean indicating if the health probe is enabled. + /// Path for the health probe. + /// Interval for the health probe in seconds. + /// Timeout for the health probe in milliseconds. + /// Threshold for the health probe. + /// Keeps track of any properties unknown to the library. + internal DaprAppHealth(bool? isEnabled, string path, int? probeIntervalSeconds, int? probeTimeoutMilliseconds, int? threshold, IDictionary serializedAdditionalRawData) + { + IsEnabled = isEnabled; + Path = path; + ProbeIntervalSeconds = probeIntervalSeconds; + ProbeTimeoutMilliseconds = probeTimeoutMilliseconds; + Threshold = threshold; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Boolean indicating if the health probe is enabled. + [WirePath("enabled")] + public bool? IsEnabled { get; set; } + /// Path for the health probe. + [WirePath("path")] + public string Path { get; set; } + /// Interval for the health probe in seconds. + [WirePath("probeIntervalSeconds")] + public int? ProbeIntervalSeconds { get; set; } + /// Timeout for the health probe in milliseconds. + [WirePath("probeTimeoutMilliseconds")] + public int? ProbeTimeoutMilliseconds { get; set; } + /// Threshold for the health probe. + [WirePath("threshold")] + public int? Threshold { get; set; } + } +} diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/DaprComponentResiliencyPoliciesCollection.Serialization.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/DaprComponentResiliencyPoliciesCollection.Serialization.cs new file mode 100644 index 000000000000..8b4c9dcf9517 --- /dev/null +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/DaprComponentResiliencyPoliciesCollection.Serialization.cs @@ -0,0 +1,212 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.AppContainers.Models +{ + internal partial class DaprComponentResiliencyPoliciesCollection : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DaprComponentResiliencyPoliciesCollection)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("value"u8); + writer.WriteStartArray(); + foreach (var item in Value) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + if (options.Format != "W" && Optional.IsDefined(NextLink)) + { + writer.WritePropertyName("nextLink"u8); + writer.WriteStringValue(NextLink); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + DaprComponentResiliencyPoliciesCollection IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DaprComponentResiliencyPoliciesCollection)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDaprComponentResiliencyPoliciesCollection(document.RootElement, options); + } + + internal static DaprComponentResiliencyPoliciesCollection DeserializeDaprComponentResiliencyPoliciesCollection(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IReadOnlyList value = default; + string nextLink = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(DaprComponentResiliencyPolicyData.DeserializeDaprComponentResiliencyPolicyData(item, options)); + } + value = array; + continue; + } + if (property.NameEquals("nextLink"u8)) + { + nextLink = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DaprComponentResiliencyPoliciesCollection(value, nextLink, serializedAdditionalRawData); + } + + private BinaryData SerializeBicep(ModelReaderWriterOptions options) + { + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Value), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" value: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsCollectionDefined(Value)) + { + if (Value.Any()) + { + builder.Append(" value: "); + builder.AppendLine("["); + foreach (var item in Value) + { + BicepSerializationHelpers.AppendChildObject(builder, item, options, 4, true, " value: "); + } + builder.AppendLine(" ]"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(NextLink), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" nextLink: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(NextLink)) + { + builder.Append(" nextLink: "); + if (NextLink.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{NextLink}'''"); + } + else + { + builder.AppendLine($"'{NextLink}'"); + } + } + } + + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerAppContainersContext.Default); + case "bicep": + return SerializeBicep(options); + default: + throw new FormatException($"The model {nameof(DaprComponentResiliencyPoliciesCollection)} does not support writing '{options.Format}' format."); + } + } + + DaprComponentResiliencyPoliciesCollection IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeDaprComponentResiliencyPoliciesCollection(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DaprComponentResiliencyPoliciesCollection)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/DaprComponentResiliencyPoliciesCollection.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/DaprComponentResiliencyPoliciesCollection.cs new file mode 100644 index 000000000000..eded90a764b0 --- /dev/null +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/DaprComponentResiliencyPoliciesCollection.cs @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.ResourceManager.AppContainers.Models +{ + /// Dapr Component Resiliency Policies ARM resource. + internal partial class DaprComponentResiliencyPoliciesCollection + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// Collection of resources. + /// is null. + internal DaprComponentResiliencyPoliciesCollection(IEnumerable value) + { + Argument.AssertNotNull(value, nameof(value)); + + Value = value.ToList(); + } + + /// Initializes a new instance of . + /// Collection of resources. + /// Link to next page of resources. + /// Keeps track of any properties unknown to the library. + internal DaprComponentResiliencyPoliciesCollection(IReadOnlyList value, string nextLink, IDictionary serializedAdditionalRawData) + { + Value = value; + NextLink = nextLink; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal DaprComponentResiliencyPoliciesCollection() + { + } + + /// Collection of resources. + public IReadOnlyList Value { get; } + /// Link to next page of resources. + public string NextLink { get; } + } +} diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/DaprComponentResiliencyPolicyCircuitBreakerPolicyConfiguration.Serialization.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/DaprComponentResiliencyPolicyCircuitBreakerPolicyConfiguration.Serialization.cs new file mode 100644 index 000000000000..3ff5f4f17a10 --- /dev/null +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/DaprComponentResiliencyPolicyCircuitBreakerPolicyConfiguration.Serialization.cs @@ -0,0 +1,226 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.AppContainers.Models +{ + public partial class DaprComponentResiliencyPolicyCircuitBreakerPolicyConfiguration : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DaprComponentResiliencyPolicyCircuitBreakerPolicyConfiguration)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(ConsecutiveErrors)) + { + writer.WritePropertyName("consecutiveErrors"u8); + writer.WriteNumberValue(ConsecutiveErrors.Value); + } + if (Optional.IsDefined(TimeoutInSeconds)) + { + writer.WritePropertyName("timeoutInSeconds"u8); + writer.WriteNumberValue(TimeoutInSeconds.Value); + } + if (Optional.IsDefined(IntervalInSeconds)) + { + writer.WritePropertyName("intervalInSeconds"u8); + writer.WriteNumberValue(IntervalInSeconds.Value); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + DaprComponentResiliencyPolicyCircuitBreakerPolicyConfiguration IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DaprComponentResiliencyPolicyCircuitBreakerPolicyConfiguration)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDaprComponentResiliencyPolicyCircuitBreakerPolicyConfiguration(document.RootElement, options); + } + + internal static DaprComponentResiliencyPolicyCircuitBreakerPolicyConfiguration DeserializeDaprComponentResiliencyPolicyCircuitBreakerPolicyConfiguration(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + int? consecutiveErrors = default; + int? timeoutInSeconds = default; + int? intervalInSeconds = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("consecutiveErrors"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + consecutiveErrors = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("timeoutInSeconds"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + timeoutInSeconds = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("intervalInSeconds"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + intervalInSeconds = property.Value.GetInt32(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DaprComponentResiliencyPolicyCircuitBreakerPolicyConfiguration(consecutiveErrors, timeoutInSeconds, intervalInSeconds, serializedAdditionalRawData); + } + + private BinaryData SerializeBicep(ModelReaderWriterOptions options) + { + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(ConsecutiveErrors), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" consecutiveErrors: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(ConsecutiveErrors)) + { + builder.Append(" consecutiveErrors: "); + builder.AppendLine($"{ConsecutiveErrors.Value}"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(TimeoutInSeconds), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" timeoutInSeconds: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(TimeoutInSeconds)) + { + builder.Append(" timeoutInSeconds: "); + builder.AppendLine($"{TimeoutInSeconds.Value}"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(IntervalInSeconds), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" intervalInSeconds: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(IntervalInSeconds)) + { + builder.Append(" intervalInSeconds: "); + builder.AppendLine($"{IntervalInSeconds.Value}"); + } + } + + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerAppContainersContext.Default); + case "bicep": + return SerializeBicep(options); + default: + throw new FormatException($"The model {nameof(DaprComponentResiliencyPolicyCircuitBreakerPolicyConfiguration)} does not support writing '{options.Format}' format."); + } + } + + DaprComponentResiliencyPolicyCircuitBreakerPolicyConfiguration IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeDaprComponentResiliencyPolicyCircuitBreakerPolicyConfiguration(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DaprComponentResiliencyPolicyCircuitBreakerPolicyConfiguration)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/DaprComponentResiliencyPolicyCircuitBreakerPolicyConfiguration.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/DaprComponentResiliencyPolicyCircuitBreakerPolicyConfiguration.cs new file mode 100644 index 000000000000..847b23702651 --- /dev/null +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/DaprComponentResiliencyPolicyCircuitBreakerPolicyConfiguration.cs @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.AppContainers.Models +{ + /// Dapr Component Resiliency Policy Circuit Breaker Policy Configuration. + public partial class DaprComponentResiliencyPolicyCircuitBreakerPolicyConfiguration + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public DaprComponentResiliencyPolicyCircuitBreakerPolicyConfiguration() + { + } + + /// Initializes a new instance of . + /// The number of consecutive errors before the circuit is opened. + /// The interval in seconds until a retry attempt is made after the circuit is opened. + /// The optional interval in seconds after which the error count resets to 0. An interval of 0 will never reset. If not specified, the timeoutInSeconds value will be used. + /// Keeps track of any properties unknown to the library. + internal DaprComponentResiliencyPolicyCircuitBreakerPolicyConfiguration(int? consecutiveErrors, int? timeoutInSeconds, int? intervalInSeconds, IDictionary serializedAdditionalRawData) + { + ConsecutiveErrors = consecutiveErrors; + TimeoutInSeconds = timeoutInSeconds; + IntervalInSeconds = intervalInSeconds; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The number of consecutive errors before the circuit is opened. + [WirePath("consecutiveErrors")] + public int? ConsecutiveErrors { get; set; } + /// The interval in seconds until a retry attempt is made after the circuit is opened. + [WirePath("timeoutInSeconds")] + public int? TimeoutInSeconds { get; set; } + /// The optional interval in seconds after which the error count resets to 0. An interval of 0 will never reset. If not specified, the timeoutInSeconds value will be used. + [WirePath("intervalInSeconds")] + public int? IntervalInSeconds { get; set; } + } +} diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/DaprComponentResiliencyPolicyConfiguration.Serialization.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/DaprComponentResiliencyPolicyConfiguration.Serialization.cs new file mode 100644 index 000000000000..d00e3020aff1 --- /dev/null +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/DaprComponentResiliencyPolicyConfiguration.Serialization.cs @@ -0,0 +1,229 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.AppContainers.Models +{ + public partial class DaprComponentResiliencyPolicyConfiguration : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DaprComponentResiliencyPolicyConfiguration)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(HttpRetryPolicy)) + { + writer.WritePropertyName("httpRetryPolicy"u8); + writer.WriteObjectValue(HttpRetryPolicy, options); + } + if (Optional.IsDefined(TimeoutPolicy)) + { + writer.WritePropertyName("timeoutPolicy"u8); + writer.WriteObjectValue(TimeoutPolicy, options); + } + if (Optional.IsDefined(CircuitBreakerPolicy)) + { + writer.WritePropertyName("circuitBreakerPolicy"u8); + writer.WriteObjectValue(CircuitBreakerPolicy, options); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + DaprComponentResiliencyPolicyConfiguration IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DaprComponentResiliencyPolicyConfiguration)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDaprComponentResiliencyPolicyConfiguration(document.RootElement, options); + } + + internal static DaprComponentResiliencyPolicyConfiguration DeserializeDaprComponentResiliencyPolicyConfiguration(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + DaprComponentResiliencyPolicyHttpRetryPolicyConfiguration httpRetryPolicy = default; + DaprComponentResiliencyPolicyTimeoutPolicyConfiguration timeoutPolicy = default; + DaprComponentResiliencyPolicyCircuitBreakerPolicyConfiguration circuitBreakerPolicy = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("httpRetryPolicy"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + httpRetryPolicy = DaprComponentResiliencyPolicyHttpRetryPolicyConfiguration.DeserializeDaprComponentResiliencyPolicyHttpRetryPolicyConfiguration(property.Value, options); + continue; + } + if (property.NameEquals("timeoutPolicy"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + timeoutPolicy = DaprComponentResiliencyPolicyTimeoutPolicyConfiguration.DeserializeDaprComponentResiliencyPolicyTimeoutPolicyConfiguration(property.Value, options); + continue; + } + if (property.NameEquals("circuitBreakerPolicy"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + circuitBreakerPolicy = DaprComponentResiliencyPolicyCircuitBreakerPolicyConfiguration.DeserializeDaprComponentResiliencyPolicyCircuitBreakerPolicyConfiguration(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DaprComponentResiliencyPolicyConfiguration(httpRetryPolicy, timeoutPolicy, circuitBreakerPolicy, serializedAdditionalRawData); + } + + private BinaryData SerializeBicep(ModelReaderWriterOptions options) + { + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(HttpRetryPolicy), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" httpRetryPolicy: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(HttpRetryPolicy)) + { + builder.Append(" httpRetryPolicy: "); + BicepSerializationHelpers.AppendChildObject(builder, HttpRetryPolicy, options, 2, false, " httpRetryPolicy: "); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue("ResponseTimeoutInSeconds", out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" timeoutPolicy: "); + builder.AppendLine("{"); + builder.Append(" responseTimeoutInSeconds: "); + builder.AppendLine(propertyOverride); + builder.AppendLine(" }"); + } + else + { + if (Optional.IsDefined(TimeoutPolicy)) + { + builder.Append(" timeoutPolicy: "); + BicepSerializationHelpers.AppendChildObject(builder, TimeoutPolicy, options, 2, false, " timeoutPolicy: "); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(CircuitBreakerPolicy), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" circuitBreakerPolicy: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(CircuitBreakerPolicy)) + { + builder.Append(" circuitBreakerPolicy: "); + BicepSerializationHelpers.AppendChildObject(builder, CircuitBreakerPolicy, options, 2, false, " circuitBreakerPolicy: "); + } + } + + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerAppContainersContext.Default); + case "bicep": + return SerializeBicep(options); + default: + throw new FormatException($"The model {nameof(DaprComponentResiliencyPolicyConfiguration)} does not support writing '{options.Format}' format."); + } + } + + DaprComponentResiliencyPolicyConfiguration IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeDaprComponentResiliencyPolicyConfiguration(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DaprComponentResiliencyPolicyConfiguration)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/DaprComponentResiliencyPolicyConfiguration.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/DaprComponentResiliencyPolicyConfiguration.cs new file mode 100644 index 000000000000..831ec9c71696 --- /dev/null +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/DaprComponentResiliencyPolicyConfiguration.cs @@ -0,0 +1,88 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.AppContainers.Models +{ + /// Dapr Component Resiliency Policy Configuration. + public partial class DaprComponentResiliencyPolicyConfiguration + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public DaprComponentResiliencyPolicyConfiguration() + { + } + + /// Initializes a new instance of . + /// The optional HTTP retry policy configuration. + /// The optional timeout policy configuration. + /// The optional circuit breaker policy configuration. + /// Keeps track of any properties unknown to the library. + internal DaprComponentResiliencyPolicyConfiguration(DaprComponentResiliencyPolicyHttpRetryPolicyConfiguration httpRetryPolicy, DaprComponentResiliencyPolicyTimeoutPolicyConfiguration timeoutPolicy, DaprComponentResiliencyPolicyCircuitBreakerPolicyConfiguration circuitBreakerPolicy, IDictionary serializedAdditionalRawData) + { + HttpRetryPolicy = httpRetryPolicy; + TimeoutPolicy = timeoutPolicy; + CircuitBreakerPolicy = circuitBreakerPolicy; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The optional HTTP retry policy configuration. + [WirePath("httpRetryPolicy")] + public DaprComponentResiliencyPolicyHttpRetryPolicyConfiguration HttpRetryPolicy { get; set; } + /// The optional timeout policy configuration. + internal DaprComponentResiliencyPolicyTimeoutPolicyConfiguration TimeoutPolicy { get; set; } + /// The optional response timeout in seconds. + [WirePath("timeoutPolicy.responseTimeoutInSeconds")] + public int? ResponseTimeoutInSeconds + { + get => TimeoutPolicy is null ? default : TimeoutPolicy.ResponseTimeoutInSeconds; + set + { + if (TimeoutPolicy is null) + TimeoutPolicy = new DaprComponentResiliencyPolicyTimeoutPolicyConfiguration(); + TimeoutPolicy.ResponseTimeoutInSeconds = value; + } + } + + /// The optional circuit breaker policy configuration. + [WirePath("circuitBreakerPolicy")] + public DaprComponentResiliencyPolicyCircuitBreakerPolicyConfiguration CircuitBreakerPolicy { get; set; } + } +} diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/DaprComponentResiliencyPolicyHttpRetryBackOffConfiguration.Serialization.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/DaprComponentResiliencyPolicyHttpRetryBackOffConfiguration.Serialization.cs new file mode 100644 index 000000000000..0b92205b4087 --- /dev/null +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/DaprComponentResiliencyPolicyHttpRetryBackOffConfiguration.Serialization.cs @@ -0,0 +1,196 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.AppContainers.Models +{ + public partial class DaprComponentResiliencyPolicyHttpRetryBackOffConfiguration : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DaprComponentResiliencyPolicyHttpRetryBackOffConfiguration)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(InitialDelayInMilliseconds)) + { + writer.WritePropertyName("initialDelayInMilliseconds"u8); + writer.WriteNumberValue(InitialDelayInMilliseconds.Value); + } + if (Optional.IsDefined(MaxIntervalInMilliseconds)) + { + writer.WritePropertyName("maxIntervalInMilliseconds"u8); + writer.WriteNumberValue(MaxIntervalInMilliseconds.Value); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + DaprComponentResiliencyPolicyHttpRetryBackOffConfiguration IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DaprComponentResiliencyPolicyHttpRetryBackOffConfiguration)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDaprComponentResiliencyPolicyHttpRetryBackOffConfiguration(document.RootElement, options); + } + + internal static DaprComponentResiliencyPolicyHttpRetryBackOffConfiguration DeserializeDaprComponentResiliencyPolicyHttpRetryBackOffConfiguration(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + int? initialDelayInMilliseconds = default; + int? maxIntervalInMilliseconds = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("initialDelayInMilliseconds"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + initialDelayInMilliseconds = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("maxIntervalInMilliseconds"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + maxIntervalInMilliseconds = property.Value.GetInt32(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DaprComponentResiliencyPolicyHttpRetryBackOffConfiguration(initialDelayInMilliseconds, maxIntervalInMilliseconds, serializedAdditionalRawData); + } + + private BinaryData SerializeBicep(ModelReaderWriterOptions options) + { + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(InitialDelayInMilliseconds), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" initialDelayInMilliseconds: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(InitialDelayInMilliseconds)) + { + builder.Append(" initialDelayInMilliseconds: "); + builder.AppendLine($"{InitialDelayInMilliseconds.Value}"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(MaxIntervalInMilliseconds), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" maxIntervalInMilliseconds: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(MaxIntervalInMilliseconds)) + { + builder.Append(" maxIntervalInMilliseconds: "); + builder.AppendLine($"{MaxIntervalInMilliseconds.Value}"); + } + } + + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerAppContainersContext.Default); + case "bicep": + return SerializeBicep(options); + default: + throw new FormatException($"The model {nameof(DaprComponentResiliencyPolicyHttpRetryBackOffConfiguration)} does not support writing '{options.Format}' format."); + } + } + + DaprComponentResiliencyPolicyHttpRetryBackOffConfiguration IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeDaprComponentResiliencyPolicyHttpRetryBackOffConfiguration(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DaprComponentResiliencyPolicyHttpRetryBackOffConfiguration)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/DaprComponentResiliencyPolicyHttpRetryBackOffConfiguration.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/DaprComponentResiliencyPolicyHttpRetryBackOffConfiguration.cs new file mode 100644 index 000000000000..4178ece393be --- /dev/null +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/DaprComponentResiliencyPolicyHttpRetryBackOffConfiguration.cs @@ -0,0 +1,71 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.AppContainers.Models +{ + /// Dapr Component Resiliency Policy HTTP Retry Backoff Configuration. + public partial class DaprComponentResiliencyPolicyHttpRetryBackOffConfiguration + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public DaprComponentResiliencyPolicyHttpRetryBackOffConfiguration() + { + } + + /// Initializes a new instance of . + /// The optional initial delay in milliseconds before an operation is retried. + /// The optional maximum time interval in milliseconds between retry attempts. + /// Keeps track of any properties unknown to the library. + internal DaprComponentResiliencyPolicyHttpRetryBackOffConfiguration(int? initialDelayInMilliseconds, int? maxIntervalInMilliseconds, IDictionary serializedAdditionalRawData) + { + InitialDelayInMilliseconds = initialDelayInMilliseconds; + MaxIntervalInMilliseconds = maxIntervalInMilliseconds; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The optional initial delay in milliseconds before an operation is retried. + [WirePath("initialDelayInMilliseconds")] + public int? InitialDelayInMilliseconds { get; set; } + /// The optional maximum time interval in milliseconds between retry attempts. + [WirePath("maxIntervalInMilliseconds")] + public int? MaxIntervalInMilliseconds { get; set; } + } +} diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/DaprComponentResiliencyPolicyHttpRetryPolicyConfiguration.Serialization.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/DaprComponentResiliencyPolicyHttpRetryPolicyConfiguration.Serialization.cs new file mode 100644 index 000000000000..4b8c9e990ffa --- /dev/null +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/DaprComponentResiliencyPolicyHttpRetryPolicyConfiguration.Serialization.cs @@ -0,0 +1,196 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.AppContainers.Models +{ + public partial class DaprComponentResiliencyPolicyHttpRetryPolicyConfiguration : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DaprComponentResiliencyPolicyHttpRetryPolicyConfiguration)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(MaxRetries)) + { + writer.WritePropertyName("maxRetries"u8); + writer.WriteNumberValue(MaxRetries.Value); + } + if (Optional.IsDefined(RetryBackOff)) + { + writer.WritePropertyName("retryBackOff"u8); + writer.WriteObjectValue(RetryBackOff, options); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + DaprComponentResiliencyPolicyHttpRetryPolicyConfiguration IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DaprComponentResiliencyPolicyHttpRetryPolicyConfiguration)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDaprComponentResiliencyPolicyHttpRetryPolicyConfiguration(document.RootElement, options); + } + + internal static DaprComponentResiliencyPolicyHttpRetryPolicyConfiguration DeserializeDaprComponentResiliencyPolicyHttpRetryPolicyConfiguration(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + int? maxRetries = default; + DaprComponentResiliencyPolicyHttpRetryBackOffConfiguration retryBackOff = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("maxRetries"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + maxRetries = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("retryBackOff"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + retryBackOff = DaprComponentResiliencyPolicyHttpRetryBackOffConfiguration.DeserializeDaprComponentResiliencyPolicyHttpRetryBackOffConfiguration(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DaprComponentResiliencyPolicyHttpRetryPolicyConfiguration(maxRetries, retryBackOff, serializedAdditionalRawData); + } + + private BinaryData SerializeBicep(ModelReaderWriterOptions options) + { + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(MaxRetries), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" maxRetries: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(MaxRetries)) + { + builder.Append(" maxRetries: "); + builder.AppendLine($"{MaxRetries.Value}"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(RetryBackOff), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" retryBackOff: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(RetryBackOff)) + { + builder.Append(" retryBackOff: "); + BicepSerializationHelpers.AppendChildObject(builder, RetryBackOff, options, 2, false, " retryBackOff: "); + } + } + + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerAppContainersContext.Default); + case "bicep": + return SerializeBicep(options); + default: + throw new FormatException($"The model {nameof(DaprComponentResiliencyPolicyHttpRetryPolicyConfiguration)} does not support writing '{options.Format}' format."); + } + } + + DaprComponentResiliencyPolicyHttpRetryPolicyConfiguration IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeDaprComponentResiliencyPolicyHttpRetryPolicyConfiguration(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DaprComponentResiliencyPolicyHttpRetryPolicyConfiguration)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/DaprComponentResiliencyPolicyHttpRetryPolicyConfiguration.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/DaprComponentResiliencyPolicyHttpRetryPolicyConfiguration.cs new file mode 100644 index 000000000000..a9aa50db3ebe --- /dev/null +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/DaprComponentResiliencyPolicyHttpRetryPolicyConfiguration.cs @@ -0,0 +1,71 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.AppContainers.Models +{ + /// Dapr Component Resiliency Policy HTTP Retry Policy Configuration. + public partial class DaprComponentResiliencyPolicyHttpRetryPolicyConfiguration + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public DaprComponentResiliencyPolicyHttpRetryPolicyConfiguration() + { + } + + /// Initializes a new instance of . + /// The optional maximum number of retries. + /// The optional retry backoff configuration. + /// Keeps track of any properties unknown to the library. + internal DaprComponentResiliencyPolicyHttpRetryPolicyConfiguration(int? maxRetries, DaprComponentResiliencyPolicyHttpRetryBackOffConfiguration retryBackOff, IDictionary serializedAdditionalRawData) + { + MaxRetries = maxRetries; + RetryBackOff = retryBackOff; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The optional maximum number of retries. + [WirePath("maxRetries")] + public int? MaxRetries { get; set; } + /// The optional retry backoff configuration. + [WirePath("retryBackOff")] + public DaprComponentResiliencyPolicyHttpRetryBackOffConfiguration RetryBackOff { get; set; } + } +} diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/DaprComponentResiliencyPolicyTimeoutPolicyConfiguration.Serialization.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/DaprComponentResiliencyPolicyTimeoutPolicyConfiguration.Serialization.cs new file mode 100644 index 000000000000..a8e15cc2d973 --- /dev/null +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/DaprComponentResiliencyPolicyTimeoutPolicyConfiguration.Serialization.cs @@ -0,0 +1,166 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.AppContainers.Models +{ + internal partial class DaprComponentResiliencyPolicyTimeoutPolicyConfiguration : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DaprComponentResiliencyPolicyTimeoutPolicyConfiguration)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(ResponseTimeoutInSeconds)) + { + writer.WritePropertyName("responseTimeoutInSeconds"u8); + writer.WriteNumberValue(ResponseTimeoutInSeconds.Value); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + DaprComponentResiliencyPolicyTimeoutPolicyConfiguration IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DaprComponentResiliencyPolicyTimeoutPolicyConfiguration)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDaprComponentResiliencyPolicyTimeoutPolicyConfiguration(document.RootElement, options); + } + + internal static DaprComponentResiliencyPolicyTimeoutPolicyConfiguration DeserializeDaprComponentResiliencyPolicyTimeoutPolicyConfiguration(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + int? responseTimeoutInSeconds = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("responseTimeoutInSeconds"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + responseTimeoutInSeconds = property.Value.GetInt32(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DaprComponentResiliencyPolicyTimeoutPolicyConfiguration(responseTimeoutInSeconds, serializedAdditionalRawData); + } + + private BinaryData SerializeBicep(ModelReaderWriterOptions options) + { + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(ResponseTimeoutInSeconds), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" responseTimeoutInSeconds: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(ResponseTimeoutInSeconds)) + { + builder.Append(" responseTimeoutInSeconds: "); + builder.AppendLine($"{ResponseTimeoutInSeconds.Value}"); + } + } + + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerAppContainersContext.Default); + case "bicep": + return SerializeBicep(options); + default: + throw new FormatException($"The model {nameof(DaprComponentResiliencyPolicyTimeoutPolicyConfiguration)} does not support writing '{options.Format}' format."); + } + } + + DaprComponentResiliencyPolicyTimeoutPolicyConfiguration IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeDaprComponentResiliencyPolicyTimeoutPolicyConfiguration(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DaprComponentResiliencyPolicyTimeoutPolicyConfiguration)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/DaprComponentResiliencyPolicyTimeoutPolicyConfiguration.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/DaprComponentResiliencyPolicyTimeoutPolicyConfiguration.cs new file mode 100644 index 000000000000..0b9d5f8f7371 --- /dev/null +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/DaprComponentResiliencyPolicyTimeoutPolicyConfiguration.cs @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.AppContainers.Models +{ + /// Dapr Component Resiliency Policy Timeout Policy Configuration. + internal partial class DaprComponentResiliencyPolicyTimeoutPolicyConfiguration + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public DaprComponentResiliencyPolicyTimeoutPolicyConfiguration() + { + } + + /// Initializes a new instance of . + /// The optional response timeout in seconds. + /// Keeps track of any properties unknown to the library. + internal DaprComponentResiliencyPolicyTimeoutPolicyConfiguration(int? responseTimeoutInSeconds, IDictionary serializedAdditionalRawData) + { + ResponseTimeoutInSeconds = responseTimeoutInSeconds; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The optional response timeout in seconds. + [WirePath("responseTimeoutInSeconds")] + public int? ResponseTimeoutInSeconds { get; set; } + } +} diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/DaprComponentServiceBinding.Serialization.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/DaprComponentServiceBinding.Serialization.cs new file mode 100644 index 000000000000..37ab3eca5b08 --- /dev/null +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/DaprComponentServiceBinding.Serialization.cs @@ -0,0 +1,234 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.AppContainers.Models +{ + public partial class DaprComponentServiceBinding : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DaprComponentServiceBinding)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(Name)) + { + writer.WritePropertyName("name"u8); + writer.WriteStringValue(Name); + } + if (Optional.IsDefined(ServiceId)) + { + writer.WritePropertyName("serviceId"u8); + writer.WriteStringValue(ServiceId); + } + if (Optional.IsDefined(Metadata)) + { + writer.WritePropertyName("metadata"u8); + writer.WriteObjectValue(Metadata, options); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + DaprComponentServiceBinding IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DaprComponentServiceBinding)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDaprComponentServiceBinding(document.RootElement, options); + } + + internal static DaprComponentServiceBinding DeserializeDaprComponentServiceBinding(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string name = default; + string serviceId = default; + DaprServiceBindMetadata metadata = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("serviceId"u8)) + { + serviceId = property.Value.GetString(); + continue; + } + if (property.NameEquals("metadata"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + metadata = DaprServiceBindMetadata.DeserializeDaprServiceBindMetadata(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DaprComponentServiceBinding(name, serviceId, metadata, serializedAdditionalRawData); + } + + private BinaryData SerializeBicep(ModelReaderWriterOptions options) + { + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Name), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" name: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Name)) + { + builder.Append(" name: "); + if (Name.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{Name}'''"); + } + else + { + builder.AppendLine($"'{Name}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(ServiceId), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" serviceId: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(ServiceId)) + { + builder.Append(" serviceId: "); + if (ServiceId.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{ServiceId}'''"); + } + else + { + builder.AppendLine($"'{ServiceId}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Metadata), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" metadata: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Metadata)) + { + builder.Append(" metadata: "); + BicepSerializationHelpers.AppendChildObject(builder, Metadata, options, 2, false, " metadata: "); + } + } + + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerAppContainersContext.Default); + case "bicep": + return SerializeBicep(options); + default: + throw new FormatException($"The model {nameof(DaprComponentServiceBinding)} does not support writing '{options.Format}' format."); + } + } + + DaprComponentServiceBinding IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeDaprComponentServiceBinding(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DaprComponentServiceBinding)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/DaprComponentServiceBinding.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/DaprComponentServiceBinding.cs new file mode 100644 index 000000000000..e934e58b98d3 --- /dev/null +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/DaprComponentServiceBinding.cs @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.AppContainers.Models +{ + /// Configuration to bind a Dapr Component to a dev ContainerApp Service. + public partial class DaprComponentServiceBinding + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public DaprComponentServiceBinding() + { + } + + /// Initializes a new instance of . + /// Name of the service bind. + /// Resource id of the target service. + /// Service bind metadata. + /// Keeps track of any properties unknown to the library. + internal DaprComponentServiceBinding(string name, string serviceId, DaprServiceBindMetadata metadata, IDictionary serializedAdditionalRawData) + { + Name = name; + ServiceId = serviceId; + Metadata = metadata; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Name of the service bind. + [WirePath("name")] + public string Name { get; set; } + /// Resource id of the target service. + [WirePath("serviceId")] + public string ServiceId { get; set; } + /// Service bind metadata. + [WirePath("metadata")] + public DaprServiceBindMetadata Metadata { get; set; } + } +} diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/DaprServiceBindMetadata.Serialization.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/DaprServiceBindMetadata.Serialization.cs new file mode 100644 index 000000000000..6d3be062c787 --- /dev/null +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/DaprServiceBindMetadata.Serialization.cs @@ -0,0 +1,204 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.AppContainers.Models +{ + public partial class DaprServiceBindMetadata : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DaprServiceBindMetadata)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(Name)) + { + writer.WritePropertyName("name"u8); + writer.WriteStringValue(Name); + } + if (Optional.IsDefined(Value)) + { + writer.WritePropertyName("value"u8); + writer.WriteStringValue(Value); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + DaprServiceBindMetadata IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DaprServiceBindMetadata)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDaprServiceBindMetadata(document.RootElement, options); + } + + internal static DaprServiceBindMetadata DeserializeDaprServiceBindMetadata(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string name = default; + string value = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("value"u8)) + { + value = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DaprServiceBindMetadata(name, value, serializedAdditionalRawData); + } + + private BinaryData SerializeBicep(ModelReaderWriterOptions options) + { + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Name), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" name: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Name)) + { + builder.Append(" name: "); + if (Name.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{Name}'''"); + } + else + { + builder.AppendLine($"'{Name}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Value), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" value: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Value)) + { + builder.Append(" value: "); + if (Value.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{Value}'''"); + } + else + { + builder.AppendLine($"'{Value}'"); + } + } + } + + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerAppContainersContext.Default); + case "bicep": + return SerializeBicep(options); + default: + throw new FormatException($"The model {nameof(DaprServiceBindMetadata)} does not support writing '{options.Format}' format."); + } + } + + DaprServiceBindMetadata IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeDaprServiceBindMetadata(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DaprServiceBindMetadata)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/DaprServiceBindMetadata.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/DaprServiceBindMetadata.cs new file mode 100644 index 000000000000..ebc841283cf4 --- /dev/null +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/DaprServiceBindMetadata.cs @@ -0,0 +1,71 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.AppContainers.Models +{ + /// Dapr component metadata. + public partial class DaprServiceBindMetadata + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public DaprServiceBindMetadata() + { + } + + /// Initializes a new instance of . + /// Service bind metadata property name. + /// Service bind metadata property value. + /// Keeps track of any properties unknown to the library. + internal DaprServiceBindMetadata(string name, string value, IDictionary serializedAdditionalRawData) + { + Name = name; + Value = value; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Service bind metadata property name. + [WirePath("name")] + public string Name { get; set; } + /// Service bind metadata property value. + [WirePath("value")] + public string Value { get; set; } + } +} diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/DaprSubscriptionBulkSubscribeConfig.Serialization.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/DaprSubscriptionBulkSubscribeConfig.Serialization.cs new file mode 100644 index 000000000000..eaaba745350a --- /dev/null +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/DaprSubscriptionBulkSubscribeConfig.Serialization.cs @@ -0,0 +1,227 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.AppContainers.Models +{ + public partial class DaprSubscriptionBulkSubscribeConfig : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DaprSubscriptionBulkSubscribeConfig)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(IsEnabled)) + { + writer.WritePropertyName("enabled"u8); + writer.WriteBooleanValue(IsEnabled.Value); + } + if (Optional.IsDefined(MaxMessagesCount)) + { + writer.WritePropertyName("maxMessagesCount"u8); + writer.WriteNumberValue(MaxMessagesCount.Value); + } + if (Optional.IsDefined(MaxAwaitDurationMs)) + { + writer.WritePropertyName("maxAwaitDurationMs"u8); + writer.WriteNumberValue(MaxAwaitDurationMs.Value); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + DaprSubscriptionBulkSubscribeConfig IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DaprSubscriptionBulkSubscribeConfig)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDaprSubscriptionBulkSubscribeConfig(document.RootElement, options); + } + + internal static DaprSubscriptionBulkSubscribeConfig DeserializeDaprSubscriptionBulkSubscribeConfig(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + bool? enabled = default; + int? maxMessagesCount = default; + int? maxAwaitDurationMs = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("enabled"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + enabled = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("maxMessagesCount"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + maxMessagesCount = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("maxAwaitDurationMs"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + maxAwaitDurationMs = property.Value.GetInt32(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DaprSubscriptionBulkSubscribeConfig(enabled, maxMessagesCount, maxAwaitDurationMs, serializedAdditionalRawData); + } + + private BinaryData SerializeBicep(ModelReaderWriterOptions options) + { + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(IsEnabled), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" enabled: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(IsEnabled)) + { + builder.Append(" enabled: "); + var boolValue = IsEnabled.Value == true ? "true" : "false"; + builder.AppendLine($"{boolValue}"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(MaxMessagesCount), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" maxMessagesCount: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(MaxMessagesCount)) + { + builder.Append(" maxMessagesCount: "); + builder.AppendLine($"{MaxMessagesCount.Value}"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(MaxAwaitDurationMs), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" maxAwaitDurationMs: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(MaxAwaitDurationMs)) + { + builder.Append(" maxAwaitDurationMs: "); + builder.AppendLine($"{MaxAwaitDurationMs.Value}"); + } + } + + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerAppContainersContext.Default); + case "bicep": + return SerializeBicep(options); + default: + throw new FormatException($"The model {nameof(DaprSubscriptionBulkSubscribeConfig)} does not support writing '{options.Format}' format."); + } + } + + DaprSubscriptionBulkSubscribeConfig IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeDaprSubscriptionBulkSubscribeConfig(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DaprSubscriptionBulkSubscribeConfig)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/DaprSubscriptionBulkSubscribeConfig.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/DaprSubscriptionBulkSubscribeConfig.cs new file mode 100644 index 000000000000..48348602c34e --- /dev/null +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/DaprSubscriptionBulkSubscribeConfig.cs @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.AppContainers.Models +{ + /// Dapr PubSub Bulk Subscription Options. + public partial class DaprSubscriptionBulkSubscribeConfig + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public DaprSubscriptionBulkSubscribeConfig() + { + } + + /// Initializes a new instance of . + /// Enable bulk subscription. + /// Maximum number of messages to deliver in a bulk message. + /// Maximum duration in milliseconds to wait before a bulk message is sent to the app. + /// Keeps track of any properties unknown to the library. + internal DaprSubscriptionBulkSubscribeConfig(bool? isEnabled, int? maxMessagesCount, int? maxAwaitDurationMs, IDictionary serializedAdditionalRawData) + { + IsEnabled = isEnabled; + MaxMessagesCount = maxMessagesCount; + MaxAwaitDurationMs = maxAwaitDurationMs; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Enable bulk subscription. + [WirePath("enabled")] + public bool? IsEnabled { get; set; } + /// Maximum number of messages to deliver in a bulk message. + [WirePath("maxMessagesCount")] + public int? MaxMessagesCount { get; set; } + /// Maximum duration in milliseconds to wait before a bulk message is sent to the app. + [WirePath("maxAwaitDurationMs")] + public int? MaxAwaitDurationMs { get; set; } + } +} diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/DaprSubscriptionRouteRule.Serialization.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/DaprSubscriptionRouteRule.Serialization.cs new file mode 100644 index 000000000000..629c320ee631 --- /dev/null +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/DaprSubscriptionRouteRule.Serialization.cs @@ -0,0 +1,204 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.AppContainers.Models +{ + public partial class DaprSubscriptionRouteRule : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DaprSubscriptionRouteRule)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(Match)) + { + writer.WritePropertyName("match"u8); + writer.WriteStringValue(Match); + } + if (Optional.IsDefined(Path)) + { + writer.WritePropertyName("path"u8); + writer.WriteStringValue(Path); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + DaprSubscriptionRouteRule IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DaprSubscriptionRouteRule)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDaprSubscriptionRouteRule(document.RootElement, options); + } + + internal static DaprSubscriptionRouteRule DeserializeDaprSubscriptionRouteRule(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string match = default; + string path = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("match"u8)) + { + match = property.Value.GetString(); + continue; + } + if (property.NameEquals("path"u8)) + { + path = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DaprSubscriptionRouteRule(match, path, serializedAdditionalRawData); + } + + private BinaryData SerializeBicep(ModelReaderWriterOptions options) + { + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Match), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" match: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Match)) + { + builder.Append(" match: "); + if (Match.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{Match}'''"); + } + else + { + builder.AppendLine($"'{Match}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Path), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" path: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Path)) + { + builder.Append(" path: "); + if (Path.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{Path}'''"); + } + else + { + builder.AppendLine($"'{Path}'"); + } + } + } + + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerAppContainersContext.Default); + case "bicep": + return SerializeBicep(options); + default: + throw new FormatException($"The model {nameof(DaprSubscriptionRouteRule)} does not support writing '{options.Format}' format."); + } + } + + DaprSubscriptionRouteRule IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeDaprSubscriptionRouteRule(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DaprSubscriptionRouteRule)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/DaprSubscriptionRouteRule.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/DaprSubscriptionRouteRule.cs new file mode 100644 index 000000000000..260c557737c3 --- /dev/null +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/DaprSubscriptionRouteRule.cs @@ -0,0 +1,71 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.AppContainers.Models +{ + /// Dapr Pubsub Event Subscription Route Rule is used to specify the condition for sending a message to a specific path. + public partial class DaprSubscriptionRouteRule + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public DaprSubscriptionRouteRule() + { + } + + /// Initializes a new instance of . + /// The optional CEL expression used to match the event. If the match is not specified, then the route is considered the default. The rules are tested in the order specified, so they should be define from most-to-least specific. The default route should appear last in the list. + /// The path for events that match this rule. + /// Keeps track of any properties unknown to the library. + internal DaprSubscriptionRouteRule(string match, string path, IDictionary serializedAdditionalRawData) + { + Match = match; + Path = path; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The optional CEL expression used to match the event. If the match is not specified, then the route is considered the default. The rules are tested in the order specified, so they should be define from most-to-least specific. The default route should appear last in the list. + [WirePath("match")] + public string Match { get; set; } + /// The path for events that match this rule. + [WirePath("path")] + public string Path { get; set; } + } +} diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/DaprSubscriptionRoutes.Serialization.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/DaprSubscriptionRoutes.Serialization.cs new file mode 100644 index 000000000000..3aace17e83b2 --- /dev/null +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/DaprSubscriptionRoutes.Serialization.cs @@ -0,0 +1,219 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.AppContainers.Models +{ + public partial class DaprSubscriptionRoutes : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DaprSubscriptionRoutes)} does not support writing '{format}' format."); + } + + if (Optional.IsCollectionDefined(Rules)) + { + writer.WritePropertyName("rules"u8); + writer.WriteStartArray(); + foreach (var item in Rules) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(Default)) + { + writer.WritePropertyName("default"u8); + writer.WriteStringValue(Default); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + DaprSubscriptionRoutes IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DaprSubscriptionRoutes)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDaprSubscriptionRoutes(document.RootElement, options); + } + + internal static DaprSubscriptionRoutes DeserializeDaprSubscriptionRoutes(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IList rules = default; + string @default = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("rules"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(DaprSubscriptionRouteRule.DeserializeDaprSubscriptionRouteRule(item, options)); + } + rules = array; + continue; + } + if (property.NameEquals("default"u8)) + { + @default = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DaprSubscriptionRoutes(rules ?? new ChangeTrackingList(), @default, serializedAdditionalRawData); + } + + private BinaryData SerializeBicep(ModelReaderWriterOptions options) + { + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Rules), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" rules: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsCollectionDefined(Rules)) + { + if (Rules.Any()) + { + builder.Append(" rules: "); + builder.AppendLine("["); + foreach (var item in Rules) + { + BicepSerializationHelpers.AppendChildObject(builder, item, options, 4, true, " rules: "); + } + builder.AppendLine(" ]"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Default), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" default: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Default)) + { + builder.Append(" default: "); + if (Default.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{Default}'''"); + } + else + { + builder.AppendLine($"'{Default}'"); + } + } + } + + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerAppContainersContext.Default); + case "bicep": + return SerializeBicep(options); + default: + throw new FormatException($"The model {nameof(DaprSubscriptionRoutes)} does not support writing '{options.Format}' format."); + } + } + + DaprSubscriptionRoutes IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeDaprSubscriptionRoutes(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DaprSubscriptionRoutes)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/DaprSubscriptionRoutes.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/DaprSubscriptionRoutes.cs new file mode 100644 index 000000000000..e8fe9a8e0361 --- /dev/null +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/DaprSubscriptionRoutes.cs @@ -0,0 +1,72 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.AppContainers.Models +{ + /// Dapr PubSub Event Subscription Routes configuration. + public partial class DaprSubscriptionRoutes + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public DaprSubscriptionRoutes() + { + Rules = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// The list of Dapr PubSub Event Subscription Route Rules. + /// The default path to deliver events that do not match any of the rules. + /// Keeps track of any properties unknown to the library. + internal DaprSubscriptionRoutes(IList rules, string @default, IDictionary serializedAdditionalRawData) + { + Rules = rules; + Default = @default; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The list of Dapr PubSub Event Subscription Route Rules. + [WirePath("rules")] + public IList Rules { get; } + /// The default path to deliver events that do not match any of the rules. + [WirePath("default")] + public string Default { get; set; } + } +} diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/DaprSubscriptionsCollection.Serialization.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/DaprSubscriptionsCollection.Serialization.cs new file mode 100644 index 000000000000..928aae7214ae --- /dev/null +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/DaprSubscriptionsCollection.Serialization.cs @@ -0,0 +1,212 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.AppContainers.Models +{ + internal partial class DaprSubscriptionsCollection : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DaprSubscriptionsCollection)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("value"u8); + writer.WriteStartArray(); + foreach (var item in Value) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + if (options.Format != "W" && Optional.IsDefined(NextLink)) + { + writer.WritePropertyName("nextLink"u8); + writer.WriteStringValue(NextLink); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + DaprSubscriptionsCollection IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DaprSubscriptionsCollection)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDaprSubscriptionsCollection(document.RootElement, options); + } + + internal static DaprSubscriptionsCollection DeserializeDaprSubscriptionsCollection(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IReadOnlyList value = default; + string nextLink = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(DaprSubscriptionData.DeserializeDaprSubscriptionData(item, options)); + } + value = array; + continue; + } + if (property.NameEquals("nextLink"u8)) + { + nextLink = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DaprSubscriptionsCollection(value, nextLink, serializedAdditionalRawData); + } + + private BinaryData SerializeBicep(ModelReaderWriterOptions options) + { + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Value), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" value: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsCollectionDefined(Value)) + { + if (Value.Any()) + { + builder.Append(" value: "); + builder.AppendLine("["); + foreach (var item in Value) + { + BicepSerializationHelpers.AppendChildObject(builder, item, options, 4, true, " value: "); + } + builder.AppendLine(" ]"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(NextLink), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" nextLink: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(NextLink)) + { + builder.Append(" nextLink: "); + if (NextLink.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{NextLink}'''"); + } + else + { + builder.AppendLine($"'{NextLink}'"); + } + } + } + + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerAppContainersContext.Default); + case "bicep": + return SerializeBicep(options); + default: + throw new FormatException($"The model {nameof(DaprSubscriptionsCollection)} does not support writing '{options.Format}' format."); + } + } + + DaprSubscriptionsCollection IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeDaprSubscriptionsCollection(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DaprSubscriptionsCollection)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/DaprSubscriptionsCollection.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/DaprSubscriptionsCollection.cs new file mode 100644 index 000000000000..6f0791c2cacb --- /dev/null +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/DaprSubscriptionsCollection.cs @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.ResourceManager.AppContainers.Models +{ + /// Dapr Subscriptions ARM resource. + internal partial class DaprSubscriptionsCollection + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// Collection of resources. + /// is null. + internal DaprSubscriptionsCollection(IEnumerable value) + { + Argument.AssertNotNull(value, nameof(value)); + + Value = value.ToList(); + } + + /// Initializes a new instance of . + /// Collection of resources. + /// Link to next page of resources. + /// Keeps track of any properties unknown to the library. + internal DaprSubscriptionsCollection(IReadOnlyList value, string nextLink, IDictionary serializedAdditionalRawData) + { + Value = value; + NextLink = nextLink; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal DaprSubscriptionsCollection() + { + } + + /// Collection of resources. + public IReadOnlyList Value { get; } + /// Link to next page of resources. + public string NextLink { get; } + } +} diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/DataDogConfiguration.Serialization.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/DataDogConfiguration.Serialization.cs new file mode 100644 index 000000000000..d6cdf8cf66a1 --- /dev/null +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/DataDogConfiguration.Serialization.cs @@ -0,0 +1,204 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.AppContainers.Models +{ + public partial class DataDogConfiguration : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataDogConfiguration)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(Site)) + { + writer.WritePropertyName("site"u8); + writer.WriteStringValue(Site); + } + if (Optional.IsDefined(Key)) + { + writer.WritePropertyName("key"u8); + writer.WriteStringValue(Key); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + DataDogConfiguration IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataDogConfiguration)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDataDogConfiguration(document.RootElement, options); + } + + internal static DataDogConfiguration DeserializeDataDogConfiguration(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string site = default; + string key = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("site"u8)) + { + site = property.Value.GetString(); + continue; + } + if (property.NameEquals("key"u8)) + { + key = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DataDogConfiguration(site, key, serializedAdditionalRawData); + } + + private BinaryData SerializeBicep(ModelReaderWriterOptions options) + { + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Site), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" site: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Site)) + { + builder.Append(" site: "); + if (Site.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{Site}'''"); + } + else + { + builder.AppendLine($"'{Site}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Key), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" key: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Key)) + { + builder.Append(" key: "); + if (Key.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{Key}'''"); + } + else + { + builder.AppendLine($"'{Key}'"); + } + } + } + + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerAppContainersContext.Default); + case "bicep": + return SerializeBicep(options); + default: + throw new FormatException($"The model {nameof(DataDogConfiguration)} does not support writing '{options.Format}' format."); + } + } + + DataDogConfiguration IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeDataDogConfiguration(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DataDogConfiguration)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/DataDogConfiguration.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/DataDogConfiguration.cs new file mode 100644 index 000000000000..398040ad826d --- /dev/null +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/DataDogConfiguration.cs @@ -0,0 +1,71 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.AppContainers.Models +{ + /// Configuration of datadog. + public partial class DataDogConfiguration + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public DataDogConfiguration() + { + } + + /// Initializes a new instance of . + /// The data dog site. + /// The data dog api key. + /// Keeps track of any properties unknown to the library. + internal DataDogConfiguration(string site, string key, IDictionary serializedAdditionalRawData) + { + Site = site; + Key = key; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The data dog site. + [WirePath("site")] + public string Site { get; set; } + /// The data dog api key. + [WirePath("key")] + public string Key { get; set; } + } +} diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/DestinationsConfiguration.Serialization.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/DestinationsConfiguration.Serialization.cs new file mode 100644 index 000000000000..0379a4b9e4b6 --- /dev/null +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/DestinationsConfiguration.Serialization.cs @@ -0,0 +1,215 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.AppContainers.Models +{ + public partial class DestinationsConfiguration : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DestinationsConfiguration)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(DataDogConfiguration)) + { + writer.WritePropertyName("dataDogConfiguration"u8); + writer.WriteObjectValue(DataDogConfiguration, options); + } + if (Optional.IsCollectionDefined(OtlpConfigurations)) + { + writer.WritePropertyName("otlpConfigurations"u8); + writer.WriteStartArray(); + foreach (var item in OtlpConfigurations) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + DestinationsConfiguration IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DestinationsConfiguration)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDestinationsConfiguration(document.RootElement, options); + } + + internal static DestinationsConfiguration DeserializeDestinationsConfiguration(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + DataDogConfiguration dataDogConfiguration = default; + IList otlpConfigurations = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("dataDogConfiguration"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + dataDogConfiguration = DataDogConfiguration.DeserializeDataDogConfiguration(property.Value, options); + continue; + } + if (property.NameEquals("otlpConfigurations"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(OtlpConfiguration.DeserializeOtlpConfiguration(item, options)); + } + otlpConfigurations = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DestinationsConfiguration(dataDogConfiguration, otlpConfigurations ?? new ChangeTrackingList(), serializedAdditionalRawData); + } + + private BinaryData SerializeBicep(ModelReaderWriterOptions options) + { + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(DataDogConfiguration), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" dataDogConfiguration: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(DataDogConfiguration)) + { + builder.Append(" dataDogConfiguration: "); + BicepSerializationHelpers.AppendChildObject(builder, DataDogConfiguration, options, 2, false, " dataDogConfiguration: "); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(OtlpConfigurations), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" otlpConfigurations: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsCollectionDefined(OtlpConfigurations)) + { + if (OtlpConfigurations.Any()) + { + builder.Append(" otlpConfigurations: "); + builder.AppendLine("["); + foreach (var item in OtlpConfigurations) + { + BicepSerializationHelpers.AppendChildObject(builder, item, options, 4, true, " otlpConfigurations: "); + } + builder.AppendLine(" ]"); + } + } + } + + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerAppContainersContext.Default); + case "bicep": + return SerializeBicep(options); + default: + throw new FormatException($"The model {nameof(DestinationsConfiguration)} does not support writing '{options.Format}' format."); + } + } + + DestinationsConfiguration IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeDestinationsConfiguration(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DestinationsConfiguration)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/DestinationsConfiguration.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/DestinationsConfiguration.cs new file mode 100644 index 000000000000..1a32a9bf4bc3 --- /dev/null +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/DestinationsConfiguration.cs @@ -0,0 +1,72 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.AppContainers.Models +{ + /// Configuration of Open Telemetry destinations. + public partial class DestinationsConfiguration + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public DestinationsConfiguration() + { + OtlpConfigurations = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// Open telemetry datadog destination configuration. + /// Open telemetry otlp configurations. + /// Keeps track of any properties unknown to the library. + internal DestinationsConfiguration(DataDogConfiguration dataDogConfiguration, IList otlpConfigurations, IDictionary serializedAdditionalRawData) + { + DataDogConfiguration = dataDogConfiguration; + OtlpConfigurations = otlpConfigurations; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Open telemetry datadog destination configuration. + [WirePath("dataDogConfiguration")] + public DataDogConfiguration DataDogConfiguration { get; set; } + /// Open telemetry otlp configurations. + [WirePath("otlpConfigurations")] + public IList OtlpConfigurations { get; } + } +} diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/DetectionStatus.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/DetectionStatus.cs new file mode 100644 index 000000000000..d9a9510b9819 --- /dev/null +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/DetectionStatus.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.AppContainers.Models +{ + /// The status of the patch detection. + public readonly partial struct DetectionStatus : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public DetectionStatus(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string SucceededValue = "Succeeded"; + private const string RegistryLoginFailedValue = "RegistryLoginFailed"; + private const string FailedValue = "Failed"; + + /// Succeeded. + public static DetectionStatus Succeeded { get; } = new DetectionStatus(SucceededValue); + /// RegistryLoginFailed. + public static DetectionStatus RegistryLoginFailed { get; } = new DetectionStatus(RegistryLoginFailedValue); + /// Failed. + public static DetectionStatus Failed { get; } = new DetectionStatus(FailedValue); + /// Determines if two values are the same. + public static bool operator ==(DetectionStatus left, DetectionStatus right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(DetectionStatus left, DetectionStatus right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator DetectionStatus(string value) => new DetectionStatus(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is DetectionStatus other && Equals(other); + /// + public bool Equals(DetectionStatus other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/DiskEncryptionConfiguration.Serialization.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/DiskEncryptionConfiguration.Serialization.cs new file mode 100644 index 000000000000..0415d3a2789e --- /dev/null +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/DiskEncryptionConfiguration.Serialization.cs @@ -0,0 +1,166 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.AppContainers.Models +{ + internal partial class DiskEncryptionConfiguration : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DiskEncryptionConfiguration)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(KeyVaultConfiguration)) + { + writer.WritePropertyName("keyVaultConfiguration"u8); + writer.WriteObjectValue(KeyVaultConfiguration, options); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + DiskEncryptionConfiguration IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DiskEncryptionConfiguration)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDiskEncryptionConfiguration(document.RootElement, options); + } + + internal static DiskEncryptionConfiguration DeserializeDiskEncryptionConfiguration(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + DiskEncryptionConfigurationKeyVaultConfiguration keyVaultConfiguration = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("keyVaultConfiguration"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + keyVaultConfiguration = DiskEncryptionConfigurationKeyVaultConfiguration.DeserializeDiskEncryptionConfigurationKeyVaultConfiguration(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DiskEncryptionConfiguration(keyVaultConfiguration, serializedAdditionalRawData); + } + + private BinaryData SerializeBicep(ModelReaderWriterOptions options) + { + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(KeyVaultConfiguration), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" keyVaultConfiguration: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(KeyVaultConfiguration)) + { + builder.Append(" keyVaultConfiguration: "); + BicepSerializationHelpers.AppendChildObject(builder, KeyVaultConfiguration, options, 2, false, " keyVaultConfiguration: "); + } + } + + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerAppContainersContext.Default); + case "bicep": + return SerializeBicep(options); + default: + throw new FormatException($"The model {nameof(DiskEncryptionConfiguration)} does not support writing '{options.Format}' format."); + } + } + + DiskEncryptionConfiguration IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeDiskEncryptionConfiguration(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DiskEncryptionConfiguration)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/DiskEncryptionConfiguration.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/DiskEncryptionConfiguration.cs new file mode 100644 index 000000000000..372193c25763 --- /dev/null +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/DiskEncryptionConfiguration.cs @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.AppContainers.Models +{ + /// Configuration properties for disk encryption. + internal partial class DiskEncryptionConfiguration + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public DiskEncryptionConfiguration() + { + } + + /// Initializes a new instance of . + /// The Key Vault that contains your key to use for disk encryption. The Key Vault must be in the same region as the Managed Environment. + /// Keeps track of any properties unknown to the library. + internal DiskEncryptionConfiguration(DiskEncryptionConfigurationKeyVaultConfiguration keyVaultConfiguration, IDictionary serializedAdditionalRawData) + { + KeyVaultConfiguration = keyVaultConfiguration; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The Key Vault that contains your key to use for disk encryption. The Key Vault must be in the same region as the Managed Environment. + [WirePath("keyVaultConfiguration")] + public DiskEncryptionConfigurationKeyVaultConfiguration KeyVaultConfiguration { get; set; } + } +} diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/DiskEncryptionConfigurationKeyVaultConfiguration.Serialization.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/DiskEncryptionConfigurationKeyVaultConfiguration.Serialization.cs new file mode 100644 index 000000000000..867f4868ef82 --- /dev/null +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/DiskEncryptionConfigurationKeyVaultConfiguration.Serialization.cs @@ -0,0 +1,199 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.AppContainers.Models +{ + public partial class DiskEncryptionConfigurationKeyVaultConfiguration : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DiskEncryptionConfigurationKeyVaultConfiguration)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(KeyUri)) + { + writer.WritePropertyName("keyUrl"u8); + writer.WriteStringValue(KeyUri.AbsoluteUri); + } + if (Optional.IsDefined(Auth)) + { + writer.WritePropertyName("auth"u8); + writer.WriteObjectValue(Auth, options); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + DiskEncryptionConfigurationKeyVaultConfiguration IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DiskEncryptionConfigurationKeyVaultConfiguration)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDiskEncryptionConfigurationKeyVaultConfiguration(document.RootElement, options); + } + + internal static DiskEncryptionConfigurationKeyVaultConfiguration DeserializeDiskEncryptionConfigurationKeyVaultConfiguration(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Uri keyUrl = default; + DiskEncryptionConfigurationKeyVaultConfigurationAuth auth = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("keyUrl"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + keyUrl = new Uri(property.Value.GetString()); + continue; + } + if (property.NameEquals("auth"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + auth = DiskEncryptionConfigurationKeyVaultConfigurationAuth.DeserializeDiskEncryptionConfigurationKeyVaultConfigurationAuth(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DiskEncryptionConfigurationKeyVaultConfiguration(keyUrl, auth, serializedAdditionalRawData); + } + + private BinaryData SerializeBicep(ModelReaderWriterOptions options) + { + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(KeyUri), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" keyUrl: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(KeyUri)) + { + builder.Append(" keyUrl: "); + builder.AppendLine($"'{KeyUri.AbsoluteUri}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue("AuthIdentity", out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" auth: "); + builder.AppendLine("{"); + builder.Append(" identity: "); + builder.AppendLine(propertyOverride); + builder.AppendLine(" }"); + } + else + { + if (Optional.IsDefined(Auth)) + { + builder.Append(" auth: "); + BicepSerializationHelpers.AppendChildObject(builder, Auth, options, 2, false, " auth: "); + } + } + + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerAppContainersContext.Default); + case "bicep": + return SerializeBicep(options); + default: + throw new FormatException($"The model {nameof(DiskEncryptionConfigurationKeyVaultConfiguration)} does not support writing '{options.Format}' format."); + } + } + + DiskEncryptionConfigurationKeyVaultConfiguration IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeDiskEncryptionConfigurationKeyVaultConfiguration(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DiskEncryptionConfigurationKeyVaultConfiguration)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/DiskEncryptionConfigurationKeyVaultConfiguration.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/DiskEncryptionConfigurationKeyVaultConfiguration.cs new file mode 100644 index 000000000000..b1b09385d93c --- /dev/null +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/DiskEncryptionConfigurationKeyVaultConfiguration.cs @@ -0,0 +1,83 @@ +// 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.AppContainers.Models +{ + /// The Key Vault that contains your key to use for disk encryption. The Key Vault must be in the same region as the Managed Environment. + public partial class DiskEncryptionConfigurationKeyVaultConfiguration + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public DiskEncryptionConfigurationKeyVaultConfiguration() + { + } + + /// Initializes a new instance of . + /// Key URL pointing to a key in KeyVault. Version segment of the Url is required. + /// Configuration properties for the authentication to the Key Vault. + /// Keeps track of any properties unknown to the library. + internal DiskEncryptionConfigurationKeyVaultConfiguration(Uri keyUri, DiskEncryptionConfigurationKeyVaultConfigurationAuth auth, IDictionary serializedAdditionalRawData) + { + KeyUri = keyUri; + Auth = auth; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Key URL pointing to a key in KeyVault. Version segment of the Url is required. + [WirePath("keyUrl")] + public Uri KeyUri { get; set; } + /// Configuration properties for the authentication to the Key Vault. + internal DiskEncryptionConfigurationKeyVaultConfigurationAuth Auth { get; set; } + /// Resource ID of a user-assigned managed identity to authenticate to the Key Vault. The identity must be assigned to the managed environment, in the same tenant as the Key Vault, and it must have the following key permissions on the Key Vault: wrapkey, unwrapkey, get. + [WirePath("auth.identity")] + public ResourceIdentifier AuthIdentity + { + get => Auth is null ? default : Auth.Identity; + set + { + if (Auth is null) + Auth = new DiskEncryptionConfigurationKeyVaultConfigurationAuth(); + Auth.Identity = value; + } + } + } +} diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/DiskEncryptionConfigurationKeyVaultConfigurationAuth.Serialization.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/DiskEncryptionConfigurationKeyVaultConfigurationAuth.Serialization.cs new file mode 100644 index 000000000000..c822cb4fc27b --- /dev/null +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/DiskEncryptionConfigurationKeyVaultConfigurationAuth.Serialization.cs @@ -0,0 +1,166 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.AppContainers.Models +{ + internal partial class DiskEncryptionConfigurationKeyVaultConfigurationAuth : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DiskEncryptionConfigurationKeyVaultConfigurationAuth)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(Identity)) + { + writer.WritePropertyName("identity"u8); + writer.WriteStringValue(Identity); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + DiskEncryptionConfigurationKeyVaultConfigurationAuth IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DiskEncryptionConfigurationKeyVaultConfigurationAuth)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDiskEncryptionConfigurationKeyVaultConfigurationAuth(document.RootElement, options); + } + + internal static DiskEncryptionConfigurationKeyVaultConfigurationAuth DeserializeDiskEncryptionConfigurationKeyVaultConfigurationAuth(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ResourceIdentifier identity = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("identity"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + identity = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DiskEncryptionConfigurationKeyVaultConfigurationAuth(identity, serializedAdditionalRawData); + } + + private BinaryData SerializeBicep(ModelReaderWriterOptions options) + { + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Identity), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" identity: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Identity)) + { + builder.Append(" identity: "); + builder.AppendLine($"'{Identity.ToString()}'"); + } + } + + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerAppContainersContext.Default); + case "bicep": + return SerializeBicep(options); + default: + throw new FormatException($"The model {nameof(DiskEncryptionConfigurationKeyVaultConfigurationAuth)} does not support writing '{options.Format}' format."); + } + } + + DiskEncryptionConfigurationKeyVaultConfigurationAuth IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeDiskEncryptionConfigurationKeyVaultConfigurationAuth(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DiskEncryptionConfigurationKeyVaultConfigurationAuth)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/DiskEncryptionConfigurationKeyVaultConfigurationAuth.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/DiskEncryptionConfigurationKeyVaultConfigurationAuth.cs new file mode 100644 index 000000000000..28f625ee71e7 --- /dev/null +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/DiskEncryptionConfigurationKeyVaultConfigurationAuth.cs @@ -0,0 +1,67 @@ +// 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.AppContainers.Models +{ + /// Configuration properties for the authentication to the Key Vault. + internal partial class DiskEncryptionConfigurationKeyVaultConfigurationAuth + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public DiskEncryptionConfigurationKeyVaultConfigurationAuth() + { + } + + /// Initializes a new instance of . + /// Resource ID of a user-assigned managed identity to authenticate to the Key Vault. The identity must be assigned to the managed environment, in the same tenant as the Key Vault, and it must have the following key permissions on the Key Vault: wrapkey, unwrapkey, get. + /// Keeps track of any properties unknown to the library. + internal DiskEncryptionConfigurationKeyVaultConfigurationAuth(ResourceIdentifier identity, IDictionary serializedAdditionalRawData) + { + Identity = identity; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Resource ID of a user-assigned managed identity to authenticate to the Key Vault. The identity must be assigned to the managed environment, in the same tenant as the Key Vault, and it must have the following key permissions on the Key Vault: wrapkey, unwrapkey, get. + [WirePath("identity")] + public ResourceIdentifier Identity { get; set; } + } +} diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/DotNetComponentConfigurationProperty.Serialization.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/DotNetComponentConfigurationProperty.Serialization.cs new file mode 100644 index 000000000000..8f5e6853ef40 --- /dev/null +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/DotNetComponentConfigurationProperty.Serialization.cs @@ -0,0 +1,204 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.AppContainers.Models +{ + public partial class DotNetComponentConfigurationProperty : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DotNetComponentConfigurationProperty)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(PropertyName)) + { + writer.WritePropertyName("propertyName"u8); + writer.WriteStringValue(PropertyName); + } + if (Optional.IsDefined(Value)) + { + writer.WritePropertyName("value"u8); + writer.WriteStringValue(Value); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + DotNetComponentConfigurationProperty IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DotNetComponentConfigurationProperty)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDotNetComponentConfigurationProperty(document.RootElement, options); + } + + internal static DotNetComponentConfigurationProperty DeserializeDotNetComponentConfigurationProperty(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string propertyName = default; + string value = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("propertyName"u8)) + { + propertyName = property.Value.GetString(); + continue; + } + if (property.NameEquals("value"u8)) + { + value = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DotNetComponentConfigurationProperty(propertyName, value, serializedAdditionalRawData); + } + + private BinaryData SerializeBicep(ModelReaderWriterOptions options) + { + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(PropertyName), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" propertyName: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(PropertyName)) + { + builder.Append(" propertyName: "); + if (PropertyName.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{PropertyName}'''"); + } + else + { + builder.AppendLine($"'{PropertyName}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Value), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" value: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Value)) + { + builder.Append(" value: "); + if (Value.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{Value}'''"); + } + else + { + builder.AppendLine($"'{Value}'"); + } + } + } + + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerAppContainersContext.Default); + case "bicep": + return SerializeBicep(options); + default: + throw new FormatException($"The model {nameof(DotNetComponentConfigurationProperty)} does not support writing '{options.Format}' format."); + } + } + + DotNetComponentConfigurationProperty IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeDotNetComponentConfigurationProperty(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DotNetComponentConfigurationProperty)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/DotNetComponentConfigurationProperty.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/DotNetComponentConfigurationProperty.cs new file mode 100644 index 000000000000..522e59ff3b23 --- /dev/null +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/DotNetComponentConfigurationProperty.cs @@ -0,0 +1,71 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.AppContainers.Models +{ + /// Configuration properties for a .NET Component. + public partial class DotNetComponentConfigurationProperty + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public DotNetComponentConfigurationProperty() + { + } + + /// Initializes a new instance of . + /// The name of the property. + /// The value of the property. + /// Keeps track of any properties unknown to the library. + internal DotNetComponentConfigurationProperty(string propertyName, string value, IDictionary serializedAdditionalRawData) + { + PropertyName = propertyName; + Value = value; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The name of the property. + [WirePath("propertyName")] + public string PropertyName { get; set; } + /// The value of the property. + [WirePath("value")] + public string Value { get; set; } + } +} diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/DotNetComponentProvisioningState.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/DotNetComponentProvisioningState.cs new file mode 100644 index 000000000000..b1e36e202ab5 --- /dev/null +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/DotNetComponentProvisioningState.cs @@ -0,0 +1,60 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.AppContainers.Models +{ + /// Provisioning state of the .NET Component. + public readonly partial struct DotNetComponentProvisioningState : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public DotNetComponentProvisioningState(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string SucceededValue = "Succeeded"; + private const string FailedValue = "Failed"; + private const string CanceledValue = "Canceled"; + private const string DeletingValue = "Deleting"; + private const string InProgressValue = "InProgress"; + + /// Succeeded. + public static DotNetComponentProvisioningState Succeeded { get; } = new DotNetComponentProvisioningState(SucceededValue); + /// Failed. + public static DotNetComponentProvisioningState Failed { get; } = new DotNetComponentProvisioningState(FailedValue); + /// Canceled. + public static DotNetComponentProvisioningState Canceled { get; } = new DotNetComponentProvisioningState(CanceledValue); + /// Deleting. + public static DotNetComponentProvisioningState Deleting { get; } = new DotNetComponentProvisioningState(DeletingValue); + /// InProgress. + public static DotNetComponentProvisioningState InProgress { get; } = new DotNetComponentProvisioningState(InProgressValue); + /// Determines if two values are the same. + public static bool operator ==(DotNetComponentProvisioningState left, DotNetComponentProvisioningState right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(DotNetComponentProvisioningState left, DotNetComponentProvisioningState right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator DotNetComponentProvisioningState(string value) => new DotNetComponentProvisioningState(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is DotNetComponentProvisioningState other && Equals(other); + /// + public bool Equals(DotNetComponentProvisioningState other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/DotNetComponentServiceBind.Serialization.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/DotNetComponentServiceBind.Serialization.cs new file mode 100644 index 000000000000..a3a6a72218d0 --- /dev/null +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/DotNetComponentServiceBind.Serialization.cs @@ -0,0 +1,200 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.AppContainers.Models +{ + public partial class DotNetComponentServiceBind : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DotNetComponentServiceBind)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(Name)) + { + writer.WritePropertyName("name"u8); + writer.WriteStringValue(Name); + } + if (Optional.IsDefined(ServiceId)) + { + writer.WritePropertyName("serviceId"u8); + writer.WriteStringValue(ServiceId); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + DotNetComponentServiceBind IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DotNetComponentServiceBind)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDotNetComponentServiceBind(document.RootElement, options); + } + + internal static DotNetComponentServiceBind DeserializeDotNetComponentServiceBind(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string name = default; + ResourceIdentifier serviceId = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("serviceId"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + serviceId = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DotNetComponentServiceBind(name, serviceId, serializedAdditionalRawData); + } + + private BinaryData SerializeBicep(ModelReaderWriterOptions options) + { + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Name), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" name: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Name)) + { + builder.Append(" name: "); + if (Name.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{Name}'''"); + } + else + { + builder.AppendLine($"'{Name}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(ServiceId), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" serviceId: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(ServiceId)) + { + builder.Append(" serviceId: "); + builder.AppendLine($"'{ServiceId.ToString()}'"); + } + } + + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerAppContainersContext.Default); + case "bicep": + return SerializeBicep(options); + default: + throw new FormatException($"The model {nameof(DotNetComponentServiceBind)} does not support writing '{options.Format}' format."); + } + } + + DotNetComponentServiceBind IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeDotNetComponentServiceBind(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DotNetComponentServiceBind)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/DotNetComponentServiceBind.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/DotNetComponentServiceBind.cs new file mode 100644 index 000000000000..99e30075c140 --- /dev/null +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/DotNetComponentServiceBind.cs @@ -0,0 +1,72 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.ResourceManager.AppContainers.Models +{ + /// Configuration to bind a .NET Component to another .NET Component. + public partial class DotNetComponentServiceBind + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public DotNetComponentServiceBind() + { + } + + /// Initializes a new instance of . + /// Name of the service bind. + /// Resource id of the target service. + /// Keeps track of any properties unknown to the library. + internal DotNetComponentServiceBind(string name, ResourceIdentifier serviceId, IDictionary serializedAdditionalRawData) + { + Name = name; + ServiceId = serviceId; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Name of the service bind. + [WirePath("name")] + public string Name { get; set; } + /// Resource id of the target service. + [WirePath("serviceId")] + public ResourceIdentifier ServiceId { get; set; } + } +} diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/DotNetComponentType.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/DotNetComponentType.cs new file mode 100644 index 000000000000..9b54570c174b --- /dev/null +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/DotNetComponentType.cs @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.AppContainers.Models +{ + /// Type of the .NET Component. + public readonly partial struct DotNetComponentType : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public DotNetComponentType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string AspireDashboardValue = "AspireDashboard"; + + /// AspireDashboard. + public static DotNetComponentType AspireDashboard { get; } = new DotNetComponentType(AspireDashboardValue); + /// Determines if two values are the same. + public static bool operator ==(DotNetComponentType left, DotNetComponentType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(DotNetComponentType left, DotNetComponentType right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator DotNetComponentType(string value) => new DotNetComponentType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is DotNetComponentType other && Equals(other); + /// + public bool Equals(DotNetComponentType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/DotNetComponentsCollection.Serialization.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/DotNetComponentsCollection.Serialization.cs new file mode 100644 index 000000000000..ed92af6edf1a --- /dev/null +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/DotNetComponentsCollection.Serialization.cs @@ -0,0 +1,212 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.AppContainers.Models +{ + internal partial class DotNetComponentsCollection : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DotNetComponentsCollection)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("value"u8); + writer.WriteStartArray(); + foreach (var item in Value) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + if (options.Format != "W" && Optional.IsDefined(NextLink)) + { + writer.WritePropertyName("nextLink"u8); + writer.WriteStringValue(NextLink); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + DotNetComponentsCollection IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DotNetComponentsCollection)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDotNetComponentsCollection(document.RootElement, options); + } + + internal static DotNetComponentsCollection DeserializeDotNetComponentsCollection(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IReadOnlyList value = default; + string nextLink = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(DotNetComponentData.DeserializeDotNetComponentData(item, options)); + } + value = array; + continue; + } + if (property.NameEquals("nextLink"u8)) + { + nextLink = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DotNetComponentsCollection(value, nextLink, serializedAdditionalRawData); + } + + private BinaryData SerializeBicep(ModelReaderWriterOptions options) + { + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Value), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" value: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsCollectionDefined(Value)) + { + if (Value.Any()) + { + builder.Append(" value: "); + builder.AppendLine("["); + foreach (var item in Value) + { + BicepSerializationHelpers.AppendChildObject(builder, item, options, 4, true, " value: "); + } + builder.AppendLine(" ]"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(NextLink), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" nextLink: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(NextLink)) + { + builder.Append(" nextLink: "); + if (NextLink.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{NextLink}'''"); + } + else + { + builder.AppendLine($"'{NextLink}'"); + } + } + } + + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerAppContainersContext.Default); + case "bicep": + return SerializeBicep(options); + default: + throw new FormatException($"The model {nameof(DotNetComponentsCollection)} does not support writing '{options.Format}' format."); + } + } + + DotNetComponentsCollection IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeDotNetComponentsCollection(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DotNetComponentsCollection)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/DotNetComponentsCollection.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/DotNetComponentsCollection.cs new file mode 100644 index 000000000000..0dc3b14763e8 --- /dev/null +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/DotNetComponentsCollection.cs @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.ResourceManager.AppContainers.Models +{ + /// .NET Components ARM resource. + internal partial class DotNetComponentsCollection + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// Collection of resources. + /// is null. + internal DotNetComponentsCollection(IEnumerable value) + { + Argument.AssertNotNull(value, nameof(value)); + + Value = value.ToList(); + } + + /// Initializes a new instance of . + /// Collection of resources. + /// Link to next page of resources. + /// Keeps track of any properties unknown to the library. + internal DotNetComponentsCollection(IReadOnlyList value, string nextLink, IDictionary serializedAdditionalRawData) + { + Value = value; + NextLink = nextLink; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal DotNetComponentsCollection() + { + } + + /// Collection of resources. + public IReadOnlyList Value { get; } + /// Link to next page of resources. + public string NextLink { get; } + } +} diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/ExecutionStatus.Serialization.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/ExecutionStatus.Serialization.cs new file mode 100644 index 000000000000..8580aac4745b --- /dev/null +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/ExecutionStatus.Serialization.cs @@ -0,0 +1,185 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.AppContainers.Models +{ + internal partial class ExecutionStatus : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ExecutionStatus)} does not support writing '{format}' format."); + } + + if (Optional.IsCollectionDefined(Replicas)) + { + writer.WritePropertyName("replicas"u8); + writer.WriteStartArray(); + foreach (var item in Replicas) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + ExecutionStatus IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ExecutionStatus)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeExecutionStatus(document.RootElement, options); + } + + internal static ExecutionStatus DeserializeExecutionStatus(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IReadOnlyList replicas = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("replicas"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(ReplicaExecutionStatus.DeserializeReplicaExecutionStatus(item, options)); + } + replicas = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ExecutionStatus(replicas ?? new ChangeTrackingList(), serializedAdditionalRawData); + } + + private BinaryData SerializeBicep(ModelReaderWriterOptions options) + { + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Replicas), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" replicas: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsCollectionDefined(Replicas)) + { + if (Replicas.Any()) + { + builder.Append(" replicas: "); + builder.AppendLine("["); + foreach (var item in Replicas) + { + BicepSerializationHelpers.AppendChildObject(builder, item, options, 4, true, " replicas: "); + } + builder.AppendLine(" ]"); + } + } + } + + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerAppContainersContext.Default); + case "bicep": + return SerializeBicep(options); + default: + throw new FormatException($"The model {nameof(ExecutionStatus)} does not support writing '{options.Format}' format."); + } + } + + ExecutionStatus IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeExecutionStatus(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ExecutionStatus)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/ExecutionStatus.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/ExecutionStatus.cs new file mode 100644 index 000000000000..382e07ead5ea --- /dev/null +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/ExecutionStatus.cs @@ -0,0 +1,67 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.AppContainers.Models +{ + /// Container Apps Job execution status. + internal partial class ExecutionStatus + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + internal ExecutionStatus() + { + Replicas = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// Replicas in the execution. + /// Keeps track of any properties unknown to the library. + internal ExecutionStatus(IReadOnlyList replicas, IDictionary serializedAdditionalRawData) + { + Replicas = replicas; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Replicas in the execution. + [WirePath("replicas")] + public IReadOnlyList Replicas { get; } + } +} diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/Header.Serialization.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/Header.Serialization.cs new file mode 100644 index 000000000000..5df3c8bed868 --- /dev/null +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/Header.Serialization.cs @@ -0,0 +1,204 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.AppContainers.Models +{ + public partial class Header : IUtf8JsonSerializable, IJsonModel
+ { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel
)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel
.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel
)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(Header)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(Key)) + { + writer.WritePropertyName("key"u8); + writer.WriteStringValue(Key); + } + if (Optional.IsDefined(Value)) + { + writer.WritePropertyName("value"u8); + writer.WriteStringValue(Value); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + Header IJsonModel
.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel
)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(Header)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeHeader(document.RootElement, options); + } + + internal static Header DeserializeHeader(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string key = default; + string value = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("key"u8)) + { + key = property.Value.GetString(); + continue; + } + if (property.NameEquals("value"u8)) + { + value = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new Header(key, value, serializedAdditionalRawData); + } + + private BinaryData SerializeBicep(ModelReaderWriterOptions options) + { + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Key), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" key: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Key)) + { + builder.Append(" key: "); + if (Key.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{Key}'''"); + } + else + { + builder.AppendLine($"'{Key}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Value), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" value: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Value)) + { + builder.Append(" value: "); + if (Value.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{Value}'''"); + } + else + { + builder.AppendLine($"'{Value}'"); + } + } + } + + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + + BinaryData IPersistableModel
.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel
)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerAppContainersContext.Default); + case "bicep": + return SerializeBicep(options); + default: + throw new FormatException($"The model {nameof(Header)} does not support writing '{options.Format}' format."); + } + } + + Header IPersistableModel
.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel
)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeHeader(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(Header)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel
.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/Header.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/Header.cs new file mode 100644 index 000000000000..d458be50100d --- /dev/null +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/Header.cs @@ -0,0 +1,71 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.AppContainers.Models +{ + /// Header of otlp configuration. + public partial class Header + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public Header() + { + } + + /// Initializes a new instance of . + /// The key of otlp configuration header. + /// The value of otlp configuration header. + /// Keeps track of any properties unknown to the library. + internal Header(string key, string value, IDictionary serializedAdditionalRawData) + { + Key = key; + Value = value; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The key of otlp configuration header. + [WirePath("key")] + public string Key { get; set; } + /// The value of otlp configuration header. + [WirePath("value")] + public string Value { get; set; } + } +} diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/HeaderMatch.Serialization.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/HeaderMatch.Serialization.cs new file mode 100644 index 000000000000..0381b64599e1 --- /dev/null +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/HeaderMatch.Serialization.cs @@ -0,0 +1,330 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.AppContainers.Models +{ + public partial class HeaderMatch : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(HeaderMatch)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(Header)) + { + writer.WritePropertyName("header"u8); + writer.WriteStringValue(Header); + } + writer.WritePropertyName("match"u8); + writer.WriteStartObject(); + if (Optional.IsDefined(ExactMatch)) + { + writer.WritePropertyName("exactMatch"u8); + writer.WriteStringValue(ExactMatch); + } + if (Optional.IsDefined(PrefixMatch)) + { + writer.WritePropertyName("prefixMatch"u8); + writer.WriteStringValue(PrefixMatch); + } + if (Optional.IsDefined(SuffixMatch)) + { + writer.WritePropertyName("suffixMatch"u8); + writer.WriteStringValue(SuffixMatch); + } + if (Optional.IsDefined(RegexMatch)) + { + writer.WritePropertyName("regexMatch"u8); + writer.WriteStringValue(RegexMatch); + } + writer.WriteEndObject(); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + HeaderMatch IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(HeaderMatch)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeHeaderMatch(document.RootElement, options); + } + + internal static HeaderMatch DeserializeHeaderMatch(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string header = default; + string exactMatch = default; + string prefixMatch = default; + string suffixMatch = default; + string regexMatch = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("header"u8)) + { + header = property.Value.GetString(); + continue; + } + if (property.NameEquals("match"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + foreach (var property0 in property.Value.EnumerateObject()) + { + if (property0.NameEquals("exactMatch"u8)) + { + exactMatch = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("prefixMatch"u8)) + { + prefixMatch = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("suffixMatch"u8)) + { + suffixMatch = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("regexMatch"u8)) + { + regexMatch = property0.Value.GetString(); + continue; + } + } + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new HeaderMatch( + header, + exactMatch, + prefixMatch, + suffixMatch, + regexMatch, + serializedAdditionalRawData); + } + + private BinaryData SerializeBicep(ModelReaderWriterOptions options) + { + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Header), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" header: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Header)) + { + builder.Append(" header: "); + if (Header.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{Header}'''"); + } + else + { + builder.AppendLine($"'{Header}'"); + } + } + } + + builder.Append(" match:"); + builder.AppendLine(" {"); + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(ExactMatch), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" exactMatch: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(ExactMatch)) + { + builder.Append(" exactMatch: "); + if (ExactMatch.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{ExactMatch}'''"); + } + else + { + builder.AppendLine($"'{ExactMatch}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(PrefixMatch), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" prefixMatch: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(PrefixMatch)) + { + builder.Append(" prefixMatch: "); + if (PrefixMatch.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{PrefixMatch}'''"); + } + else + { + builder.AppendLine($"'{PrefixMatch}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(SuffixMatch), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" suffixMatch: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(SuffixMatch)) + { + builder.Append(" suffixMatch: "); + if (SuffixMatch.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{SuffixMatch}'''"); + } + else + { + builder.AppendLine($"'{SuffixMatch}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(RegexMatch), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" regexMatch: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(RegexMatch)) + { + builder.Append(" regexMatch: "); + if (RegexMatch.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{RegexMatch}'''"); + } + else + { + builder.AppendLine($"'{RegexMatch}'"); + } + } + } + + builder.AppendLine(" }"); + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerAppContainersContext.Default); + case "bicep": + return SerializeBicep(options); + default: + throw new FormatException($"The model {nameof(HeaderMatch)} does not support writing '{options.Format}' format."); + } + } + + HeaderMatch IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeHeaderMatch(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(HeaderMatch)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/HeaderMatch.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/HeaderMatch.cs new file mode 100644 index 000000000000..117bcef06444 --- /dev/null +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/HeaderMatch.cs @@ -0,0 +1,86 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.AppContainers.Models +{ + /// Conditions required to match a header. + public partial class HeaderMatch + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public HeaderMatch() + { + } + + /// Initializes a new instance of . + /// Name of the header. + /// Exact value of the header. + /// Prefix value of the header. + /// Suffix value of the header. + /// Regex value of the header. + /// Keeps track of any properties unknown to the library. + internal HeaderMatch(string header, string exactMatch, string prefixMatch, string suffixMatch, string regexMatch, IDictionary serializedAdditionalRawData) + { + Header = header; + ExactMatch = exactMatch; + PrefixMatch = prefixMatch; + SuffixMatch = suffixMatch; + RegexMatch = regexMatch; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Name of the header. + [WirePath("header")] + public string Header { get; set; } + /// Exact value of the header. + [WirePath("match.exactMatch")] + public string ExactMatch { get; set; } + /// Prefix value of the header. + [WirePath("match.prefixMatch")] + public string PrefixMatch { get; set; } + /// Suffix value of the header. + [WirePath("match.suffixMatch")] + public string SuffixMatch { get; set; } + /// Regex value of the header. + [WirePath("match.regexMatch")] + public string RegexMatch { get; set; } + } +} diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/HttpConnectionPool.Serialization.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/HttpConnectionPool.Serialization.cs new file mode 100644 index 000000000000..52730459c1a8 --- /dev/null +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/HttpConnectionPool.Serialization.cs @@ -0,0 +1,196 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.AppContainers.Models +{ + public partial class HttpConnectionPool : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(HttpConnectionPool)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(Http1MaxPendingRequests)) + { + writer.WritePropertyName("http1MaxPendingRequests"u8); + writer.WriteNumberValue(Http1MaxPendingRequests.Value); + } + if (Optional.IsDefined(Http2MaxRequests)) + { + writer.WritePropertyName("http2MaxRequests"u8); + writer.WriteNumberValue(Http2MaxRequests.Value); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + HttpConnectionPool IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(HttpConnectionPool)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeHttpConnectionPool(document.RootElement, options); + } + + internal static HttpConnectionPool DeserializeHttpConnectionPool(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + int? http1MaxPendingRequests = default; + int? http2MaxRequests = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("http1MaxPendingRequests"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + http1MaxPendingRequests = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("http2MaxRequests"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + http2MaxRequests = property.Value.GetInt32(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new HttpConnectionPool(http1MaxPendingRequests, http2MaxRequests, serializedAdditionalRawData); + } + + private BinaryData SerializeBicep(ModelReaderWriterOptions options) + { + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Http1MaxPendingRequests), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" http1MaxPendingRequests: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Http1MaxPendingRequests)) + { + builder.Append(" http1MaxPendingRequests: "); + builder.AppendLine($"{Http1MaxPendingRequests.Value}"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Http2MaxRequests), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" http2MaxRequests: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Http2MaxRequests)) + { + builder.Append(" http2MaxRequests: "); + builder.AppendLine($"{Http2MaxRequests.Value}"); + } + } + + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerAppContainersContext.Default); + case "bicep": + return SerializeBicep(options); + default: + throw new FormatException($"The model {nameof(HttpConnectionPool)} does not support writing '{options.Format}' format."); + } + } + + HttpConnectionPool IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeHttpConnectionPool(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(HttpConnectionPool)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/HttpConnectionPool.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/HttpConnectionPool.cs new file mode 100644 index 000000000000..54d24929a7f0 --- /dev/null +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/HttpConnectionPool.cs @@ -0,0 +1,71 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.AppContainers.Models +{ + /// Defines parameters for http connection pooling. + public partial class HttpConnectionPool + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public HttpConnectionPool() + { + } + + /// Initializes a new instance of . + /// Maximum number of pending http1 requests allowed. + /// Maximum number of http2 requests allowed. + /// Keeps track of any properties unknown to the library. + internal HttpConnectionPool(int? http1MaxPendingRequests, int? http2MaxRequests, IDictionary serializedAdditionalRawData) + { + Http1MaxPendingRequests = http1MaxPendingRequests; + Http2MaxRequests = http2MaxRequests; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Maximum number of pending http1 requests allowed. + [WirePath("http1MaxPendingRequests")] + public int? Http1MaxPendingRequests { get; set; } + /// Maximum number of http2 requests allowed. + [WirePath("http2MaxRequests")] + public int? Http2MaxRequests { get; set; } + } +} diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/HttpGet.Serialization.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/HttpGet.Serialization.cs new file mode 100644 index 000000000000..efeff19df792 --- /dev/null +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/HttpGet.Serialization.cs @@ -0,0 +1,255 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.AppContainers.Models +{ + public partial class HttpGet : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(HttpGet)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("url"u8); + writer.WriteStringValue(Uri.AbsoluteUri); + if (Optional.IsDefined(FileName)) + { + writer.WritePropertyName("fileName"u8); + writer.WriteStringValue(FileName); + } + if (Optional.IsCollectionDefined(Headers)) + { + writer.WritePropertyName("headers"u8); + writer.WriteStartArray(); + foreach (var item in Headers) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + HttpGet IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(HttpGet)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeHttpGet(document.RootElement, options); + } + + internal static HttpGet DeserializeHttpGet(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Uri url = default; + string fileName = default; + IList headers = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("url"u8)) + { + url = new Uri(property.Value.GetString()); + continue; + } + if (property.NameEquals("fileName"u8)) + { + fileName = property.Value.GetString(); + continue; + } + if (property.NameEquals("headers"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + headers = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new HttpGet(url, fileName, headers ?? new ChangeTrackingList(), serializedAdditionalRawData); + } + + private BinaryData SerializeBicep(ModelReaderWriterOptions options) + { + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Uri), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" url: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Uri)) + { + builder.Append(" url: "); + builder.AppendLine($"'{Uri.AbsoluteUri}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(FileName), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" fileName: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(FileName)) + { + builder.Append(" fileName: "); + if (FileName.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{FileName}'''"); + } + else + { + builder.AppendLine($"'{FileName}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Headers), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" headers: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsCollectionDefined(Headers)) + { + if (Headers.Any()) + { + builder.Append(" headers: "); + builder.AppendLine("["); + foreach (var item in Headers) + { + if (item == null) + { + builder.Append("null"); + continue; + } + if (item.Contains(Environment.NewLine)) + { + builder.AppendLine(" '''"); + builder.AppendLine($"{item}'''"); + } + else + { + builder.AppendLine($" '{item}'"); + } + } + builder.AppendLine(" ]"); + } + } + } + + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerAppContainersContext.Default); + case "bicep": + return SerializeBicep(options); + default: + throw new FormatException($"The model {nameof(HttpGet)} does not support writing '{options.Format}' format."); + } + } + + HttpGet IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeHttpGet(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(HttpGet)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/HttpGet.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/HttpGet.cs new file mode 100644 index 000000000000..3cde1b7759e9 --- /dev/null +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/HttpGet.cs @@ -0,0 +1,87 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.AppContainers.Models +{ + /// Model representing a http get request. + public partial class HttpGet + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// URL to make HTTP GET request against. + /// is null. + public HttpGet(Uri uri) + { + Argument.AssertNotNull(uri, nameof(uri)); + + Uri = uri; + Headers = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// URL to make HTTP GET request against. + /// Name of the file that the request should be saved to. + /// List of headers to send with the request. + /// Keeps track of any properties unknown to the library. + internal HttpGet(Uri uri, string fileName, IList headers, IDictionary serializedAdditionalRawData) + { + Uri = uri; + FileName = fileName; + Headers = headers; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal HttpGet() + { + } + + /// URL to make HTTP GET request against. + [WirePath("url")] + public Uri Uri { get; set; } + /// Name of the file that the request should be saved to. + [WirePath("fileName")] + public string FileName { get; set; } + /// List of headers to send with the request. + [WirePath("headers")] + public IList Headers { get; } + } +} diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/HttpRetryPolicy.Serialization.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/HttpRetryPolicy.Serialization.cs new file mode 100644 index 000000000000..8808dd3aaaa4 --- /dev/null +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/HttpRetryPolicy.Serialization.cs @@ -0,0 +1,427 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.AppContainers.Models +{ + public partial class HttpRetryPolicy : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(HttpRetryPolicy)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(MaxRetries)) + { + writer.WritePropertyName("maxRetries"u8); + writer.WriteNumberValue(MaxRetries.Value); + } + writer.WritePropertyName("matches"u8); + writer.WriteStartObject(); + if (Optional.IsCollectionDefined(Headers)) + { + writer.WritePropertyName("headers"u8); + writer.WriteStartArray(); + foreach (var item in Headers) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(HttpStatusCodes)) + { + writer.WritePropertyName("httpStatusCodes"u8); + writer.WriteStartArray(); + foreach (var item in HttpStatusCodes) + { + writer.WriteNumberValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(Errors)) + { + writer.WritePropertyName("errors"u8); + writer.WriteStartArray(); + foreach (var item in Errors) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + writer.WriteEndObject(); + writer.WritePropertyName("retryBackOff"u8); + writer.WriteStartObject(); + if (Optional.IsDefined(InitialDelayInMilliseconds)) + { + writer.WritePropertyName("initialDelayInMilliseconds"u8); + writer.WriteNumberValue(InitialDelayInMilliseconds.Value); + } + if (Optional.IsDefined(MaxIntervalInMilliseconds)) + { + writer.WritePropertyName("maxIntervalInMilliseconds"u8); + writer.WriteNumberValue(MaxIntervalInMilliseconds.Value); + } + writer.WriteEndObject(); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + HttpRetryPolicy IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(HttpRetryPolicy)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeHttpRetryPolicy(document.RootElement, options); + } + + internal static HttpRetryPolicy DeserializeHttpRetryPolicy(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + int? maxRetries = default; + IList headers = default; + IList httpStatusCodes = default; + IList errors = default; + long? initialDelayInMilliseconds = default; + long? maxIntervalInMilliseconds = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("maxRetries"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + maxRetries = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("matches"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + foreach (var property0 in property.Value.EnumerateObject()) + { + if (property0.NameEquals("headers"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property0.Value.EnumerateArray()) + { + array.Add(HeaderMatch.DeserializeHeaderMatch(item, options)); + } + headers = array; + continue; + } + if (property0.NameEquals("httpStatusCodes"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property0.Value.EnumerateArray()) + { + array.Add(item.GetInt32()); + } + httpStatusCodes = array; + continue; + } + if (property0.NameEquals("errors"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property0.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + errors = array; + continue; + } + } + continue; + } + if (property.NameEquals("retryBackOff"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + foreach (var property0 in property.Value.EnumerateObject()) + { + if (property0.NameEquals("initialDelayInMilliseconds"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + initialDelayInMilliseconds = property0.Value.GetInt64(); + continue; + } + if (property0.NameEquals("maxIntervalInMilliseconds"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + maxIntervalInMilliseconds = property0.Value.GetInt64(); + continue; + } + } + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new HttpRetryPolicy( + maxRetries, + headers ?? new ChangeTrackingList(), + httpStatusCodes ?? new ChangeTrackingList(), + errors ?? new ChangeTrackingList(), + initialDelayInMilliseconds, + maxIntervalInMilliseconds, + serializedAdditionalRawData); + } + + private BinaryData SerializeBicep(ModelReaderWriterOptions options) + { + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(MaxRetries), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" maxRetries: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(MaxRetries)) + { + builder.Append(" maxRetries: "); + builder.AppendLine($"{MaxRetries.Value}"); + } + } + + builder.Append(" matches:"); + builder.AppendLine(" {"); + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Headers), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" headers: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsCollectionDefined(Headers)) + { + if (Headers.Any()) + { + builder.Append(" headers: "); + builder.AppendLine("["); + foreach (var item in Headers) + { + BicepSerializationHelpers.AppendChildObject(builder, item, options, 6, true, " headers: "); + } + builder.AppendLine(" ]"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(HttpStatusCodes), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" httpStatusCodes: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsCollectionDefined(HttpStatusCodes)) + { + if (HttpStatusCodes.Any()) + { + builder.Append(" httpStatusCodes: "); + builder.AppendLine("["); + foreach (var item in HttpStatusCodes) + { + builder.AppendLine($" {item}"); + } + builder.AppendLine(" ]"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Errors), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" errors: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsCollectionDefined(Errors)) + { + if (Errors.Any()) + { + builder.Append(" errors: "); + builder.AppendLine("["); + foreach (var item in Errors) + { + if (item == null) + { + builder.Append("null"); + continue; + } + if (item.Contains(Environment.NewLine)) + { + builder.AppendLine(" '''"); + builder.AppendLine($"{item}'''"); + } + else + { + builder.AppendLine($" '{item}'"); + } + } + builder.AppendLine(" ]"); + } + } + } + + builder.AppendLine(" }"); + builder.Append(" retryBackOff:"); + builder.AppendLine(" {"); + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(InitialDelayInMilliseconds), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" initialDelayInMilliseconds: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(InitialDelayInMilliseconds)) + { + builder.Append(" initialDelayInMilliseconds: "); + builder.AppendLine($"'{InitialDelayInMilliseconds.Value.ToString()}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(MaxIntervalInMilliseconds), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" maxIntervalInMilliseconds: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(MaxIntervalInMilliseconds)) + { + builder.Append(" maxIntervalInMilliseconds: "); + builder.AppendLine($"'{MaxIntervalInMilliseconds.Value.ToString()}'"); + } + } + + builder.AppendLine(" }"); + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerAppContainersContext.Default); + case "bicep": + return SerializeBicep(options); + default: + throw new FormatException($"The model {nameof(HttpRetryPolicy)} does not support writing '{options.Format}' format."); + } + } + + HttpRetryPolicy IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeHttpRetryPolicy(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(HttpRetryPolicy)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/HttpRetryPolicy.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/HttpRetryPolicy.cs new file mode 100644 index 000000000000..94dbfa60f2a8 --- /dev/null +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/HttpRetryPolicy.cs @@ -0,0 +1,94 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.AppContainers.Models +{ + /// Policy that defines http request retry conditions. + public partial class HttpRetryPolicy + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public HttpRetryPolicy() + { + Headers = new ChangeTrackingList(); + HttpStatusCodes = new ChangeTrackingList(); + Errors = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// Maximum number of times a request will retry. + /// Headers that must be present for a request to be retried. + /// Additional http status codes that can trigger a retry. + /// Errors that can trigger a retry. + /// Initial delay, in milliseconds, before retrying a request. + /// Maximum interval, in milliseconds, between retries. + /// Keeps track of any properties unknown to the library. + internal HttpRetryPolicy(int? maxRetries, IList headers, IList httpStatusCodes, IList errors, long? initialDelayInMilliseconds, long? maxIntervalInMilliseconds, IDictionary serializedAdditionalRawData) + { + MaxRetries = maxRetries; + Headers = headers; + HttpStatusCodes = httpStatusCodes; + Errors = errors; + InitialDelayInMilliseconds = initialDelayInMilliseconds; + MaxIntervalInMilliseconds = maxIntervalInMilliseconds; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Maximum number of times a request will retry. + [WirePath("maxRetries")] + public int? MaxRetries { get; set; } + /// Headers that must be present for a request to be retried. + [WirePath("matches.headers")] + public IList Headers { get; } + /// Additional http status codes that can trigger a retry. + [WirePath("matches.httpStatusCodes")] + public IList HttpStatusCodes { get; } + /// Errors that can trigger a retry. + [WirePath("matches.errors")] + public IList Errors { get; } + /// Initial delay, in milliseconds, before retrying a request. + [WirePath("retryBackOff.initialDelayInMilliseconds")] + public long? InitialDelayInMilliseconds { get; set; } + /// Maximum interval, in milliseconds, between retries. + [WirePath("retryBackOff.maxIntervalInMilliseconds")] + public long? MaxIntervalInMilliseconds { get; set; } + } +} diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/HttpRoute.Serialization.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/HttpRoute.Serialization.cs new file mode 100644 index 000000000000..84d9df7bc834 --- /dev/null +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/HttpRoute.Serialization.cs @@ -0,0 +1,199 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.AppContainers.Models +{ + public partial class HttpRoute : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(HttpRoute)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(Match)) + { + writer.WritePropertyName("match"u8); + writer.WriteObjectValue(Match, options); + } + if (Optional.IsDefined(Action)) + { + writer.WritePropertyName("action"u8); + writer.WriteObjectValue(Action, options); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + HttpRoute IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(HttpRoute)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeHttpRoute(document.RootElement, options); + } + + internal static HttpRoute DeserializeHttpRoute(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + HttpRouteMatch match = default; + HttpRouteAction action = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("match"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + match = HttpRouteMatch.DeserializeHttpRouteMatch(property.Value, options); + continue; + } + if (property.NameEquals("action"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + action = HttpRouteAction.DeserializeHttpRouteAction(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new HttpRoute(match, action, serializedAdditionalRawData); + } + + private BinaryData SerializeBicep(ModelReaderWriterOptions options) + { + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Match), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" match: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Match)) + { + builder.Append(" match: "); + BicepSerializationHelpers.AppendChildObject(builder, Match, options, 2, false, " match: "); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue("ActionPrefixRewrite", out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" action: "); + builder.AppendLine("{"); + builder.Append(" prefixRewrite: "); + builder.AppendLine(propertyOverride); + builder.AppendLine(" }"); + } + else + { + if (Optional.IsDefined(Action)) + { + builder.Append(" action: "); + BicepSerializationHelpers.AppendChildObject(builder, Action, options, 2, false, " action: "); + } + } + + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerAppContainersContext.Default); + case "bicep": + return SerializeBicep(options); + default: + throw new FormatException($"The model {nameof(HttpRoute)} does not support writing '{options.Format}' format."); + } + } + + HttpRoute IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeHttpRoute(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(HttpRoute)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/HttpRoute.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/HttpRoute.cs new file mode 100644 index 000000000000..4c0355ee9d45 --- /dev/null +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/HttpRoute.cs @@ -0,0 +1,82 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.AppContainers.Models +{ + /// Http Routes configuration, including paths to match on and whether or not rewrites are to be done. + public partial class HttpRoute + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public HttpRoute() + { + } + + /// Initializes a new instance of . + /// Conditions route will match on. + /// Once route is matched, what is the desired action. + /// Keeps track of any properties unknown to the library. + internal HttpRoute(HttpRouteMatch match, HttpRouteAction action, IDictionary serializedAdditionalRawData) + { + Match = match; + Action = action; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Conditions route will match on. + [WirePath("match")] + public HttpRouteMatch Match { get; set; } + /// Once route is matched, what is the desired action. + internal HttpRouteAction Action { get; set; } + /// Rewrite prefix, default is no rewrites. + [WirePath("action.prefixRewrite")] + public string ActionPrefixRewrite + { + get => Action is null ? default : Action.PrefixRewrite; + set + { + if (Action is null) + Action = new HttpRouteAction(); + Action.PrefixRewrite = value; + } + } + } +} diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/HttpRouteAction.Serialization.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/HttpRouteAction.Serialization.cs new file mode 100644 index 000000000000..d2dc4430a7c7 --- /dev/null +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/HttpRouteAction.Serialization.cs @@ -0,0 +1,170 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.AppContainers.Models +{ + internal partial class HttpRouteAction : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(HttpRouteAction)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(PrefixRewrite)) + { + writer.WritePropertyName("prefixRewrite"u8); + writer.WriteStringValue(PrefixRewrite); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + HttpRouteAction IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(HttpRouteAction)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeHttpRouteAction(document.RootElement, options); + } + + internal static HttpRouteAction DeserializeHttpRouteAction(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string prefixRewrite = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("prefixRewrite"u8)) + { + prefixRewrite = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new HttpRouteAction(prefixRewrite, serializedAdditionalRawData); + } + + private BinaryData SerializeBicep(ModelReaderWriterOptions options) + { + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(PrefixRewrite), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" prefixRewrite: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(PrefixRewrite)) + { + builder.Append(" prefixRewrite: "); + if (PrefixRewrite.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{PrefixRewrite}'''"); + } + else + { + builder.AppendLine($"'{PrefixRewrite}'"); + } + } + } + + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerAppContainersContext.Default); + case "bicep": + return SerializeBicep(options); + default: + throw new FormatException($"The model {nameof(HttpRouteAction)} does not support writing '{options.Format}' format."); + } + } + + HttpRouteAction IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeHttpRouteAction(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(HttpRouteAction)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/HttpRouteAction.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/HttpRouteAction.cs new file mode 100644 index 000000000000..af7047df9ab5 --- /dev/null +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/HttpRouteAction.cs @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.AppContainers.Models +{ + /// Action to perform once matching of routes is done. + internal partial class HttpRouteAction + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public HttpRouteAction() + { + } + + /// Initializes a new instance of . + /// Rewrite prefix, default is no rewrites. + /// Keeps track of any properties unknown to the library. + internal HttpRouteAction(string prefixRewrite, IDictionary serializedAdditionalRawData) + { + PrefixRewrite = prefixRewrite; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Rewrite prefix, default is no rewrites. + [WirePath("prefixRewrite")] + public string PrefixRewrite { get; set; } + } +} diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/HttpRouteConfigCollection.Serialization.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/HttpRouteConfigCollection.Serialization.cs new file mode 100644 index 000000000000..c385a6aae6db --- /dev/null +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/HttpRouteConfigCollection.Serialization.cs @@ -0,0 +1,212 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.AppContainers.Models +{ + internal partial class HttpRouteConfigCollection : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(HttpRouteConfigCollection)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("value"u8); + writer.WriteStartArray(); + foreach (var item in Value) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + if (options.Format != "W" && Optional.IsDefined(NextLink)) + { + writer.WritePropertyName("nextLink"u8); + writer.WriteStringValue(NextLink); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + HttpRouteConfigCollection IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(HttpRouteConfigCollection)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeHttpRouteConfigCollection(document.RootElement, options); + } + + internal static HttpRouteConfigCollection DeserializeHttpRouteConfigCollection(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IReadOnlyList value = default; + string nextLink = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(HttpRouteConfigData.DeserializeHttpRouteConfigData(item, options)); + } + value = array; + continue; + } + if (property.NameEquals("nextLink"u8)) + { + nextLink = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new HttpRouteConfigCollection(value, nextLink, serializedAdditionalRawData); + } + + private BinaryData SerializeBicep(ModelReaderWriterOptions options) + { + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Value), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" value: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsCollectionDefined(Value)) + { + if (Value.Any()) + { + builder.Append(" value: "); + builder.AppendLine("["); + foreach (var item in Value) + { + BicepSerializationHelpers.AppendChildObject(builder, item, options, 4, true, " value: "); + } + builder.AppendLine(" ]"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(NextLink), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" nextLink: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(NextLink)) + { + builder.Append(" nextLink: "); + if (NextLink.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{NextLink}'''"); + } + else + { + builder.AppendLine($"'{NextLink}'"); + } + } + } + + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerAppContainersContext.Default); + case "bicep": + return SerializeBicep(options); + default: + throw new FormatException($"The model {nameof(HttpRouteConfigCollection)} does not support writing '{options.Format}' format."); + } + } + + HttpRouteConfigCollection IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeHttpRouteConfigCollection(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(HttpRouteConfigCollection)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/HttpRouteConfigCollection.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/HttpRouteConfigCollection.cs new file mode 100644 index 000000000000..f15922b245a7 --- /dev/null +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/HttpRouteConfigCollection.cs @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.ResourceManager.AppContainers.Models +{ + /// Collection of Advanced Ingress Routing Config resources. + internal partial class HttpRouteConfigCollection + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// Collection of resources. + /// is null. + internal HttpRouteConfigCollection(IEnumerable value) + { + Argument.AssertNotNull(value, nameof(value)); + + Value = value.ToList(); + } + + /// Initializes a new instance of . + /// Collection of resources. + /// Link to next page of resources. + /// Keeps track of any properties unknown to the library. + internal HttpRouteConfigCollection(IReadOnlyList value, string nextLink, IDictionary serializedAdditionalRawData) + { + Value = value; + NextLink = nextLink; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal HttpRouteConfigCollection() + { + } + + /// Collection of resources. + public IReadOnlyList Value { get; } + /// Link to next page of resources. + public string NextLink { get; } + } +} diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/HttpRouteConfigProperties.Serialization.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/HttpRouteConfigProperties.Serialization.cs new file mode 100644 index 000000000000..0c7962632e69 --- /dev/null +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/HttpRouteConfigProperties.Serialization.cs @@ -0,0 +1,351 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.AppContainers.Models +{ + public partial class HttpRouteConfigProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(HttpRouteConfigProperties)} does not support writing '{format}' format."); + } + + if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) + { + writer.WritePropertyName("provisioningState"u8); + writer.WriteStringValue(ProvisioningState.Value.ToString()); + } + if (options.Format != "W" && Optional.IsCollectionDefined(ProvisioningErrors)) + { + writer.WritePropertyName("provisioningErrors"u8); + writer.WriteStartArray(); + foreach (var item in ProvisioningErrors) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && Optional.IsDefined(Fqdn)) + { + writer.WritePropertyName("fqdn"u8); + writer.WriteStringValue(Fqdn); + } + if (Optional.IsCollectionDefined(CustomDomains)) + { + writer.WritePropertyName("customDomains"u8); + writer.WriteStartArray(); + foreach (var item in CustomDomains) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(Rules)) + { + writer.WritePropertyName("rules"u8); + writer.WriteStartArray(); + foreach (var item in Rules) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + HttpRouteConfigProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(HttpRouteConfigProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeHttpRouteConfigProperties(document.RootElement, options); + } + + internal static HttpRouteConfigProperties DeserializeHttpRouteConfigProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + HttpRouteProvisioningState? provisioningState = default; + IReadOnlyList provisioningErrors = default; + string fqdn = default; + IList customDomains = default; + IList rules = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("provisioningState"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + provisioningState = new HttpRouteProvisioningState(property.Value.GetString()); + continue; + } + if (property.NameEquals("provisioningErrors"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(HttpRouteProvisioningErrors.DeserializeHttpRouteProvisioningErrors(item, options)); + } + provisioningErrors = array; + continue; + } + if (property.NameEquals("fqdn"u8)) + { + fqdn = property.Value.GetString(); + continue; + } + if (property.NameEquals("customDomains"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(ContainerAppCustomDomain.DeserializeContainerAppCustomDomain(item, options)); + } + customDomains = array; + continue; + } + if (property.NameEquals("rules"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(HttpRouteRule.DeserializeHttpRouteRule(item, options)); + } + rules = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new HttpRouteConfigProperties( + provisioningState, + provisioningErrors ?? new ChangeTrackingList(), + fqdn, + customDomains ?? new ChangeTrackingList(), + rules ?? new ChangeTrackingList(), + serializedAdditionalRawData); + } + + private BinaryData SerializeBicep(ModelReaderWriterOptions options) + { + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(ProvisioningState), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" provisioningState: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(ProvisioningState)) + { + builder.Append(" provisioningState: "); + builder.AppendLine($"'{ProvisioningState.Value.ToString()}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(ProvisioningErrors), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" provisioningErrors: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsCollectionDefined(ProvisioningErrors)) + { + if (ProvisioningErrors.Any()) + { + builder.Append(" provisioningErrors: "); + builder.AppendLine("["); + foreach (var item in ProvisioningErrors) + { + BicepSerializationHelpers.AppendChildObject(builder, item, options, 4, true, " provisioningErrors: "); + } + builder.AppendLine(" ]"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Fqdn), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" fqdn: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Fqdn)) + { + builder.Append(" fqdn: "); + if (Fqdn.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{Fqdn}'''"); + } + else + { + builder.AppendLine($"'{Fqdn}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(CustomDomains), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" customDomains: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsCollectionDefined(CustomDomains)) + { + if (CustomDomains.Any()) + { + builder.Append(" customDomains: "); + builder.AppendLine("["); + foreach (var item in CustomDomains) + { + BicepSerializationHelpers.AppendChildObject(builder, item, options, 4, true, " customDomains: "); + } + builder.AppendLine(" ]"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Rules), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" rules: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsCollectionDefined(Rules)) + { + if (Rules.Any()) + { + builder.Append(" rules: "); + builder.AppendLine("["); + foreach (var item in Rules) + { + BicepSerializationHelpers.AppendChildObject(builder, item, options, 4, true, " rules: "); + } + builder.AppendLine(" ]"); + } + } + } + + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerAppContainersContext.Default); + case "bicep": + return SerializeBicep(options); + default: + throw new FormatException($"The model {nameof(HttpRouteConfigProperties)} does not support writing '{options.Format}' format."); + } + } + + HttpRouteConfigProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeHttpRouteConfigProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(HttpRouteConfigProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/HttpRouteConfigProperties.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/HttpRouteConfigProperties.cs new file mode 100644 index 000000000000..64de23b08d95 --- /dev/null +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/HttpRouteConfigProperties.cs @@ -0,0 +1,89 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.AppContainers.Models +{ + /// Http Route Config properties. + public partial class HttpRouteConfigProperties + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public HttpRouteConfigProperties() + { + ProvisioningErrors = new ChangeTrackingList(); + CustomDomains = new ChangeTrackingList(); + Rules = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// The provisioning state of the Http Route Config in cluster. + /// List of errors when trying to reconcile http routes. + /// FQDN of the route resource. + /// Custom domain bindings for http Routes' hostnames. + /// Routing Rules for http route resource. + /// Keeps track of any properties unknown to the library. + internal HttpRouteConfigProperties(HttpRouteProvisioningState? provisioningState, IReadOnlyList provisioningErrors, string fqdn, IList customDomains, IList rules, IDictionary serializedAdditionalRawData) + { + ProvisioningState = provisioningState; + ProvisioningErrors = provisioningErrors; + Fqdn = fqdn; + CustomDomains = customDomains; + Rules = rules; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The provisioning state of the Http Route Config in cluster. + [WirePath("provisioningState")] + public HttpRouteProvisioningState? ProvisioningState { get; } + /// List of errors when trying to reconcile http routes. + [WirePath("provisioningErrors")] + public IReadOnlyList ProvisioningErrors { get; } + /// FQDN of the route resource. + [WirePath("fqdn")] + public string Fqdn { get; } + /// Custom domain bindings for http Routes' hostnames. + [WirePath("customDomains")] + public IList CustomDomains { get; } + /// Routing Rules for http route resource. + [WirePath("rules")] + public IList Rules { get; } + } +} diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/HttpRouteMatch.Serialization.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/HttpRouteMatch.Serialization.cs new file mode 100644 index 000000000000..ddebfd43e00a --- /dev/null +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/HttpRouteMatch.Serialization.cs @@ -0,0 +1,269 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.AppContainers.Models +{ + public partial class HttpRouteMatch : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(HttpRouteMatch)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(Prefix)) + { + writer.WritePropertyName("prefix"u8); + writer.WriteStringValue(Prefix); + } + if (Optional.IsDefined(Path)) + { + writer.WritePropertyName("path"u8); + writer.WriteStringValue(Path); + } + if (Optional.IsDefined(PathSeparatedPrefix)) + { + writer.WritePropertyName("pathSeparatedPrefix"u8); + writer.WriteStringValue(PathSeparatedPrefix); + } + if (Optional.IsDefined(CaseSensitive)) + { + writer.WritePropertyName("caseSensitive"u8); + writer.WriteBooleanValue(CaseSensitive.Value); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + HttpRouteMatch IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(HttpRouteMatch)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeHttpRouteMatch(document.RootElement, options); + } + + internal static HttpRouteMatch DeserializeHttpRouteMatch(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string prefix = default; + string path = default; + string pathSeparatedPrefix = default; + bool? caseSensitive = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("prefix"u8)) + { + prefix = property.Value.GetString(); + continue; + } + if (property.NameEquals("path"u8)) + { + path = property.Value.GetString(); + continue; + } + if (property.NameEquals("pathSeparatedPrefix"u8)) + { + pathSeparatedPrefix = property.Value.GetString(); + continue; + } + if (property.NameEquals("caseSensitive"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + caseSensitive = property.Value.GetBoolean(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new HttpRouteMatch(prefix, path, pathSeparatedPrefix, caseSensitive, serializedAdditionalRawData); + } + + private BinaryData SerializeBicep(ModelReaderWriterOptions options) + { + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Prefix), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" prefix: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Prefix)) + { + builder.Append(" prefix: "); + if (Prefix.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{Prefix}'''"); + } + else + { + builder.AppendLine($"'{Prefix}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Path), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" path: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Path)) + { + builder.Append(" path: "); + if (Path.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{Path}'''"); + } + else + { + builder.AppendLine($"'{Path}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(PathSeparatedPrefix), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" pathSeparatedPrefix: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(PathSeparatedPrefix)) + { + builder.Append(" pathSeparatedPrefix: "); + if (PathSeparatedPrefix.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{PathSeparatedPrefix}'''"); + } + else + { + builder.AppendLine($"'{PathSeparatedPrefix}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(CaseSensitive), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" caseSensitive: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(CaseSensitive)) + { + builder.Append(" caseSensitive: "); + var boolValue = CaseSensitive.Value == true ? "true" : "false"; + builder.AppendLine($"{boolValue}"); + } + } + + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerAppContainersContext.Default); + case "bicep": + return SerializeBicep(options); + default: + throw new FormatException($"The model {nameof(HttpRouteMatch)} does not support writing '{options.Format}' format."); + } + } + + HttpRouteMatch IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeHttpRouteMatch(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(HttpRouteMatch)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/HttpRouteMatch.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/HttpRouteMatch.cs new file mode 100644 index 000000000000..eb412445f95b --- /dev/null +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/HttpRouteMatch.cs @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.AppContainers.Models +{ + /// Criteria to match on. + public partial class HttpRouteMatch + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public HttpRouteMatch() + { + } + + /// Initializes a new instance of . + /// match on all prefix's. Not exact. + /// match on exact path. + /// match on all prefix's. Not exact. + /// path case sensitive, default is true. + /// Keeps track of any properties unknown to the library. + internal HttpRouteMatch(string prefix, string path, string pathSeparatedPrefix, bool? caseSensitive, IDictionary serializedAdditionalRawData) + { + Prefix = prefix; + Path = path; + PathSeparatedPrefix = pathSeparatedPrefix; + CaseSensitive = caseSensitive; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// match on all prefix's. Not exact. + [WirePath("prefix")] + public string Prefix { get; set; } + /// match on exact path. + [WirePath("path")] + public string Path { get; set; } + /// match on all prefix's. Not exact. + [WirePath("pathSeparatedPrefix")] + public string PathSeparatedPrefix { get; set; } + /// path case sensitive, default is true. + [WirePath("caseSensitive")] + public bool? CaseSensitive { get; set; } + } +} diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/HttpRouteProvisioningErrors.Serialization.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/HttpRouteProvisioningErrors.Serialization.cs new file mode 100644 index 000000000000..475ccfc992a6 --- /dev/null +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/HttpRouteProvisioningErrors.Serialization.cs @@ -0,0 +1,201 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.AppContainers.Models +{ + public partial class HttpRouteProvisioningErrors : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(HttpRouteProvisioningErrors)} does not support writing '{format}' format."); + } + + if (options.Format != "W" && Optional.IsDefined(Timestamp)) + { + writer.WritePropertyName("timestamp"u8); + writer.WriteStringValue(Timestamp.Value, "O"); + } + if (options.Format != "W" && Optional.IsDefined(Message)) + { + writer.WritePropertyName("message"u8); + writer.WriteStringValue(Message); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + HttpRouteProvisioningErrors IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(HttpRouteProvisioningErrors)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeHttpRouteProvisioningErrors(document.RootElement, options); + } + + internal static HttpRouteProvisioningErrors DeserializeHttpRouteProvisioningErrors(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + DateTimeOffset? timestamp = default; + string message = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("timestamp"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + timestamp = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("message"u8)) + { + message = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new HttpRouteProvisioningErrors(timestamp, message, serializedAdditionalRawData); + } + + private BinaryData SerializeBicep(ModelReaderWriterOptions options) + { + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Timestamp), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" timestamp: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Timestamp)) + { + builder.Append(" timestamp: "); + var formattedDateTimeString = TypeFormatters.ToString(Timestamp.Value, "o"); + builder.AppendLine($"'{formattedDateTimeString}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Message), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" message: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Message)) + { + builder.Append(" message: "); + if (Message.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{Message}'''"); + } + else + { + builder.AppendLine($"'{Message}'"); + } + } + } + + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerAppContainersContext.Default); + case "bicep": + return SerializeBicep(options); + default: + throw new FormatException($"The model {nameof(HttpRouteProvisioningErrors)} does not support writing '{options.Format}' format."); + } + } + + HttpRouteProvisioningErrors IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeHttpRouteProvisioningErrors(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(HttpRouteProvisioningErrors)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/HttpRouteProvisioningErrors.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/HttpRouteProvisioningErrors.cs new file mode 100644 index 000000000000..4b895a14a491 --- /dev/null +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/HttpRouteProvisioningErrors.cs @@ -0,0 +1,71 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.AppContainers.Models +{ + /// List of provisioning errors for a http route config object. + public partial class HttpRouteProvisioningErrors + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + internal HttpRouteProvisioningErrors() + { + } + + /// Initializes a new instance of . + /// Timestamp error occured at. + /// Description or error message. + /// Keeps track of any properties unknown to the library. + internal HttpRouteProvisioningErrors(DateTimeOffset? timestamp, string message, IDictionary serializedAdditionalRawData) + { + Timestamp = timestamp; + Message = message; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Timestamp error occured at. + [WirePath("timestamp")] + public DateTimeOffset? Timestamp { get; } + /// Description or error message. + [WirePath("message")] + public string Message { get; } + } +} diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/HttpRouteProvisioningState.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/HttpRouteProvisioningState.cs new file mode 100644 index 000000000000..a3c51b26eb22 --- /dev/null +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/HttpRouteProvisioningState.cs @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.AppContainers.Models +{ + /// The current provisioning state. + public readonly partial struct HttpRouteProvisioningState : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public HttpRouteProvisioningState(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string SucceededValue = "Succeeded"; + private const string FailedValue = "Failed"; + private const string CanceledValue = "Canceled"; + private const string WaitingValue = "Waiting"; + private const string UpdatingValue = "Updating"; + private const string DeletingValue = "Deleting"; + private const string PendingValue = "Pending"; + + /// Succeeded. + public static HttpRouteProvisioningState Succeeded { get; } = new HttpRouteProvisioningState(SucceededValue); + /// Failed. + public static HttpRouteProvisioningState Failed { get; } = new HttpRouteProvisioningState(FailedValue); + /// Canceled. + public static HttpRouteProvisioningState Canceled { get; } = new HttpRouteProvisioningState(CanceledValue); + /// Waiting. + public static HttpRouteProvisioningState Waiting { get; } = new HttpRouteProvisioningState(WaitingValue); + /// Updating. + public static HttpRouteProvisioningState Updating { get; } = new HttpRouteProvisioningState(UpdatingValue); + /// Deleting. + public static HttpRouteProvisioningState Deleting { get; } = new HttpRouteProvisioningState(DeletingValue); + /// Pending. + public static HttpRouteProvisioningState Pending { get; } = new HttpRouteProvisioningState(PendingValue); + /// Determines if two values are the same. + public static bool operator ==(HttpRouteProvisioningState left, HttpRouteProvisioningState right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(HttpRouteProvisioningState left, HttpRouteProvisioningState right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator HttpRouteProvisioningState(string value) => new HttpRouteProvisioningState(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is HttpRouteProvisioningState other && Equals(other); + /// + public bool Equals(HttpRouteProvisioningState other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/HttpRouteRule.Serialization.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/HttpRouteRule.Serialization.cs new file mode 100644 index 000000000000..56accdae708c --- /dev/null +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/HttpRouteRule.Serialization.cs @@ -0,0 +1,267 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.AppContainers.Models +{ + public partial class HttpRouteRule : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(HttpRouteRule)} does not support writing '{format}' format."); + } + + if (Optional.IsCollectionDefined(Targets)) + { + writer.WritePropertyName("targets"u8); + writer.WriteStartArray(); + foreach (var item in Targets) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(Routes)) + { + writer.WritePropertyName("routes"u8); + writer.WriteStartArray(); + foreach (var item in Routes) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(Description)) + { + writer.WritePropertyName("description"u8); + writer.WriteStringValue(Description); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + HttpRouteRule IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(HttpRouteRule)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeHttpRouteRule(document.RootElement, options); + } + + internal static HttpRouteRule DeserializeHttpRouteRule(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IList targets = default; + IList routes = default; + string description = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("targets"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(HttpRouteTarget.DeserializeHttpRouteTarget(item, options)); + } + targets = array; + continue; + } + if (property.NameEquals("routes"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(HttpRoute.DeserializeHttpRoute(item, options)); + } + routes = array; + continue; + } + if (property.NameEquals("description"u8)) + { + description = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new HttpRouteRule(targets ?? new ChangeTrackingList(), routes ?? new ChangeTrackingList(), description, serializedAdditionalRawData); + } + + private BinaryData SerializeBicep(ModelReaderWriterOptions options) + { + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Targets), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" targets: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsCollectionDefined(Targets)) + { + if (Targets.Any()) + { + builder.Append(" targets: "); + builder.AppendLine("["); + foreach (var item in Targets) + { + BicepSerializationHelpers.AppendChildObject(builder, item, options, 4, true, " targets: "); + } + builder.AppendLine(" ]"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Routes), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" routes: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsCollectionDefined(Routes)) + { + if (Routes.Any()) + { + builder.Append(" routes: "); + builder.AppendLine("["); + foreach (var item in Routes) + { + BicepSerializationHelpers.AppendChildObject(builder, item, options, 4, true, " routes: "); + } + builder.AppendLine(" ]"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Description), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" description: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Description)) + { + builder.Append(" description: "); + if (Description.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{Description}'''"); + } + else + { + builder.AppendLine($"'{Description}'"); + } + } + } + + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerAppContainersContext.Default); + case "bicep": + return SerializeBicep(options); + default: + throw new FormatException($"The model {nameof(HttpRouteRule)} does not support writing '{options.Format}' format."); + } + } + + HttpRouteRule IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeHttpRouteRule(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(HttpRouteRule)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/HttpRouteRule.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/HttpRouteRule.cs new file mode 100644 index 000000000000..7b48e85f3618 --- /dev/null +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/HttpRouteRule.cs @@ -0,0 +1,78 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.AppContainers.Models +{ + /// Http Route rule. + public partial class HttpRouteRule + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public HttpRouteRule() + { + Targets = new ChangeTrackingList(); + Routes = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// Targets- container apps, revisions, labels. + /// Routing configuration that will allow matches on specific paths/headers. + /// Description of rule. Optional. + /// Keeps track of any properties unknown to the library. + internal HttpRouteRule(IList targets, IList routes, string description, IDictionary serializedAdditionalRawData) + { + Targets = targets; + Routes = routes; + Description = description; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Targets- container apps, revisions, labels. + [WirePath("targets")] + public IList Targets { get; } + /// Routing configuration that will allow matches on specific paths/headers. + [WirePath("routes")] + public IList Routes { get; } + /// Description of rule. Optional. + [WirePath("description")] + public string Description { get; set; } + } +} diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/HttpRouteTarget.Serialization.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/HttpRouteTarget.Serialization.cs new file mode 100644 index 000000000000..db77cb847553 --- /dev/null +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/HttpRouteTarget.Serialization.cs @@ -0,0 +1,265 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.AppContainers.Models +{ + public partial class HttpRouteTarget : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(HttpRouteTarget)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("containerApp"u8); + writer.WriteStringValue(ContainerApp); + if (Optional.IsDefined(Revision)) + { + writer.WritePropertyName("revision"u8); + writer.WriteStringValue(Revision); + } + if (Optional.IsDefined(Label)) + { + writer.WritePropertyName("label"u8); + writer.WriteStringValue(Label); + } + if (Optional.IsDefined(Weight)) + { + writer.WritePropertyName("weight"u8); + writer.WriteNumberValue(Weight.Value); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + HttpRouteTarget IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(HttpRouteTarget)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeHttpRouteTarget(document.RootElement, options); + } + + internal static HttpRouteTarget DeserializeHttpRouteTarget(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string containerApp = default; + string revision = default; + string label = default; + int? weight = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("containerApp"u8)) + { + containerApp = property.Value.GetString(); + continue; + } + if (property.NameEquals("revision"u8)) + { + revision = property.Value.GetString(); + continue; + } + if (property.NameEquals("label"u8)) + { + label = property.Value.GetString(); + continue; + } + if (property.NameEquals("weight"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + weight = property.Value.GetInt32(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new HttpRouteTarget(containerApp, revision, label, weight, serializedAdditionalRawData); + } + + private BinaryData SerializeBicep(ModelReaderWriterOptions options) + { + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(ContainerApp), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" containerApp: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(ContainerApp)) + { + builder.Append(" containerApp: "); + if (ContainerApp.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{ContainerApp}'''"); + } + else + { + builder.AppendLine($"'{ContainerApp}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Revision), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" revision: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Revision)) + { + builder.Append(" revision: "); + if (Revision.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{Revision}'''"); + } + else + { + builder.AppendLine($"'{Revision}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Label), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" label: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Label)) + { + builder.Append(" label: "); + if (Label.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{Label}'''"); + } + else + { + builder.AppendLine($"'{Label}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Weight), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" weight: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Weight)) + { + builder.Append(" weight: "); + builder.AppendLine($"{Weight.Value}"); + } + } + + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerAppContainersContext.Default); + case "bicep": + return SerializeBicep(options); + default: + throw new FormatException($"The model {nameof(HttpRouteTarget)} does not support writing '{options.Format}' format."); + } + } + + HttpRouteTarget IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeHttpRouteTarget(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(HttpRouteTarget)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/HttpRouteTarget.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/HttpRouteTarget.cs new file mode 100644 index 000000000000..ab1ebf2b0923 --- /dev/null +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/HttpRouteTarget.cs @@ -0,0 +1,91 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.AppContainers.Models +{ + /// Targets - Container App Names, Revision Names, Labels. + public partial class HttpRouteTarget + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// Container App Name to route requests to. + /// is null. + public HttpRouteTarget(string containerApp) + { + Argument.AssertNotNull(containerApp, nameof(containerApp)); + + ContainerApp = containerApp; + } + + /// Initializes a new instance of . + /// Container App Name to route requests to. + /// Revision to route requests to. + /// Label/Revision to route requests to. + /// Weighted routing. + /// Keeps track of any properties unknown to the library. + internal HttpRouteTarget(string containerApp, string revision, string label, int? weight, IDictionary serializedAdditionalRawData) + { + ContainerApp = containerApp; + Revision = revision; + Label = label; + Weight = weight; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal HttpRouteTarget() + { + } + + /// Container App Name to route requests to. + [WirePath("containerApp")] + public string ContainerApp { get; set; } + /// Revision to route requests to. + [WirePath("revision")] + public string Revision { get; set; } + /// Label/Revision to route requests to. + [WirePath("label")] + public string Label { get; set; } + /// Weighted routing. + [WirePath("weight")] + public int? Weight { get; set; } + } +} diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/ImageType.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/ImageType.cs new file mode 100644 index 000000000000..1140fe532b34 --- /dev/null +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/ImageType.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.AppContainers.Models +{ + /// The type of the image. Set to CloudBuild to let the system manages the image, where user will not be able to update image through image field. Set to ContainerImage for user provided image. + public readonly partial struct ImageType : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public ImageType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string CloudBuildValue = "CloudBuild"; + private const string ContainerImageValue = "ContainerImage"; + + /// CloudBuild. + public static ImageType CloudBuild { get; } = new ImageType(CloudBuildValue); + /// ContainerImage. + public static ImageType ContainerImage { get; } = new ImageType(ContainerImageValue); + /// Determines if two values are the same. + public static bool operator ==(ImageType left, ImageType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(ImageType left, ImageType right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator ImageType(string value) => new ImageType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is ImageType other && Equals(other); + /// + public bool Equals(ImageType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/IngressConfiguration.Serialization.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/IngressConfiguration.Serialization.cs new file mode 100644 index 000000000000..999d45eba6e0 --- /dev/null +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/IngressConfiguration.Serialization.cs @@ -0,0 +1,296 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.AppContainers.Models +{ + public partial class IngressConfiguration : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(IngressConfiguration)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(WorkloadProfileName)) + { + writer.WritePropertyName("workloadProfileName"u8); + writer.WriteStringValue(WorkloadProfileName); + } + if (Optional.IsDefined(Scale)) + { + writer.WritePropertyName("scale"u8); + writer.WriteObjectValue(Scale, options); + } + if (Optional.IsDefined(TerminationGracePeriodSeconds)) + { + writer.WritePropertyName("terminationGracePeriodSeconds"u8); + writer.WriteNumberValue(TerminationGracePeriodSeconds.Value); + } + if (Optional.IsDefined(HeaderCountLimit)) + { + writer.WritePropertyName("headerCountLimit"u8); + writer.WriteNumberValue(HeaderCountLimit.Value); + } + if (Optional.IsDefined(RequestIdleTimeout)) + { + writer.WritePropertyName("requestIdleTimeout"u8); + writer.WriteNumberValue(RequestIdleTimeout.Value); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + IngressConfiguration IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(IngressConfiguration)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeIngressConfiguration(document.RootElement, options); + } + + internal static IngressConfiguration DeserializeIngressConfiguration(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string workloadProfileName = default; + IngressConfigurationScale scale = default; + int? terminationGracePeriodSeconds = default; + int? headerCountLimit = default; + int? requestIdleTimeout = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("workloadProfileName"u8)) + { + workloadProfileName = property.Value.GetString(); + continue; + } + if (property.NameEquals("scale"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + scale = IngressConfigurationScale.DeserializeIngressConfigurationScale(property.Value, options); + continue; + } + if (property.NameEquals("terminationGracePeriodSeconds"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + terminationGracePeriodSeconds = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("headerCountLimit"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + headerCountLimit = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("requestIdleTimeout"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + requestIdleTimeout = property.Value.GetInt32(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new IngressConfiguration( + workloadProfileName, + scale, + terminationGracePeriodSeconds, + headerCountLimit, + requestIdleTimeout, + serializedAdditionalRawData); + } + + private BinaryData SerializeBicep(ModelReaderWriterOptions options) + { + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(WorkloadProfileName), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" workloadProfileName: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(WorkloadProfileName)) + { + builder.Append(" workloadProfileName: "); + if (WorkloadProfileName.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{WorkloadProfileName}'''"); + } + else + { + builder.AppendLine($"'{WorkloadProfileName}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Scale), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" scale: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Scale)) + { + builder.Append(" scale: "); + BicepSerializationHelpers.AppendChildObject(builder, Scale, options, 2, false, " scale: "); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(TerminationGracePeriodSeconds), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" terminationGracePeriodSeconds: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(TerminationGracePeriodSeconds)) + { + builder.Append(" terminationGracePeriodSeconds: "); + builder.AppendLine($"{TerminationGracePeriodSeconds.Value}"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(HeaderCountLimit), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" headerCountLimit: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(HeaderCountLimit)) + { + builder.Append(" headerCountLimit: "); + builder.AppendLine($"{HeaderCountLimit.Value}"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(RequestIdleTimeout), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" requestIdleTimeout: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(RequestIdleTimeout)) + { + builder.Append(" requestIdleTimeout: "); + builder.AppendLine($"{RequestIdleTimeout.Value}"); + } + } + + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerAppContainersContext.Default); + case "bicep": + return SerializeBicep(options); + default: + throw new FormatException($"The model {nameof(IngressConfiguration)} does not support writing '{options.Format}' format."); + } + } + + IngressConfiguration IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeIngressConfiguration(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(IngressConfiguration)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/IngressConfiguration.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/IngressConfiguration.cs new file mode 100644 index 000000000000..04bdfe9e36eb --- /dev/null +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/IngressConfiguration.cs @@ -0,0 +1,86 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.AppContainers.Models +{ + /// Settings for the ingress component, including workload profile, scaling, and connection handling. + public partial class IngressConfiguration + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public IngressConfiguration() + { + } + + /// Initializes a new instance of . + /// Name of the workload profile used by the ingress component. Required. + /// Scaling configuration for the ingress component. Required. + /// Time (in seconds) to allow active connections to complete on termination. Must be between 0 and 3600. Defaults to 480 seconds. + /// Maximum number of headers per request allowed by the ingress. Must be at least 1. Defaults to 100. + /// Duration (in minutes) before idle requests are timed out. Must be at least 1 minute. Defaults to 4 minutes. + /// Keeps track of any properties unknown to the library. + internal IngressConfiguration(string workloadProfileName, IngressConfigurationScale scale, int? terminationGracePeriodSeconds, int? headerCountLimit, int? requestIdleTimeout, IDictionary serializedAdditionalRawData) + { + WorkloadProfileName = workloadProfileName; + Scale = scale; + TerminationGracePeriodSeconds = terminationGracePeriodSeconds; + HeaderCountLimit = headerCountLimit; + RequestIdleTimeout = requestIdleTimeout; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Name of the workload profile used by the ingress component. Required. + [WirePath("workloadProfileName")] + public string WorkloadProfileName { get; set; } + /// Scaling configuration for the ingress component. Required. + [WirePath("scale")] + public IngressConfigurationScale Scale { get; set; } + /// Time (in seconds) to allow active connections to complete on termination. Must be between 0 and 3600. Defaults to 480 seconds. + [WirePath("terminationGracePeriodSeconds")] + public int? TerminationGracePeriodSeconds { get; set; } + /// Maximum number of headers per request allowed by the ingress. Must be at least 1. Defaults to 100. + [WirePath("headerCountLimit")] + public int? HeaderCountLimit { get; set; } + /// Duration (in minutes) before idle requests are timed out. Must be at least 1 minute. Defaults to 4 minutes. + [WirePath("requestIdleTimeout")] + public int? RequestIdleTimeout { get; set; } + } +} diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/IngressConfigurationScale.Serialization.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/IngressConfigurationScale.Serialization.cs new file mode 100644 index 000000000000..5ec4755167e7 --- /dev/null +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/IngressConfigurationScale.Serialization.cs @@ -0,0 +1,196 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.AppContainers.Models +{ + public partial class IngressConfigurationScale : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(IngressConfigurationScale)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(MinReplicas)) + { + writer.WritePropertyName("minReplicas"u8); + writer.WriteNumberValue(MinReplicas.Value); + } + if (Optional.IsDefined(MaxReplicas)) + { + writer.WritePropertyName("maxReplicas"u8); + writer.WriteNumberValue(MaxReplicas.Value); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + IngressConfigurationScale IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(IngressConfigurationScale)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeIngressConfigurationScale(document.RootElement, options); + } + + internal static IngressConfigurationScale DeserializeIngressConfigurationScale(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + int? minReplicas = default; + int? maxReplicas = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("minReplicas"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + minReplicas = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("maxReplicas"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + maxReplicas = property.Value.GetInt32(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new IngressConfigurationScale(minReplicas, maxReplicas, serializedAdditionalRawData); + } + + private BinaryData SerializeBicep(ModelReaderWriterOptions options) + { + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(MinReplicas), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" minReplicas: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(MinReplicas)) + { + builder.Append(" minReplicas: "); + builder.AppendLine($"{MinReplicas.Value}"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(MaxReplicas), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" maxReplicas: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(MaxReplicas)) + { + builder.Append(" maxReplicas: "); + builder.AppendLine($"{MaxReplicas.Value}"); + } + } + + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerAppContainersContext.Default); + case "bicep": + return SerializeBicep(options); + default: + throw new FormatException($"The model {nameof(IngressConfigurationScale)} does not support writing '{options.Format}' format."); + } + } + + IngressConfigurationScale IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeIngressConfigurationScale(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(IngressConfigurationScale)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/IngressConfigurationScale.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/IngressConfigurationScale.cs new file mode 100644 index 000000000000..6e2bd65690c3 --- /dev/null +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/IngressConfigurationScale.cs @@ -0,0 +1,71 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.AppContainers.Models +{ + /// Scaling configuration for the ingress component. Required. + public partial class IngressConfigurationScale + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public IngressConfigurationScale() + { + } + + /// Initializes a new instance of . + /// Minimum number of ingress replicas. Must be at least 2. Required. + /// Maximum number of ingress replicas. Must be greater than or equal to minReplicas. + /// Keeps track of any properties unknown to the library. + internal IngressConfigurationScale(int? minReplicas, int? maxReplicas, IDictionary serializedAdditionalRawData) + { + MinReplicas = minReplicas; + MaxReplicas = maxReplicas; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Minimum number of ingress replicas. Must be at least 2. Required. + [WirePath("minReplicas")] + public int? MinReplicas { get; set; } + /// Maximum number of ingress replicas. Must be greater than or equal to minReplicas. + [WirePath("maxReplicas")] + public int? MaxReplicas { get; set; } + } +} diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/IngressTargetPortHttpScheme.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/IngressTargetPortHttpScheme.cs new file mode 100644 index 000000000000..1dd214a8ead3 --- /dev/null +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/IngressTargetPortHttpScheme.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.AppContainers.Models +{ + /// Whether an http app listens on http or https. + public readonly partial struct IngressTargetPortHttpScheme : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public IngressTargetPortHttpScheme(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string HttpValue = "http"; + private const string HttpsValue = "https"; + + /// http. + public static IngressTargetPortHttpScheme Http { get; } = new IngressTargetPortHttpScheme(HttpValue); + /// https. + public static IngressTargetPortHttpScheme Https { get; } = new IngressTargetPortHttpScheme(HttpsValue); + /// Determines if two values are the same. + public static bool operator ==(IngressTargetPortHttpScheme left, IngressTargetPortHttpScheme right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(IngressTargetPortHttpScheme left, IngressTargetPortHttpScheme right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator IngressTargetPortHttpScheme(string value) => new IngressTargetPortHttpScheme(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is IngressTargetPortHttpScheme other && Equals(other); + /// + public bool Equals(IngressTargetPortHttpScheme other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/JavaComponentProperties.Serialization.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/JavaComponentProperties.Serialization.cs index 02f986d65a4c..b39b2ad9fab5 100644 --- a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/JavaComponentProperties.Serialization.cs +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/JavaComponentProperties.Serialization.cs @@ -110,9 +110,11 @@ internal static JavaComponentProperties DeserializeJavaComponentProperties(JsonE { switch (discriminator.GetString()) { + case "Nacos": return NacosComponent.DeserializeNacosComponent(element, options); case "SpringBootAdmin": return SpringBootAdminComponent.DeserializeSpringBootAdminComponent(element, options); case "SpringCloudConfig": return SpringCloudConfigComponent.DeserializeSpringCloudConfigComponent(element, options); case "SpringCloudEureka": return SpringCloudEurekaComponent.DeserializeSpringCloudEurekaComponent(element, options); + case "SpringCloudGateway": return SpringCloudGatewayComponent.DeserializeSpringCloudGatewayComponent(element, options); } } return UnknownJavaComponentProperties.DeserializeUnknownJavaComponentProperties(element, options); diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/JavaComponentProperties.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/JavaComponentProperties.cs index 7845feedd75c..d6db41c58774 100644 --- a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/JavaComponentProperties.cs +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/JavaComponentProperties.cs @@ -13,7 +13,7 @@ namespace Azure.ResourceManager.AppContainers.Models /// /// Java Component common properties. /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , and . + /// The available derived classes include , , , and . /// public abstract partial class JavaComponentProperties { diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/JavaComponentType.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/JavaComponentType.cs index bcb3b64582d6..60c6f38c5a39 100644 --- a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/JavaComponentType.cs +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/JavaComponentType.cs @@ -25,6 +25,8 @@ public JavaComponentType(string value) private const string SpringBootAdminValue = "SpringBootAdmin"; private const string SpringCloudEurekaValue = "SpringCloudEureka"; private const string SpringCloudConfigValue = "SpringCloudConfig"; + private const string SpringCloudGatewayValue = "SpringCloudGateway"; + private const string NacosValue = "Nacos"; /// SpringBootAdmin. public static JavaComponentType SpringBootAdmin { get; } = new JavaComponentType(SpringBootAdminValue); @@ -32,6 +34,10 @@ public JavaComponentType(string value) public static JavaComponentType SpringCloudEureka { get; } = new JavaComponentType(SpringCloudEurekaValue); /// SpringCloudConfig. public static JavaComponentType SpringCloudConfig { get; } = new JavaComponentType(SpringCloudConfigValue); + /// SpringCloudGateway. + public static JavaComponentType SpringCloudGateway { get; } = new JavaComponentType(SpringCloudGatewayValue); + /// Nacos. + public static JavaComponentType Nacos { get; } = new JavaComponentType(NacosValue); /// Determines if two values are the same. public static bool operator ==(JavaComponentType left, JavaComponentType right) => left.Equals(right); /// Determines if two values are not the same. diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/LabelHistoryCollection.Serialization.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/LabelHistoryCollection.Serialization.cs new file mode 100644 index 000000000000..194896a36468 --- /dev/null +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/LabelHistoryCollection.Serialization.cs @@ -0,0 +1,212 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.AppContainers.Models +{ + internal partial class LabelHistoryCollection : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(LabelHistoryCollection)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("value"u8); + writer.WriteStartArray(); + foreach (var item in Value) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + if (options.Format != "W" && Optional.IsDefined(NextLink)) + { + writer.WritePropertyName("nextLink"u8); + writer.WriteStringValue(NextLink); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + LabelHistoryCollection IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(LabelHistoryCollection)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeLabelHistoryCollection(document.RootElement, options); + } + + internal static LabelHistoryCollection DeserializeLabelHistoryCollection(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IReadOnlyList value = default; + string nextLink = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(LabelHistoryData.DeserializeLabelHistoryData(item, options)); + } + value = array; + continue; + } + if (property.NameEquals("nextLink"u8)) + { + nextLink = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new LabelHistoryCollection(value, nextLink, serializedAdditionalRawData); + } + + private BinaryData SerializeBicep(ModelReaderWriterOptions options) + { + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Value), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" value: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsCollectionDefined(Value)) + { + if (Value.Any()) + { + builder.Append(" value: "); + builder.AppendLine("["); + foreach (var item in Value) + { + BicepSerializationHelpers.AppendChildObject(builder, item, options, 4, true, " value: "); + } + builder.AppendLine(" ]"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(NextLink), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" nextLink: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(NextLink)) + { + builder.Append(" nextLink: "); + if (NextLink.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{NextLink}'''"); + } + else + { + builder.AppendLine($"'{NextLink}'"); + } + } + } + + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerAppContainersContext.Default); + case "bicep": + return SerializeBicep(options); + default: + throw new FormatException($"The model {nameof(LabelHistoryCollection)} does not support writing '{options.Format}' format."); + } + } + + LabelHistoryCollection IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeLabelHistoryCollection(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(LabelHistoryCollection)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/LabelHistoryCollection.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/LabelHistoryCollection.cs new file mode 100644 index 000000000000..bd1d8c5a556e --- /dev/null +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/LabelHistoryCollection.cs @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.ResourceManager.AppContainers.Models +{ + /// Container App Label History collection ARM resource. + internal partial class LabelHistoryCollection + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// Collection of resources. + /// is null. + internal LabelHistoryCollection(IEnumerable value) + { + Argument.AssertNotNull(value, nameof(value)); + + Value = value.ToList(); + } + + /// Initializes a new instance of . + /// Collection of resources. + /// Link to next page of resources. + /// Keeps track of any properties unknown to the library. + internal LabelHistoryCollection(IReadOnlyList value, string nextLink, IDictionary serializedAdditionalRawData) + { + Value = value; + NextLink = nextLink; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal LabelHistoryCollection() + { + } + + /// Collection of resources. + public IReadOnlyList Value { get; } + /// Link to next page of resources. + public string NextLink { get; } + } +} diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/LabelHistoryProperties.Serialization.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/LabelHistoryProperties.Serialization.cs new file mode 100644 index 000000000000..c6ba8a3380dc --- /dev/null +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/LabelHistoryProperties.Serialization.cs @@ -0,0 +1,185 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.AppContainers.Models +{ + internal partial class LabelHistoryProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(LabelHistoryProperties)} does not support writing '{format}' format."); + } + + if (options.Format != "W" && Optional.IsCollectionDefined(Records)) + { + writer.WritePropertyName("records"u8); + writer.WriteStartArray(); + foreach (var item in Records) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + LabelHistoryProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(LabelHistoryProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeLabelHistoryProperties(document.RootElement, options); + } + + internal static LabelHistoryProperties DeserializeLabelHistoryProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IReadOnlyList records = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("records"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(LabelHistoryRecordItem.DeserializeLabelHistoryRecordItem(item, options)); + } + records = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new LabelHistoryProperties(records ?? new ChangeTrackingList(), serializedAdditionalRawData); + } + + private BinaryData SerializeBicep(ModelReaderWriterOptions options) + { + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Records), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" records: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsCollectionDefined(Records)) + { + if (Records.Any()) + { + builder.Append(" records: "); + builder.AppendLine("["); + foreach (var item in Records) + { + BicepSerializationHelpers.AppendChildObject(builder, item, options, 4, true, " records: "); + } + builder.AppendLine(" ]"); + } + } + } + + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerAppContainersContext.Default); + case "bicep": + return SerializeBicep(options); + default: + throw new FormatException($"The model {nameof(LabelHistoryProperties)} does not support writing '{options.Format}' format."); + } + } + + LabelHistoryProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeLabelHistoryProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(LabelHistoryProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/LabelHistoryProperties.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/LabelHistoryProperties.cs new file mode 100644 index 000000000000..b23a01246b07 --- /dev/null +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/LabelHistoryProperties.cs @@ -0,0 +1,67 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.AppContainers.Models +{ + /// Container App Label History resource specific properties. + internal partial class LabelHistoryProperties + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public LabelHistoryProperties() + { + Records = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// List of label history records. + /// Keeps track of any properties unknown to the library. + internal LabelHistoryProperties(IReadOnlyList records, IDictionary serializedAdditionalRawData) + { + Records = records; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// List of label history records. + [WirePath("records")] + public IReadOnlyList Records { get; } + } +} diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/LabelHistoryRecordItem.Serialization.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/LabelHistoryRecordItem.Serialization.cs new file mode 100644 index 000000000000..d2a514029811 --- /dev/null +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/LabelHistoryRecordItem.Serialization.cs @@ -0,0 +1,262 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.AppContainers.Models +{ + public partial class LabelHistoryRecordItem : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(LabelHistoryRecordItem)} does not support writing '{format}' format."); + } + + if (options.Format != "W" && Optional.IsDefined(Revision)) + { + writer.WritePropertyName("revision"u8); + writer.WriteStringValue(Revision); + } + if (options.Format != "W" && Optional.IsDefined(Start)) + { + writer.WritePropertyName("start"u8); + writer.WriteStringValue(Start.Value, "O"); + } + if (options.Format != "W" && Optional.IsDefined(Stop)) + { + writer.WritePropertyName("stop"u8); + writer.WriteStringValue(Stop.Value, "O"); + } + if (options.Format != "W" && Optional.IsDefined(Status)) + { + writer.WritePropertyName("status"u8); + writer.WriteStringValue(Status.Value.ToString()); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + LabelHistoryRecordItem IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(LabelHistoryRecordItem)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeLabelHistoryRecordItem(document.RootElement, options); + } + + internal static LabelHistoryRecordItem DeserializeLabelHistoryRecordItem(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string revision = default; + DateTimeOffset? start = default; + DateTimeOffset? stop = default; + LabelHistoryRecordItemStatus? status = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("revision"u8)) + { + revision = property.Value.GetString(); + continue; + } + if (property.NameEquals("start"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + start = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("stop"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + stop = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("status"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + status = new LabelHistoryRecordItemStatus(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new LabelHistoryRecordItem(revision, start, stop, status, serializedAdditionalRawData); + } + + private BinaryData SerializeBicep(ModelReaderWriterOptions options) + { + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Revision), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" revision: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Revision)) + { + builder.Append(" revision: "); + if (Revision.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{Revision}'''"); + } + else + { + builder.AppendLine($"'{Revision}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Start), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" start: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Start)) + { + builder.Append(" start: "); + var formattedDateTimeString = TypeFormatters.ToString(Start.Value, "o"); + builder.AppendLine($"'{formattedDateTimeString}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Stop), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" stop: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Stop)) + { + builder.Append(" stop: "); + var formattedDateTimeString = TypeFormatters.ToString(Stop.Value, "o"); + builder.AppendLine($"'{formattedDateTimeString}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Status), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" status: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Status)) + { + builder.Append(" status: "); + builder.AppendLine($"'{Status.Value.ToString()}'"); + } + } + + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerAppContainersContext.Default); + case "bicep": + return SerializeBicep(options); + default: + throw new FormatException($"The model {nameof(LabelHistoryRecordItem)} does not support writing '{options.Format}' format."); + } + } + + LabelHistoryRecordItem IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeLabelHistoryRecordItem(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(LabelHistoryRecordItem)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/LabelHistoryRecordItem.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/LabelHistoryRecordItem.cs new file mode 100644 index 000000000000..56a47951c852 --- /dev/null +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/LabelHistoryRecordItem.cs @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.AppContainers.Models +{ + /// Container App Label History Item resource specific properties. + public partial class LabelHistoryRecordItem + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + internal LabelHistoryRecordItem() + { + } + + /// Initializes a new instance of . + /// Container App revision name that label was applied to. + /// Timestamp describing when the label was applied to the revision. + /// Timestamp describing when the label was removed from the revision. Only meaningful when the label is currently applied to the revision. + /// Status of the label history record. + /// Keeps track of any properties unknown to the library. + internal LabelHistoryRecordItem(string revision, DateTimeOffset? start, DateTimeOffset? stop, LabelHistoryRecordItemStatus? status, IDictionary serializedAdditionalRawData) + { + Revision = revision; + Start = start; + Stop = stop; + Status = status; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Container App revision name that label was applied to. + [WirePath("revision")] + public string Revision { get; } + /// Timestamp describing when the label was applied to the revision. + [WirePath("start")] + public DateTimeOffset? Start { get; } + /// Timestamp describing when the label was removed from the revision. Only meaningful when the label is currently applied to the revision. + [WirePath("stop")] + public DateTimeOffset? Stop { get; } + /// Status of the label history record. + [WirePath("status")] + public LabelHistoryRecordItemStatus? Status { get; } + } +} diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/LabelHistoryRecordItemStatus.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/LabelHistoryRecordItemStatus.cs new file mode 100644 index 000000000000..92d7a194846b --- /dev/null +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/LabelHistoryRecordItemStatus.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.AppContainers.Models +{ + /// Status of the label history record. + public readonly partial struct LabelHistoryRecordItemStatus : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public LabelHistoryRecordItemStatus(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string SucceededValue = "Succeeded"; + private const string FailedValue = "Failed"; + private const string StartingValue = "Starting"; + + /// Succeeded. + public static LabelHistoryRecordItemStatus Succeeded { get; } = new LabelHistoryRecordItemStatus(SucceededValue); + /// Failed. + public static LabelHistoryRecordItemStatus Failed { get; } = new LabelHistoryRecordItemStatus(FailedValue); + /// Starting. + public static LabelHistoryRecordItemStatus Starting { get; } = new LabelHistoryRecordItemStatus(StartingValue); + /// Determines if two values are the same. + public static bool operator ==(LabelHistoryRecordItemStatus left, LabelHistoryRecordItemStatus right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(LabelHistoryRecordItemStatus left, LabelHistoryRecordItemStatus right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator LabelHistoryRecordItemStatus(string value) => new LabelHistoryRecordItemStatus(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is LabelHistoryRecordItemStatus other && Equals(other); + /// + public bool Equals(LabelHistoryRecordItemStatus other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/Level.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/Level.cs new file mode 100644 index 000000000000..cd97886d91bd --- /dev/null +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/Level.cs @@ -0,0 +1,63 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.AppContainers.Models +{ + /// The specified logger's log level. + public readonly partial struct Level : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public Level(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string OffValue = "off"; + private const string ErrorValue = "error"; + private const string InfoValue = "info"; + private const string DebugValue = "debug"; + private const string TraceValue = "trace"; + private const string WarnValue = "warn"; + + /// off. + public static Level Off { get; } = new Level(OffValue); + /// error. + public static Level Error { get; } = new Level(ErrorValue); + /// info. + public static Level Info { get; } = new Level(InfoValue); + /// debug. + public static Level Debug { get; } = new Level(DebugValue); + /// trace. + public static Level Trace { get; } = new Level(TraceValue); + /// warn. + public static Level Warn { get; } = new Level(WarnValue); + /// Determines if two values are the same. + public static bool operator ==(Level left, Level right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(Level left, Level right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator Level(string value) => new Level(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is Level other && Equals(other); + /// + public bool Equals(Level other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/LoggerSetting.Serialization.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/LoggerSetting.Serialization.cs new file mode 100644 index 000000000000..ab9ce84c9a29 --- /dev/null +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/LoggerSetting.Serialization.cs @@ -0,0 +1,187 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.AppContainers.Models +{ + public partial class LoggerSetting : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(LoggerSetting)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("logger"u8); + writer.WriteStringValue(Logger); + writer.WritePropertyName("level"u8); + writer.WriteStringValue(Level.ToString()); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + LoggerSetting IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(LoggerSetting)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeLoggerSetting(document.RootElement, options); + } + + internal static LoggerSetting DeserializeLoggerSetting(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string logger = default; + Level level = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("logger"u8)) + { + logger = property.Value.GetString(); + continue; + } + if (property.NameEquals("level"u8)) + { + level = new Level(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new LoggerSetting(logger, level, serializedAdditionalRawData); + } + + private BinaryData SerializeBicep(ModelReaderWriterOptions options) + { + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Logger), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" logger: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Logger)) + { + builder.Append(" logger: "); + if (Logger.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{Logger}'''"); + } + else + { + builder.AppendLine($"'{Logger}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Level), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" level: "); + builder.AppendLine(propertyOverride); + } + else + { + builder.Append(" level: "); + builder.AppendLine($"'{Level.ToString()}'"); + } + + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerAppContainersContext.Default); + case "bicep": + return SerializeBicep(options); + default: + throw new FormatException($"The model {nameof(LoggerSetting)} does not support writing '{options.Format}' format."); + } + } + + LoggerSetting IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeLoggerSetting(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(LoggerSetting)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/LoggerSetting.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/LoggerSetting.cs new file mode 100644 index 000000000000..f7ab6638260b --- /dev/null +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/LoggerSetting.cs @@ -0,0 +1,83 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.AppContainers.Models +{ + /// Logger settings for java workloads. + public partial class LoggerSetting + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// Logger name. + /// The specified logger's log level. + /// is null. + public LoggerSetting(string logger, Level level) + { + Argument.AssertNotNull(logger, nameof(logger)); + + Logger = logger; + Level = level; + } + + /// Initializes a new instance of . + /// Logger name. + /// The specified logger's log level. + /// Keeps track of any properties unknown to the library. + internal LoggerSetting(string logger, Level level, IDictionary serializedAdditionalRawData) + { + Logger = logger; + Level = level; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal LoggerSetting() + { + } + + /// Logger name. + [WirePath("logger")] + public string Logger { get; set; } + /// The specified logger's log level. + [WirePath("level")] + public Level Level { get; set; } + } +} diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/LogicAppsProxyMethod.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/LogicAppsProxyMethod.cs new file mode 100644 index 000000000000..d769c7ca5114 --- /dev/null +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/LogicAppsProxyMethod.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.AppContainers.Models +{ + /// The LogicAppsProxyMethod. + public readonly partial struct LogicAppsProxyMethod : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public LogicAppsProxyMethod(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string GETValue = "GET"; + private const string PostValue = "POST"; + + /// GET. + public static LogicAppsProxyMethod GET { get; } = new LogicAppsProxyMethod(GETValue); + /// POST. + public static LogicAppsProxyMethod Post { get; } = new LogicAppsProxyMethod(PostValue); + /// Determines if two values are the same. + public static bool operator ==(LogicAppsProxyMethod left, LogicAppsProxyMethod right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(LogicAppsProxyMethod left, LogicAppsProxyMethod right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator LogicAppsProxyMethod(string value) => new LogicAppsProxyMethod(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is LogicAppsProxyMethod other && Equals(other); + /// + public bool Equals(LogicAppsProxyMethod other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/LogsConfiguration.Serialization.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/LogsConfiguration.Serialization.cs new file mode 100644 index 000000000000..9257d6b41b2f --- /dev/null +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/LogsConfiguration.Serialization.cs @@ -0,0 +1,198 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.AppContainers.Models +{ + internal partial class LogsConfiguration : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(LogsConfiguration)} does not support writing '{format}' format."); + } + + if (Optional.IsCollectionDefined(Destinations)) + { + writer.WritePropertyName("destinations"u8); + writer.WriteStartArray(); + foreach (var item in Destinations) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + LogsConfiguration IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(LogsConfiguration)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeLogsConfiguration(document.RootElement, options); + } + + internal static LogsConfiguration DeserializeLogsConfiguration(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IList destinations = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("destinations"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + destinations = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new LogsConfiguration(destinations ?? new ChangeTrackingList(), serializedAdditionalRawData); + } + + private BinaryData SerializeBicep(ModelReaderWriterOptions options) + { + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Destinations), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" destinations: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsCollectionDefined(Destinations)) + { + if (Destinations.Any()) + { + builder.Append(" destinations: "); + builder.AppendLine("["); + foreach (var item in Destinations) + { + if (item == null) + { + builder.Append("null"); + continue; + } + if (item.Contains(Environment.NewLine)) + { + builder.AppendLine(" '''"); + builder.AppendLine($"{item}'''"); + } + else + { + builder.AppendLine($" '{item}'"); + } + } + builder.AppendLine(" ]"); + } + } + } + + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerAppContainersContext.Default); + case "bicep": + return SerializeBicep(options); + default: + throw new FormatException($"The model {nameof(LogsConfiguration)} does not support writing '{options.Format}' format."); + } + } + + LogsConfiguration IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeLogsConfiguration(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(LogsConfiguration)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/LogsConfiguration.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/LogsConfiguration.cs new file mode 100644 index 000000000000..56d361d4c576 --- /dev/null +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/LogsConfiguration.cs @@ -0,0 +1,67 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.AppContainers.Models +{ + /// Configuration of Open Telemetry logs. + internal partial class LogsConfiguration + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public LogsConfiguration() + { + Destinations = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// Open telemetry logs destinations. + /// Keeps track of any properties unknown to the library. + internal LogsConfiguration(IList destinations, IDictionary serializedAdditionalRawData) + { + Destinations = destinations; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Open telemetry logs destinations. + [WirePath("destinations")] + public IList Destinations { get; } + } +} diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/MaintenanceConfigurationCollection.Serialization.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/MaintenanceConfigurationCollection.Serialization.cs new file mode 100644 index 000000000000..7f25fe7c99a3 --- /dev/null +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/MaintenanceConfigurationCollection.Serialization.cs @@ -0,0 +1,219 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.AppContainers.Models +{ + internal partial class MaintenanceConfigurationCollection : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(MaintenanceConfigurationCollection)} does not support writing '{format}' format."); + } + + if (Optional.IsCollectionDefined(Value)) + { + writer.WritePropertyName("value"u8); + writer.WriteStartArray(); + foreach (var item in Value) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && Optional.IsDefined(NextLink)) + { + writer.WritePropertyName("nextLink"u8); + writer.WriteStringValue(NextLink); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + MaintenanceConfigurationCollection IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(MaintenanceConfigurationCollection)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeMaintenanceConfigurationCollection(document.RootElement, options); + } + + internal static MaintenanceConfigurationCollection DeserializeMaintenanceConfigurationCollection(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IReadOnlyList value = default; + string nextLink = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(MaintenanceConfigurationResourceData.DeserializeMaintenanceConfigurationResourceData(item, options)); + } + value = array; + continue; + } + if (property.NameEquals("nextLink"u8)) + { + nextLink = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new MaintenanceConfigurationCollection(value ?? new ChangeTrackingList(), nextLink, serializedAdditionalRawData); + } + + private BinaryData SerializeBicep(ModelReaderWriterOptions options) + { + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Value), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" value: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsCollectionDefined(Value)) + { + if (Value.Any()) + { + builder.Append(" value: "); + builder.AppendLine("["); + foreach (var item in Value) + { + BicepSerializationHelpers.AppendChildObject(builder, item, options, 4, true, " value: "); + } + builder.AppendLine(" ]"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(NextLink), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" nextLink: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(NextLink)) + { + builder.Append(" nextLink: "); + if (NextLink.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{NextLink}'''"); + } + else + { + builder.AppendLine($"'{NextLink}'"); + } + } + } + + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerAppContainersContext.Default); + case "bicep": + return SerializeBicep(options); + default: + throw new FormatException($"The model {nameof(MaintenanceConfigurationCollection)} does not support writing '{options.Format}' format."); + } + } + + MaintenanceConfigurationCollection IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeMaintenanceConfigurationCollection(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(MaintenanceConfigurationCollection)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/MaintenanceConfigurationCollection.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/MaintenanceConfigurationCollection.cs new file mode 100644 index 000000000000..5098feee9fa1 --- /dev/null +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/MaintenanceConfigurationCollection.cs @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.AppContainers.Models +{ + /// The response of list maintenance configuration resources. + internal partial class MaintenanceConfigurationCollection + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + internal MaintenanceConfigurationCollection() + { + Value = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// Results of the list maintenance configuration resources. + /// Link for next page of results. + /// Keeps track of any properties unknown to the library. + internal MaintenanceConfigurationCollection(IReadOnlyList value, string nextLink, IDictionary serializedAdditionalRawData) + { + Value = value; + NextLink = nextLink; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Results of the list maintenance configuration resources. + public IReadOnlyList Value { get; } + /// Link for next page of results. + public string NextLink { get; } + } +} diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/MetricsConfiguration.Serialization.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/MetricsConfiguration.Serialization.cs new file mode 100644 index 000000000000..c975a2a73cad --- /dev/null +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/MetricsConfiguration.Serialization.cs @@ -0,0 +1,229 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.AppContainers.Models +{ + public partial class MetricsConfiguration : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(MetricsConfiguration)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(IncludeKeda)) + { + writer.WritePropertyName("includeKeda"u8); + writer.WriteBooleanValue(IncludeKeda.Value); + } + if (Optional.IsCollectionDefined(Destinations)) + { + writer.WritePropertyName("destinations"u8); + writer.WriteStartArray(); + foreach (var item in Destinations) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + MetricsConfiguration IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(MetricsConfiguration)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeMetricsConfiguration(document.RootElement, options); + } + + internal static MetricsConfiguration DeserializeMetricsConfiguration(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + bool? includeKeda = default; + IList destinations = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("includeKeda"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + includeKeda = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("destinations"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + destinations = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new MetricsConfiguration(includeKeda, destinations ?? new ChangeTrackingList(), serializedAdditionalRawData); + } + + private BinaryData SerializeBicep(ModelReaderWriterOptions options) + { + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(IncludeKeda), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" includeKeda: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(IncludeKeda)) + { + builder.Append(" includeKeda: "); + var boolValue = IncludeKeda.Value == true ? "true" : "false"; + builder.AppendLine($"{boolValue}"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Destinations), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" destinations: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsCollectionDefined(Destinations)) + { + if (Destinations.Any()) + { + builder.Append(" destinations: "); + builder.AppendLine("["); + foreach (var item in Destinations) + { + if (item == null) + { + builder.Append("null"); + continue; + } + if (item.Contains(Environment.NewLine)) + { + builder.AppendLine(" '''"); + builder.AppendLine($"{item}'''"); + } + else + { + builder.AppendLine($" '{item}'"); + } + } + builder.AppendLine(" ]"); + } + } + } + + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerAppContainersContext.Default); + case "bicep": + return SerializeBicep(options); + default: + throw new FormatException($"The model {nameof(MetricsConfiguration)} does not support writing '{options.Format}' format."); + } + } + + MetricsConfiguration IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeMetricsConfiguration(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(MetricsConfiguration)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/MetricsConfiguration.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/MetricsConfiguration.cs new file mode 100644 index 000000000000..f81d8fb7555d --- /dev/null +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/MetricsConfiguration.cs @@ -0,0 +1,72 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.AppContainers.Models +{ + /// Configuration of Open Telemetry metrics. + public partial class MetricsConfiguration + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public MetricsConfiguration() + { + Destinations = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// Boolean indicating if including keda metrics. + /// Open telemetry metrics destinations. + /// Keeps track of any properties unknown to the library. + internal MetricsConfiguration(bool? includeKeda, IList destinations, IDictionary serializedAdditionalRawData) + { + IncludeKeda = includeKeda; + Destinations = destinations; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Boolean indicating if including keda metrics. + [WirePath("includeKeda")] + public bool? IncludeKeda { get; set; } + /// Open telemetry metrics destinations. + [WirePath("destinations")] + public IList Destinations { get; } + } +} diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/NacosComponent.Serialization.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/NacosComponent.Serialization.cs new file mode 100644 index 000000000000..07b6b64170bc --- /dev/null +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/NacosComponent.Serialization.cs @@ -0,0 +1,307 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.AppContainers.Models +{ + public partial class NacosComponent : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(NacosComponent)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + if (Optional.IsDefined(Ingress)) + { + writer.WritePropertyName("ingress"u8); + writer.WriteObjectValue(Ingress, options); + } + } + + NacosComponent IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(NacosComponent)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeNacosComponent(document.RootElement, options); + } + + internal static NacosComponent DeserializeNacosComponent(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + JavaComponentIngress ingress = default; + JavaComponentType componentType = default; + JavaComponentProvisioningState? provisioningState = default; + IList configurations = default; + JavaComponentPropertiesScale scale = default; + IList serviceBinds = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("ingress"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + ingress = JavaComponentIngress.DeserializeJavaComponentIngress(property.Value, options); + continue; + } + if (property.NameEquals("componentType"u8)) + { + componentType = new JavaComponentType(property.Value.GetString()); + continue; + } + if (property.NameEquals("provisioningState"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + provisioningState = new JavaComponentProvisioningState(property.Value.GetString()); + continue; + } + if (property.NameEquals("configurations"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(JavaComponentConfigurationProperty.DeserializeJavaComponentConfigurationProperty(item, options)); + } + configurations = array; + continue; + } + if (property.NameEquals("scale"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + scale = JavaComponentPropertiesScale.DeserializeJavaComponentPropertiesScale(property.Value, options); + continue; + } + if (property.NameEquals("serviceBinds"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(JavaComponentServiceBind.DeserializeJavaComponentServiceBind(item, options)); + } + serviceBinds = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new NacosComponent( + componentType, + provisioningState, + configurations ?? new ChangeTrackingList(), + scale, + serviceBinds ?? new ChangeTrackingList(), + serializedAdditionalRawData, + ingress); + } + + private BinaryData SerializeBicep(ModelReaderWriterOptions options) + { + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue("IngressFqdn", out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" ingress: "); + builder.AppendLine("{"); + builder.Append(" fqdn: "); + builder.AppendLine(propertyOverride); + builder.AppendLine(" }"); + } + else + { + if (Optional.IsDefined(Ingress)) + { + builder.Append(" ingress: "); + BicepSerializationHelpers.AppendChildObject(builder, Ingress, options, 2, false, " ingress: "); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(ComponentType), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" componentType: "); + builder.AppendLine(propertyOverride); + } + else + { + builder.Append(" componentType: "); + builder.AppendLine($"'{ComponentType.ToString()}'"); + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(ProvisioningState), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" provisioningState: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(ProvisioningState)) + { + builder.Append(" provisioningState: "); + builder.AppendLine($"'{ProvisioningState.Value.ToString()}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Configurations), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" configurations: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsCollectionDefined(Configurations)) + { + if (Configurations.Any()) + { + builder.Append(" configurations: "); + builder.AppendLine("["); + foreach (var item in Configurations) + { + BicepSerializationHelpers.AppendChildObject(builder, item, options, 4, true, " configurations: "); + } + builder.AppendLine(" ]"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Scale), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" scale: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Scale)) + { + builder.Append(" scale: "); + BicepSerializationHelpers.AppendChildObject(builder, Scale, options, 2, false, " scale: "); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(ServiceBinds), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" serviceBinds: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsCollectionDefined(ServiceBinds)) + { + if (ServiceBinds.Any()) + { + builder.Append(" serviceBinds: "); + builder.AppendLine("["); + foreach (var item in ServiceBinds) + { + BicepSerializationHelpers.AppendChildObject(builder, item, options, 4, true, " serviceBinds: "); + } + builder.AppendLine(" ]"); + } + } + } + + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerAppContainersContext.Default); + case "bicep": + return SerializeBicep(options); + default: + throw new FormatException($"The model {nameof(NacosComponent)} does not support writing '{options.Format}' format."); + } + } + + NacosComponent IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeNacosComponent(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(NacosComponent)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/NacosComponent.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/NacosComponent.cs new file mode 100644 index 000000000000..2984ccafcde3 --- /dev/null +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/NacosComponent.cs @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.AppContainers.Models +{ + /// Nacos properties. + public partial class NacosComponent : JavaComponentProperties + { + /// Initializes a new instance of . + public NacosComponent() + { + ComponentType = JavaComponentType.Nacos; + } + + /// Initializes a new instance of . + /// Type of the Java Component. + /// Provisioning state of the Java Component. + /// List of Java Components configuration properties. + /// Java component scaling configurations. + /// List of Java Components that are bound to the Java component. + /// Keeps track of any properties unknown to the library. + /// Java Component Ingress configurations. + internal NacosComponent(JavaComponentType componentType, JavaComponentProvisioningState? provisioningState, IList configurations, JavaComponentPropertiesScale scale, IList serviceBinds, IDictionary serializedAdditionalRawData, JavaComponentIngress ingress) : base(componentType, provisioningState, configurations, scale, serviceBinds, serializedAdditionalRawData) + { + Ingress = ingress; + ComponentType = componentType; + } + + /// Java Component Ingress configurations. + internal JavaComponentIngress Ingress { get; set; } + /// Hostname of the Java Component endpoint. + [WirePath("ingress.fqdn")] + public string IngressFqdn + { + get => Ingress is null ? default : Ingress.Fqdn; + } + } +} diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/OpenTelemetryConfiguration.Serialization.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/OpenTelemetryConfiguration.Serialization.cs new file mode 100644 index 000000000000..0a71adf9ce60 --- /dev/null +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/OpenTelemetryConfiguration.Serialization.cs @@ -0,0 +1,259 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.AppContainers.Models +{ + public partial class OpenTelemetryConfiguration : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(OpenTelemetryConfiguration)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(DestinationsConfiguration)) + { + writer.WritePropertyName("destinationsConfiguration"u8); + writer.WriteObjectValue(DestinationsConfiguration, options); + } + if (Optional.IsDefined(TracesConfiguration)) + { + writer.WritePropertyName("tracesConfiguration"u8); + writer.WriteObjectValue(TracesConfiguration, options); + } + if (Optional.IsDefined(LogsConfiguration)) + { + writer.WritePropertyName("logsConfiguration"u8); + writer.WriteObjectValue(LogsConfiguration, options); + } + if (Optional.IsDefined(MetricsConfiguration)) + { + writer.WritePropertyName("metricsConfiguration"u8); + writer.WriteObjectValue(MetricsConfiguration, options); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + OpenTelemetryConfiguration IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(OpenTelemetryConfiguration)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeOpenTelemetryConfiguration(document.RootElement, options); + } + + internal static OpenTelemetryConfiguration DeserializeOpenTelemetryConfiguration(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + DestinationsConfiguration destinationsConfiguration = default; + TracesConfiguration tracesConfiguration = default; + LogsConfiguration logsConfiguration = default; + MetricsConfiguration metricsConfiguration = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("destinationsConfiguration"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + destinationsConfiguration = DestinationsConfiguration.DeserializeDestinationsConfiguration(property.Value, options); + continue; + } + if (property.NameEquals("tracesConfiguration"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + tracesConfiguration = TracesConfiguration.DeserializeTracesConfiguration(property.Value, options); + continue; + } + if (property.NameEquals("logsConfiguration"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + logsConfiguration = LogsConfiguration.DeserializeLogsConfiguration(property.Value, options); + continue; + } + if (property.NameEquals("metricsConfiguration"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + metricsConfiguration = MetricsConfiguration.DeserializeMetricsConfiguration(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new OpenTelemetryConfiguration(destinationsConfiguration, tracesConfiguration, logsConfiguration, metricsConfiguration, serializedAdditionalRawData); + } + + private BinaryData SerializeBicep(ModelReaderWriterOptions options) + { + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(DestinationsConfiguration), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" destinationsConfiguration: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(DestinationsConfiguration)) + { + builder.Append(" destinationsConfiguration: "); + BicepSerializationHelpers.AppendChildObject(builder, DestinationsConfiguration, options, 2, false, " destinationsConfiguration: "); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(TracesConfiguration), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" tracesConfiguration: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(TracesConfiguration)) + { + builder.Append(" tracesConfiguration: "); + BicepSerializationHelpers.AppendChildObject(builder, TracesConfiguration, options, 2, false, " tracesConfiguration: "); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue("LogsDestinations", out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" logsConfiguration: "); + builder.AppendLine("{"); + builder.Append(" destinations: "); + builder.AppendLine(propertyOverride); + builder.AppendLine(" }"); + } + else + { + if (Optional.IsDefined(LogsConfiguration)) + { + builder.Append(" logsConfiguration: "); + BicepSerializationHelpers.AppendChildObject(builder, LogsConfiguration, options, 2, false, " logsConfiguration: "); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(MetricsConfiguration), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" metricsConfiguration: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(MetricsConfiguration)) + { + builder.Append(" metricsConfiguration: "); + BicepSerializationHelpers.AppendChildObject(builder, MetricsConfiguration, options, 2, false, " metricsConfiguration: "); + } + } + + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerAppContainersContext.Default); + case "bicep": + return SerializeBicep(options); + default: + throw new FormatException($"The model {nameof(OpenTelemetryConfiguration)} does not support writing '{options.Format}' format."); + } + } + + OpenTelemetryConfiguration IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeOpenTelemetryConfiguration(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(OpenTelemetryConfiguration)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/OpenTelemetryConfiguration.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/OpenTelemetryConfiguration.cs new file mode 100644 index 000000000000..4ef632e1cdca --- /dev/null +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/OpenTelemetryConfiguration.cs @@ -0,0 +1,92 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.AppContainers.Models +{ + /// Configuration of Open Telemetry. + public partial class OpenTelemetryConfiguration + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public OpenTelemetryConfiguration() + { + } + + /// Initializes a new instance of . + /// Open telemetry destinations configuration. + /// Open telemetry trace configuration. + /// Open telemetry logs configuration. + /// Open telemetry metrics configuration. + /// Keeps track of any properties unknown to the library. + internal OpenTelemetryConfiguration(DestinationsConfiguration destinationsConfiguration, TracesConfiguration tracesConfiguration, LogsConfiguration logsConfiguration, MetricsConfiguration metricsConfiguration, IDictionary serializedAdditionalRawData) + { + DestinationsConfiguration = destinationsConfiguration; + TracesConfiguration = tracesConfiguration; + LogsConfiguration = logsConfiguration; + MetricsConfiguration = metricsConfiguration; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Open telemetry destinations configuration. + [WirePath("destinationsConfiguration")] + public DestinationsConfiguration DestinationsConfiguration { get; set; } + /// Open telemetry trace configuration. + [WirePath("tracesConfiguration")] + public TracesConfiguration TracesConfiguration { get; set; } + /// Open telemetry logs configuration. + internal LogsConfiguration LogsConfiguration { get; set; } + /// Open telemetry logs destinations. + [WirePath("logsConfiguration.destinations")] + public IList LogsDestinations + { + get + { + if (LogsConfiguration is null) + LogsConfiguration = new LogsConfiguration(); + return LogsConfiguration.Destinations; + } + } + + /// Open telemetry metrics configuration. + [WirePath("metricsConfiguration")] + public MetricsConfiguration MetricsConfiguration { get; set; } + } +} diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/OtlpConfiguration.Serialization.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/OtlpConfiguration.Serialization.cs new file mode 100644 index 000000000000..f5dc74df6d92 --- /dev/null +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/OtlpConfiguration.Serialization.cs @@ -0,0 +1,284 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.AppContainers.Models +{ + public partial class OtlpConfiguration : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(OtlpConfiguration)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(Name)) + { + writer.WritePropertyName("name"u8); + writer.WriteStringValue(Name); + } + if (Optional.IsDefined(Endpoint)) + { + writer.WritePropertyName("endpoint"u8); + writer.WriteStringValue(Endpoint); + } + if (Optional.IsDefined(Insecure)) + { + writer.WritePropertyName("insecure"u8); + writer.WriteBooleanValue(Insecure.Value); + } + if (Optional.IsCollectionDefined(Headers)) + { + writer.WritePropertyName("headers"u8); + writer.WriteStartArray(); + foreach (var item in Headers) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + OtlpConfiguration IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(OtlpConfiguration)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeOtlpConfiguration(document.RootElement, options); + } + + internal static OtlpConfiguration DeserializeOtlpConfiguration(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string name = default; + string endpoint = default; + bool? insecure = default; + IList
headers = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("endpoint"u8)) + { + endpoint = property.Value.GetString(); + continue; + } + if (property.NameEquals("insecure"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + insecure = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("headers"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List
array = new List
(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(Header.DeserializeHeader(item, options)); + } + headers = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new OtlpConfiguration(name, endpoint, insecure, headers ?? new ChangeTrackingList
(), serializedAdditionalRawData); + } + + private BinaryData SerializeBicep(ModelReaderWriterOptions options) + { + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Name), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" name: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Name)) + { + builder.Append(" name: "); + if (Name.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{Name}'''"); + } + else + { + builder.AppendLine($"'{Name}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Endpoint), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" endpoint: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Endpoint)) + { + builder.Append(" endpoint: "); + if (Endpoint.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{Endpoint}'''"); + } + else + { + builder.AppendLine($"'{Endpoint}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Insecure), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" insecure: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Insecure)) + { + builder.Append(" insecure: "); + var boolValue = Insecure.Value == true ? "true" : "false"; + builder.AppendLine($"{boolValue}"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Headers), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" headers: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsCollectionDefined(Headers)) + { + if (Headers.Any()) + { + builder.Append(" headers: "); + builder.AppendLine("["); + foreach (var item in Headers) + { + BicepSerializationHelpers.AppendChildObject(builder, item, options, 4, true, " headers: "); + } + builder.AppendLine(" ]"); + } + } + } + + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerAppContainersContext.Default); + case "bicep": + return SerializeBicep(options); + default: + throw new FormatException($"The model {nameof(OtlpConfiguration)} does not support writing '{options.Format}' format."); + } + } + + OtlpConfiguration IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeOtlpConfiguration(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(OtlpConfiguration)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/OtlpConfiguration.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/OtlpConfiguration.cs new file mode 100644 index 000000000000..f1014d81d0e1 --- /dev/null +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/OtlpConfiguration.cs @@ -0,0 +1,82 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.AppContainers.Models +{ + /// Configuration of otlp. + public partial class OtlpConfiguration + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public OtlpConfiguration() + { + Headers = new ChangeTrackingList
(); + } + + /// Initializes a new instance of . + /// The name of otlp configuration. + /// The endpoint of otlp configuration. + /// Boolean indicating if otlp configuration is insecure. + /// Headers of otlp configurations. + /// Keeps track of any properties unknown to the library. + internal OtlpConfiguration(string name, string endpoint, bool? insecure, IList
headers, IDictionary serializedAdditionalRawData) + { + Name = name; + Endpoint = endpoint; + Insecure = insecure; + Headers = headers; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The name of otlp configuration. + [WirePath("name")] + public string Name { get; set; } + /// The endpoint of otlp configuration. + [WirePath("endpoint")] + public string Endpoint { get; set; } + /// Boolean indicating if otlp configuration is insecure. + [WirePath("insecure")] + public bool? Insecure { get; set; } + /// Headers of otlp configurations. + [WirePath("headers")] + public IList
Headers { get; } + } +} diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/PatchApplyStatus.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/PatchApplyStatus.cs new file mode 100644 index 000000000000..2012f2a8c393 --- /dev/null +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/PatchApplyStatus.cs @@ -0,0 +1,72 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.AppContainers.Models +{ + /// The status of the patch once it has been provisioned. + public readonly partial struct PatchApplyStatus : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public PatchApplyStatus(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string NotStartedValue = "NotStarted"; + private const string RebaseInProgressValue = "RebaseInProgress"; + private const string CreatingRevisionValue = "CreatingRevision"; + private const string SucceededValue = "Succeeded"; + private const string CanceledValue = "Canceled"; + private const string RebaseFailedValue = "RebaseFailed"; + private const string RevisionCreationFailedValue = "RevisionCreationFailed"; + private const string ImagePushPullFailedValue = "ImagePushPullFailed"; + private const string ManuallySkippedValue = "ManuallySkipped"; + + /// NotStarted. + public static PatchApplyStatus NotStarted { get; } = new PatchApplyStatus(NotStartedValue); + /// RebaseInProgress. + public static PatchApplyStatus RebaseInProgress { get; } = new PatchApplyStatus(RebaseInProgressValue); + /// CreatingRevision. + public static PatchApplyStatus CreatingRevision { get; } = new PatchApplyStatus(CreatingRevisionValue); + /// Succeeded. + public static PatchApplyStatus Succeeded { get; } = new PatchApplyStatus(SucceededValue); + /// Canceled. + public static PatchApplyStatus Canceled { get; } = new PatchApplyStatus(CanceledValue); + /// RebaseFailed. + public static PatchApplyStatus RebaseFailed { get; } = new PatchApplyStatus(RebaseFailedValue); + /// RevisionCreationFailed. + public static PatchApplyStatus RevisionCreationFailed { get; } = new PatchApplyStatus(RevisionCreationFailedValue); + /// ImagePushPullFailed. + public static PatchApplyStatus ImagePushPullFailed { get; } = new PatchApplyStatus(ImagePushPullFailedValue); + /// ManuallySkipped. + public static PatchApplyStatus ManuallySkipped { get; } = new PatchApplyStatus(ManuallySkippedValue); + /// Determines if two values are the same. + public static bool operator ==(PatchApplyStatus left, PatchApplyStatus right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(PatchApplyStatus left, PatchApplyStatus right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator PatchApplyStatus(string value) => new PatchApplyStatus(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is PatchApplyStatus other && Equals(other); + /// + public bool Equals(PatchApplyStatus other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/PatchCollection.Serialization.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/PatchCollection.Serialization.cs new file mode 100644 index 000000000000..b8c1baed4d6c --- /dev/null +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/PatchCollection.Serialization.cs @@ -0,0 +1,208 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.AppContainers.Models +{ + internal partial class PatchCollection : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(PatchCollection)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("value"u8); + writer.WriteStartArray(); + foreach (var item in Value) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + if (Optional.IsDefined(NextLink)) + { + writer.WritePropertyName("nextLink"u8); + writer.WriteStringValue(NextLink.AbsoluteUri); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + PatchCollection IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(PatchCollection)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializePatchCollection(document.RootElement, options); + } + + internal static PatchCollection DeserializePatchCollection(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IReadOnlyList value = default; + Uri nextLink = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(ContainerAppsPatchResourceData.DeserializeContainerAppsPatchResourceData(item, options)); + } + value = array; + continue; + } + if (property.NameEquals("nextLink"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + nextLink = new Uri(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new PatchCollection(value, nextLink, serializedAdditionalRawData); + } + + private BinaryData SerializeBicep(ModelReaderWriterOptions options) + { + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Value), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" value: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsCollectionDefined(Value)) + { + if (Value.Any()) + { + builder.Append(" value: "); + builder.AppendLine("["); + foreach (var item in Value) + { + BicepSerializationHelpers.AppendChildObject(builder, item, options, 4, true, " value: "); + } + builder.AppendLine(" ]"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(NextLink), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" nextLink: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(NextLink)) + { + builder.Append(" nextLink: "); + builder.AppendLine($"'{NextLink.AbsoluteUri}'"); + } + } + + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerAppContainersContext.Default); + case "bicep": + return SerializeBicep(options); + default: + throw new FormatException($"The model {nameof(PatchCollection)} does not support writing '{options.Format}' format."); + } + } + + PatchCollection IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializePatchCollection(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(PatchCollection)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/PatchCollection.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/PatchCollection.cs new file mode 100644 index 000000000000..7f0b3c7b325c --- /dev/null +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/PatchCollection.cs @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.ResourceManager.AppContainers.Models +{ + /// Container App patch collection. + internal partial class PatchCollection + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// Collection of patch resources. + /// is null. + internal PatchCollection(IEnumerable value) + { + Argument.AssertNotNull(value, nameof(value)); + + Value = value.ToList(); + } + + /// Initializes a new instance of . + /// Collection of patch resources. + /// the link to the next page of items. + /// Keeps track of any properties unknown to the library. + internal PatchCollection(IReadOnlyList value, Uri nextLink, IDictionary serializedAdditionalRawData) + { + Value = value; + NextLink = nextLink; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal PatchCollection() + { + } + + /// Collection of patch resources. + public IReadOnlyList Value { get; } + /// the link to the next page of items. + public Uri NextLink { get; } + } +} diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/PatchDetails.Serialization.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/PatchDetails.Serialization.cs new file mode 100644 index 000000000000..478a76c97beb --- /dev/null +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/PatchDetails.Serialization.cs @@ -0,0 +1,384 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.AppContainers.Models +{ + public partial class PatchDetails : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(PatchDetails)} does not support writing '{format}' format."); + } + + if (options.Format != "W") + { + writer.WritePropertyName("targetContainerName"u8); + writer.WriteStringValue(TargetContainerName); + } + if (options.Format != "W") + { + writer.WritePropertyName("targetImage"u8); + writer.WriteStringValue(TargetImage); + } + if (options.Format != "W") + { + writer.WritePropertyName("lastDetectionTime"u8); + writer.WriteStringValue(LastDetectionOn, "O"); + } + if (options.Format != "W") + { + writer.WritePropertyName("detectionStatus"u8); + writer.WriteStringValue(DetectionStatus.ToString()); + } + if (options.Format != "W" && Optional.IsDefined(NewImageName)) + { + writer.WritePropertyName("newImageName"u8); + writer.WriteStringValue(NewImageName); + } + if (options.Format != "W" && Optional.IsDefined(NewLayer)) + { + writer.WritePropertyName("newLayer"u8); + writer.WriteObjectValue(NewLayer, options); + } + if (options.Format != "W" && Optional.IsDefined(OldLayer)) + { + writer.WritePropertyName("oldLayer"u8); + writer.WriteObjectValue(OldLayer, options); + } + if (options.Format != "W" && Optional.IsDefined(PatchType)) + { + writer.WritePropertyName("patchType"u8); + writer.WriteStringValue(PatchType.Value.ToString()); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + PatchDetails IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(PatchDetails)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializePatchDetails(document.RootElement, options); + } + + internal static PatchDetails DeserializePatchDetails(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string targetContainerName = default; + string targetImage = default; + DateTimeOffset lastDetectionTime = default; + DetectionStatus detectionStatus = default; + string newImageName = default; + PatchDetailsNewLayer newLayer = default; + PatchDetailsOldLayer oldLayer = default; + PatchType? patchType = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("targetContainerName"u8)) + { + targetContainerName = property.Value.GetString(); + continue; + } + if (property.NameEquals("targetImage"u8)) + { + targetImage = property.Value.GetString(); + continue; + } + if (property.NameEquals("lastDetectionTime"u8)) + { + lastDetectionTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("detectionStatus"u8)) + { + detectionStatus = new DetectionStatus(property.Value.GetString()); + continue; + } + if (property.NameEquals("newImageName"u8)) + { + newImageName = property.Value.GetString(); + continue; + } + if (property.NameEquals("newLayer"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + newLayer = PatchDetailsNewLayer.DeserializePatchDetailsNewLayer(property.Value, options); + continue; + } + if (property.NameEquals("oldLayer"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + oldLayer = PatchDetailsOldLayer.DeserializePatchDetailsOldLayer(property.Value, options); + continue; + } + if (property.NameEquals("patchType"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + patchType = new PatchType(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new PatchDetails( + targetContainerName, + targetImage, + lastDetectionTime, + detectionStatus, + newImageName, + newLayer, + oldLayer, + patchType, + serializedAdditionalRawData); + } + + private BinaryData SerializeBicep(ModelReaderWriterOptions options) + { + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(TargetContainerName), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" targetContainerName: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(TargetContainerName)) + { + builder.Append(" targetContainerName: "); + if (TargetContainerName.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{TargetContainerName}'''"); + } + else + { + builder.AppendLine($"'{TargetContainerName}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(TargetImage), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" targetImage: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(TargetImage)) + { + builder.Append(" targetImage: "); + if (TargetImage.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{TargetImage}'''"); + } + else + { + builder.AppendLine($"'{TargetImage}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(LastDetectionOn), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" lastDetectionTime: "); + builder.AppendLine(propertyOverride); + } + else + { + builder.Append(" lastDetectionTime: "); + var formattedDateTimeString = TypeFormatters.ToString(LastDetectionOn, "o"); + builder.AppendLine($"'{formattedDateTimeString}'"); + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(DetectionStatus), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" detectionStatus: "); + builder.AppendLine(propertyOverride); + } + else + { + builder.Append(" detectionStatus: "); + builder.AppendLine($"'{DetectionStatus.ToString()}'"); + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(NewImageName), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" newImageName: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(NewImageName)) + { + builder.Append(" newImageName: "); + if (NewImageName.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{NewImageName}'''"); + } + else + { + builder.AppendLine($"'{NewImageName}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(NewLayer), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" newLayer: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(NewLayer)) + { + builder.Append(" newLayer: "); + BicepSerializationHelpers.AppendChildObject(builder, NewLayer, options, 2, false, " newLayer: "); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(OldLayer), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" oldLayer: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(OldLayer)) + { + builder.Append(" oldLayer: "); + BicepSerializationHelpers.AppendChildObject(builder, OldLayer, options, 2, false, " oldLayer: "); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(PatchType), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" patchType: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(PatchType)) + { + builder.Append(" patchType: "); + builder.AppendLine($"'{PatchType.Value.ToString()}'"); + } + } + + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerAppContainersContext.Default); + case "bicep": + return SerializeBicep(options); + default: + throw new FormatException($"The model {nameof(PatchDetails)} does not support writing '{options.Format}' format."); + } + } + + PatchDetails IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializePatchDetails(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(PatchDetails)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/PatchDetails.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/PatchDetails.cs new file mode 100644 index 000000000000..bee7c1020cac --- /dev/null +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/PatchDetails.cs @@ -0,0 +1,114 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.AppContainers.Models +{ + /// The detailed info of patch operation performing when applying a patch. + public partial class PatchDetails + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The name of the target container for the patch. + /// The name of the target image for the patch. + /// The UTC timestamp that describes the latest detection was done. + /// The status of the patch detection. + internal PatchDetails(string targetContainerName, string targetImage, DateTimeOffset lastDetectionOn, DetectionStatus detectionStatus) + { + TargetContainerName = targetContainerName; + TargetImage = targetImage; + LastDetectionOn = lastDetectionOn; + DetectionStatus = detectionStatus; + } + + /// Initializes a new instance of . + /// The name of the target container for the patch. + /// The name of the target image for the patch. + /// The UTC timestamp that describes the latest detection was done. + /// The status of the patch detection. + /// The name of the new image created by the patch. + /// New layer update details in the target image. + /// The old layer details in the target image. + /// The type for the patch. + /// Keeps track of any properties unknown to the library. + internal PatchDetails(string targetContainerName, string targetImage, DateTimeOffset lastDetectionOn, DetectionStatus detectionStatus, string newImageName, PatchDetailsNewLayer newLayer, PatchDetailsOldLayer oldLayer, PatchType? patchType, IDictionary serializedAdditionalRawData) + { + TargetContainerName = targetContainerName; + TargetImage = targetImage; + LastDetectionOn = lastDetectionOn; + DetectionStatus = detectionStatus; + NewImageName = newImageName; + NewLayer = newLayer; + OldLayer = oldLayer; + PatchType = patchType; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal PatchDetails() + { + } + + /// The name of the target container for the patch. + [WirePath("targetContainerName")] + public string TargetContainerName { get; } + /// The name of the target image for the patch. + [WirePath("targetImage")] + public string TargetImage { get; } + /// The UTC timestamp that describes the latest detection was done. + [WirePath("lastDetectionTime")] + public DateTimeOffset LastDetectionOn { get; } + /// The status of the patch detection. + [WirePath("detectionStatus")] + public DetectionStatus DetectionStatus { get; } + /// The name of the new image created by the patch. + [WirePath("newImageName")] + public string NewImageName { get; } + /// New layer update details in the target image. + [WirePath("newLayer")] + public PatchDetailsNewLayer NewLayer { get; } + /// The old layer details in the target image. + [WirePath("oldLayer")] + public PatchDetailsOldLayer OldLayer { get; } + /// The type for the patch. + [WirePath("patchType")] + public PatchType? PatchType { get; } + } +} diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/PatchDetailsNewLayer.Serialization.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/PatchDetailsNewLayer.Serialization.cs new file mode 100644 index 000000000000..fd8c0cf354b1 --- /dev/null +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/PatchDetailsNewLayer.Serialization.cs @@ -0,0 +1,238 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.AppContainers.Models +{ + public partial class PatchDetailsNewLayer : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(PatchDetailsNewLayer)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(Name)) + { + writer.WritePropertyName("name"u8); + writer.WriteStringValue(Name); + } + if (Optional.IsDefined(FrameworkAndVersion)) + { + writer.WritePropertyName("frameworkAndVersion"u8); + writer.WriteStringValue(FrameworkAndVersion); + } + if (Optional.IsDefined(OSAndVersion)) + { + writer.WritePropertyName("osAndVersion"u8); + writer.WriteStringValue(OSAndVersion); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + PatchDetailsNewLayer IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(PatchDetailsNewLayer)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializePatchDetailsNewLayer(document.RootElement, options); + } + + internal static PatchDetailsNewLayer DeserializePatchDetailsNewLayer(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string name = default; + string frameworkAndVersion = default; + string osAndVersion = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("frameworkAndVersion"u8)) + { + frameworkAndVersion = property.Value.GetString(); + continue; + } + if (property.NameEquals("osAndVersion"u8)) + { + osAndVersion = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new PatchDetailsNewLayer(name, frameworkAndVersion, osAndVersion, serializedAdditionalRawData); + } + + private BinaryData SerializeBicep(ModelReaderWriterOptions options) + { + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Name), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" name: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Name)) + { + builder.Append(" name: "); + if (Name.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{Name}'''"); + } + else + { + builder.AppendLine($"'{Name}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(FrameworkAndVersion), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" frameworkAndVersion: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(FrameworkAndVersion)) + { + builder.Append(" frameworkAndVersion: "); + if (FrameworkAndVersion.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{FrameworkAndVersion}'''"); + } + else + { + builder.AppendLine($"'{FrameworkAndVersion}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(OSAndVersion), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" osAndVersion: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(OSAndVersion)) + { + builder.Append(" osAndVersion: "); + if (OSAndVersion.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{OSAndVersion}'''"); + } + else + { + builder.AppendLine($"'{OSAndVersion}'"); + } + } + } + + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerAppContainersContext.Default); + case "bicep": + return SerializeBicep(options); + default: + throw new FormatException($"The model {nameof(PatchDetailsNewLayer)} does not support writing '{options.Format}' format."); + } + } + + PatchDetailsNewLayer IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializePatchDetailsNewLayer(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(PatchDetailsNewLayer)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/PatchDetailsNewLayer.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/PatchDetailsNewLayer.cs new file mode 100644 index 000000000000..95a7569ce1b4 --- /dev/null +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/PatchDetailsNewLayer.cs @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.AppContainers.Models +{ + /// New layer update details in the target image. + public partial class PatchDetailsNewLayer + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + internal PatchDetailsNewLayer() + { + } + + /// Initializes a new instance of . + /// The details of the new layer for the target image. + /// The framework and its version in the new run image for the target image. + /// The OS name and its version in the new run image for the target image. + /// Keeps track of any properties unknown to the library. + internal PatchDetailsNewLayer(string name, string frameworkAndVersion, string osAndVersion, IDictionary serializedAdditionalRawData) + { + Name = name; + FrameworkAndVersion = frameworkAndVersion; + OSAndVersion = osAndVersion; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The details of the new layer for the target image. + [WirePath("name")] + public string Name { get; } + /// The framework and its version in the new run image for the target image. + [WirePath("frameworkAndVersion")] + public string FrameworkAndVersion { get; } + /// The OS name and its version in the new run image for the target image. + [WirePath("osAndVersion")] + public string OSAndVersion { get; } + } +} diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/PatchDetailsOldLayer.Serialization.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/PatchDetailsOldLayer.Serialization.cs new file mode 100644 index 000000000000..abf39d15bfd3 --- /dev/null +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/PatchDetailsOldLayer.Serialization.cs @@ -0,0 +1,238 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.AppContainers.Models +{ + public partial class PatchDetailsOldLayer : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(PatchDetailsOldLayer)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(Name)) + { + writer.WritePropertyName("name"u8); + writer.WriteStringValue(Name); + } + if (Optional.IsDefined(FrameworkAndVersion)) + { + writer.WritePropertyName("frameworkAndVersion"u8); + writer.WriteStringValue(FrameworkAndVersion); + } + if (Optional.IsDefined(OSAndVersion)) + { + writer.WritePropertyName("osAndVersion"u8); + writer.WriteStringValue(OSAndVersion); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + PatchDetailsOldLayer IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(PatchDetailsOldLayer)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializePatchDetailsOldLayer(document.RootElement, options); + } + + internal static PatchDetailsOldLayer DeserializePatchDetailsOldLayer(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string name = default; + string frameworkAndVersion = default; + string osAndVersion = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("frameworkAndVersion"u8)) + { + frameworkAndVersion = property.Value.GetString(); + continue; + } + if (property.NameEquals("osAndVersion"u8)) + { + osAndVersion = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new PatchDetailsOldLayer(name, frameworkAndVersion, osAndVersion, serializedAdditionalRawData); + } + + private BinaryData SerializeBicep(ModelReaderWriterOptions options) + { + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Name), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" name: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Name)) + { + builder.Append(" name: "); + if (Name.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{Name}'''"); + } + else + { + builder.AppendLine($"'{Name}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(FrameworkAndVersion), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" frameworkAndVersion: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(FrameworkAndVersion)) + { + builder.Append(" frameworkAndVersion: "); + if (FrameworkAndVersion.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{FrameworkAndVersion}'''"); + } + else + { + builder.AppendLine($"'{FrameworkAndVersion}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(OSAndVersion), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" osAndVersion: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(OSAndVersion)) + { + builder.Append(" osAndVersion: "); + if (OSAndVersion.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{OSAndVersion}'''"); + } + else + { + builder.AppendLine($"'{OSAndVersion}'"); + } + } + } + + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerAppContainersContext.Default); + case "bicep": + return SerializeBicep(options); + default: + throw new FormatException($"The model {nameof(PatchDetailsOldLayer)} does not support writing '{options.Format}' format."); + } + } + + PatchDetailsOldLayer IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializePatchDetailsOldLayer(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(PatchDetailsOldLayer)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/PatchDetailsOldLayer.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/PatchDetailsOldLayer.cs new file mode 100644 index 000000000000..87b9ba5f942c --- /dev/null +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/PatchDetailsOldLayer.cs @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.AppContainers.Models +{ + /// The old layer details in the target image. + public partial class PatchDetailsOldLayer + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + internal PatchDetailsOldLayer() + { + } + + /// Initializes a new instance of . + /// The details of the old layer for the target image. + /// The framework and its version in the old run image for the target image. + /// The OS name and its version in the old run image for the target image. + /// Keeps track of any properties unknown to the library. + internal PatchDetailsOldLayer(string name, string frameworkAndVersion, string osAndVersion, IDictionary serializedAdditionalRawData) + { + Name = name; + FrameworkAndVersion = frameworkAndVersion; + OSAndVersion = osAndVersion; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The details of the old layer for the target image. + [WirePath("name")] + public string Name { get; } + /// The framework and its version in the old run image for the target image. + [WirePath("frameworkAndVersion")] + public string FrameworkAndVersion { get; } + /// The OS name and its version in the old run image for the target image. + [WirePath("osAndVersion")] + public string OSAndVersion { get; } + } +} diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/PatchProperties.Serialization.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/PatchProperties.Serialization.cs new file mode 100644 index 000000000000..2d398a235f6d --- /dev/null +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/PatchProperties.Serialization.cs @@ -0,0 +1,375 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.AppContainers.Models +{ + public partial class PatchProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(PatchProperties)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(TargetEnvironmentId)) + { + writer.WritePropertyName("targetEnvironmentId"u8); + writer.WriteStringValue(TargetEnvironmentId); + } + if (Optional.IsDefined(TargetContainerAppId)) + { + writer.WritePropertyName("targetContainerAppId"u8); + writer.WriteStringValue(TargetContainerAppId); + } + if (Optional.IsDefined(TargetRevisionId)) + { + writer.WritePropertyName("targetRevisionId"u8); + writer.WriteStringValue(TargetRevisionId); + } + if (options.Format != "W" && Optional.IsDefined(PatchApplyStatus)) + { + writer.WritePropertyName("patchApplyStatus"u8); + writer.WriteStringValue(PatchApplyStatus.Value.ToString()); + } + if (options.Format != "W" && Optional.IsDefined(CreatedOn)) + { + writer.WritePropertyName("createdAt"u8); + writer.WriteStringValue(CreatedOn.Value, "O"); + } + if (options.Format != "W" && Optional.IsDefined(LastModifiedOn)) + { + writer.WritePropertyName("lastModifiedAt"u8); + writer.WriteStringValue(LastModifiedOn.Value, "O"); + } + if (options.Format != "W" && Optional.IsCollectionDefined(PatchDetails)) + { + writer.WritePropertyName("patchDetails"u8); + writer.WriteStartArray(); + foreach (var item in PatchDetails) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + PatchProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(PatchProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializePatchProperties(document.RootElement, options); + } + + internal static PatchProperties DeserializePatchProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ResourceIdentifier targetEnvironmentId = default; + ResourceIdentifier targetContainerAppId = default; + ResourceIdentifier targetRevisionId = default; + PatchApplyStatus? patchApplyStatus = default; + DateTimeOffset? createdAt = default; + DateTimeOffset? lastModifiedAt = default; + IReadOnlyList patchDetails = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("targetEnvironmentId"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + targetEnvironmentId = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("targetContainerAppId"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + targetContainerAppId = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("targetRevisionId"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + targetRevisionId = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("patchApplyStatus"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + patchApplyStatus = new PatchApplyStatus(property.Value.GetString()); + continue; + } + if (property.NameEquals("createdAt"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + createdAt = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("lastModifiedAt"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + lastModifiedAt = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("patchDetails"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(Models.PatchDetails.DeserializePatchDetails(item, options)); + } + patchDetails = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new PatchProperties( + targetEnvironmentId, + targetContainerAppId, + targetRevisionId, + patchApplyStatus, + createdAt, + lastModifiedAt, + patchDetails ?? new ChangeTrackingList(), + serializedAdditionalRawData); + } + + private BinaryData SerializeBicep(ModelReaderWriterOptions options) + { + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(TargetEnvironmentId), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" targetEnvironmentId: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(TargetEnvironmentId)) + { + builder.Append(" targetEnvironmentId: "); + builder.AppendLine($"'{TargetEnvironmentId.ToString()}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(TargetContainerAppId), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" targetContainerAppId: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(TargetContainerAppId)) + { + builder.Append(" targetContainerAppId: "); + builder.AppendLine($"'{TargetContainerAppId.ToString()}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(TargetRevisionId), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" targetRevisionId: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(TargetRevisionId)) + { + builder.Append(" targetRevisionId: "); + builder.AppendLine($"'{TargetRevisionId.ToString()}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(PatchApplyStatus), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" patchApplyStatus: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(PatchApplyStatus)) + { + builder.Append(" patchApplyStatus: "); + builder.AppendLine($"'{PatchApplyStatus.Value.ToString()}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(CreatedOn), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" createdAt: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(CreatedOn)) + { + builder.Append(" createdAt: "); + var formattedDateTimeString = TypeFormatters.ToString(CreatedOn.Value, "o"); + builder.AppendLine($"'{formattedDateTimeString}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(LastModifiedOn), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" lastModifiedAt: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(LastModifiedOn)) + { + builder.Append(" lastModifiedAt: "); + var formattedDateTimeString = TypeFormatters.ToString(LastModifiedOn.Value, "o"); + builder.AppendLine($"'{formattedDateTimeString}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(PatchDetails), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" patchDetails: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsCollectionDefined(PatchDetails)) + { + if (PatchDetails.Any()) + { + builder.Append(" patchDetails: "); + builder.AppendLine("["); + foreach (var item in PatchDetails) + { + BicepSerializationHelpers.AppendChildObject(builder, item, options, 4, true, " patchDetails: "); + } + builder.AppendLine(" ]"); + } + } + } + + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerAppContainersContext.Default); + case "bicep": + return SerializeBicep(options); + default: + throw new FormatException($"The model {nameof(PatchProperties)} does not support writing '{options.Format}' format."); + } + } + + PatchProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializePatchProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(PatchProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/PatchProperties.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/PatchProperties.cs new file mode 100644 index 000000000000..7850c127a850 --- /dev/null +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/PatchProperties.cs @@ -0,0 +1,98 @@ +// 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.AppContainers.Models +{ + /// Top level properties that describes current states of the patch resource. + public partial class PatchProperties + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + internal PatchProperties() + { + PatchDetails = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// The Azure resource id of the target environment for the patch. + /// The Azure resource id of the target container app for the patch. + /// The Azure resource id of the target revision for the patch. + /// The status of the patch operation. + /// The UTC timestamp that describes when the patch object was created. + /// The UTC timestamp that describes when the patch object was last updated. + /// Detailed info describes the patch operation for the target container app. + /// Keeps track of any properties unknown to the library. + internal PatchProperties(ResourceIdentifier targetEnvironmentId, ResourceIdentifier targetContainerAppId, ResourceIdentifier targetRevisionId, PatchApplyStatus? patchApplyStatus, DateTimeOffset? createdOn, DateTimeOffset? lastModifiedOn, IReadOnlyList patchDetails, IDictionary serializedAdditionalRawData) + { + TargetEnvironmentId = targetEnvironmentId; + TargetContainerAppId = targetContainerAppId; + TargetRevisionId = targetRevisionId; + PatchApplyStatus = patchApplyStatus; + CreatedOn = createdOn; + LastModifiedOn = lastModifiedOn; + PatchDetails = patchDetails; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The Azure resource id of the target environment for the patch. + [WirePath("targetEnvironmentId")] + public ResourceIdentifier TargetEnvironmentId { get; } + /// The Azure resource id of the target container app for the patch. + [WirePath("targetContainerAppId")] + public ResourceIdentifier TargetContainerAppId { get; } + /// The Azure resource id of the target revision for the patch. + [WirePath("targetRevisionId")] + public ResourceIdentifier TargetRevisionId { get; } + /// The status of the patch operation. + [WirePath("patchApplyStatus")] + public PatchApplyStatus? PatchApplyStatus { get; } + /// The UTC timestamp that describes when the patch object was created. + [WirePath("createdAt")] + public DateTimeOffset? CreatedOn { get; } + /// The UTC timestamp that describes when the patch object was last updated. + [WirePath("lastModifiedAt")] + public DateTimeOffset? LastModifiedOn { get; } + /// Detailed info describes the patch operation for the target container app. + [WirePath("patchDetails")] + public IReadOnlyList PatchDetails { get; } + } +} diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/PatchSkipConfig.Serialization.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/PatchSkipConfig.Serialization.cs new file mode 100644 index 000000000000..de3f66287071 --- /dev/null +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/PatchSkipConfig.Serialization.cs @@ -0,0 +1,133 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.AppContainers.Models +{ + public partial class PatchSkipConfig : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(PatchSkipConfig)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(Skip)) + { + writer.WritePropertyName("skip"u8); + writer.WriteBooleanValue(Skip.Value); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + PatchSkipConfig IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(PatchSkipConfig)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializePatchSkipConfig(document.RootElement, options); + } + + internal static PatchSkipConfig DeserializePatchSkipConfig(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + bool? skip = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("skip"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + skip = property.Value.GetBoolean(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new PatchSkipConfig(skip, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerAppContainersContext.Default); + default: + throw new FormatException($"The model {nameof(PatchSkipConfig)} does not support writing '{options.Format}' format."); + } + } + + PatchSkipConfig IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializePatchSkipConfig(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(PatchSkipConfig)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/PatchSkipConfig.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/PatchSkipConfig.cs new file mode 100644 index 000000000000..5af12fcd7dd5 --- /dev/null +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/PatchSkipConfig.cs @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.AppContainers.Models +{ + /// The configuration for patcher to skip a patch or not. + public partial class PatchSkipConfig + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public PatchSkipConfig() + { + } + + /// Initializes a new instance of . + /// The flag to indicate whether to skip the patch or not. + /// Keeps track of any properties unknown to the library. + internal PatchSkipConfig(bool? skip, IDictionary serializedAdditionalRawData) + { + Skip = skip; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The flag to indicate whether to skip the patch or not. + [WirePath("skip")] + public bool? Skip { get; set; } + } +} diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/PatchType.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/PatchType.cs new file mode 100644 index 000000000000..93758a632abb --- /dev/null +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/PatchType.cs @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.AppContainers.Models +{ + /// The type for the patch. + public readonly partial struct PatchType : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public PatchType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string FrameworkSecurityValue = "FrameworkSecurity"; + private const string OSSecurityValue = "OSSecurity"; + private const string FrameworkAndOSSecurityValue = "FrameworkAndOSSecurity"; + private const string OtherValue = "Other"; + + /// FrameworkSecurity. + public static PatchType FrameworkSecurity { get; } = new PatchType(FrameworkSecurityValue); + /// OSSecurity. + public static PatchType OSSecurity { get; } = new PatchType(OSSecurityValue); + /// FrameworkAndOSSecurity. + public static PatchType FrameworkAndOSSecurity { get; } = new PatchType(FrameworkAndOSSecurityValue); + /// Other. + public static PatchType Other { get; } = new PatchType(OtherValue); + /// Determines if two values are the same. + public static bool operator ==(PatchType left, PatchType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(PatchType left, PatchType right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator PatchType(string value) => new PatchType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is PatchType other && Equals(other); + /// + public bool Equals(PatchType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/PatchingMode.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/PatchingMode.cs new file mode 100644 index 000000000000..e57ada38ac69 --- /dev/null +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/PatchingMode.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.AppContainers.Models +{ + /// Patching mode for the container app. Null or default in this field will be interpreted as Automatic by RP. Automatic mode will automatically apply available patches. Manual mode will require the user to manually apply patches. Disabled mode will stop patch detection and auto patching. + public readonly partial struct PatchingMode : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public PatchingMode(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string AutomaticValue = "Automatic"; + private const string ManualValue = "Manual"; + private const string DisabledValue = "Disabled"; + + /// Automatic. + public static PatchingMode Automatic { get; } = new PatchingMode(AutomaticValue); + /// Manual. + public static PatchingMode Manual { get; } = new PatchingMode(ManualValue); + /// Disabled. + public static PatchingMode Disabled { get; } = new PatchingMode(DisabledValue); + /// Determines if two values are the same. + public static bool operator ==(PatchingMode left, PatchingMode right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(PatchingMode left, PatchingMode right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator PatchingMode(string value) => new PatchingMode(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is PatchingMode other && Equals(other); + /// + public bool Equals(PatchingMode other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/PreBuildStep.Serialization.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/PreBuildStep.Serialization.cs new file mode 100644 index 000000000000..c220814b00d0 --- /dev/null +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/PreBuildStep.Serialization.cs @@ -0,0 +1,262 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.AppContainers.Models +{ + public partial class PreBuildStep : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(PreBuildStep)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(Description)) + { + writer.WritePropertyName("description"u8); + writer.WriteStringValue(Description); + } + if (Optional.IsCollectionDefined(Scripts)) + { + writer.WritePropertyName("scripts"u8); + writer.WriteStartArray(); + foreach (var item in Scripts) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(HttpGet)) + { + writer.WritePropertyName("httpGet"u8); + writer.WriteObjectValue(HttpGet, options); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + PreBuildStep IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(PreBuildStep)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializePreBuildStep(document.RootElement, options); + } + + internal static PreBuildStep DeserializePreBuildStep(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string description = default; + IList scripts = default; + HttpGet httpGet = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("description"u8)) + { + description = property.Value.GetString(); + continue; + } + if (property.NameEquals("scripts"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + scripts = array; + continue; + } + if (property.NameEquals("httpGet"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + httpGet = HttpGet.DeserializeHttpGet(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new PreBuildStep(description, scripts ?? new ChangeTrackingList(), httpGet, serializedAdditionalRawData); + } + + private BinaryData SerializeBicep(ModelReaderWriterOptions options) + { + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Description), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" description: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Description)) + { + builder.Append(" description: "); + if (Description.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{Description}'''"); + } + else + { + builder.AppendLine($"'{Description}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Scripts), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" scripts: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsCollectionDefined(Scripts)) + { + if (Scripts.Any()) + { + builder.Append(" scripts: "); + builder.AppendLine("["); + foreach (var item in Scripts) + { + if (item == null) + { + builder.Append("null"); + continue; + } + if (item.Contains(Environment.NewLine)) + { + builder.AppendLine(" '''"); + builder.AppendLine($"{item}'''"); + } + else + { + builder.AppendLine($" '{item}'"); + } + } + builder.AppendLine(" ]"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(HttpGet), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" httpGet: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(HttpGet)) + { + builder.Append(" httpGet: "); + BicepSerializationHelpers.AppendChildObject(builder, HttpGet, options, 2, false, " httpGet: "); + } + } + + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerAppContainersContext.Default); + case "bicep": + return SerializeBicep(options); + default: + throw new FormatException($"The model {nameof(PreBuildStep)} does not support writing '{options.Format}' format."); + } + } + + PreBuildStep IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializePreBuildStep(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(PreBuildStep)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/PreBuildStep.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/PreBuildStep.cs new file mode 100644 index 000000000000..9ca424658f6f --- /dev/null +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/PreBuildStep.cs @@ -0,0 +1,77 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.AppContainers.Models +{ + /// Model representing a pre-build step. + public partial class PreBuildStep + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public PreBuildStep() + { + Scripts = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// Description of the pre-build step. + /// List of custom commands to run. + /// Http get request to send before the build. + /// Keeps track of any properties unknown to the library. + internal PreBuildStep(string description, IList scripts, HttpGet httpGet, IDictionary serializedAdditionalRawData) + { + Description = description; + Scripts = scripts; + HttpGet = httpGet; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Description of the pre-build step. + [WirePath("description")] + public string Description { get; set; } + /// List of custom commands to run. + [WirePath("scripts")] + public IList Scripts { get; } + /// Http get request to send before the build. + [WirePath("httpGet")] + public HttpGet HttpGet { get; set; } + } +} diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/PublicNetworkAccess.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/PublicNetworkAccess.cs new file mode 100644 index 000000000000..42262d59d37d --- /dev/null +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/PublicNetworkAccess.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.AppContainers.Models +{ + /// Property to allow or block all public traffic. Allowed Values: 'Enabled', 'Disabled'. + public readonly partial struct PublicNetworkAccess : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public PublicNetworkAccess(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string EnabledValue = "Enabled"; + private const string DisabledValue = "Disabled"; + + /// Enabled. + public static PublicNetworkAccess Enabled { get; } = new PublicNetworkAccess(EnabledValue); + /// Disabled. + public static PublicNetworkAccess Disabled { get; } = new PublicNetworkAccess(DisabledValue); + /// Determines if two values are the same. + public static bool operator ==(PublicNetworkAccess left, PublicNetworkAccess right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(PublicNetworkAccess left, PublicNetworkAccess right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator PublicNetworkAccess(string value) => new PublicNetworkAccess(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is PublicNetworkAccess other && Equals(other); + /// + public bool Equals(PublicNetworkAccess other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/ReplicaExecutionStatus.Serialization.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/ReplicaExecutionStatus.Serialization.cs new file mode 100644 index 000000000000..08fe988e4221 --- /dev/null +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/ReplicaExecutionStatus.Serialization.cs @@ -0,0 +1,219 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.AppContainers.Models +{ + public partial class ReplicaExecutionStatus : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ReplicaExecutionStatus)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(Name)) + { + writer.WritePropertyName("name"u8); + writer.WriteStringValue(Name); + } + if (Optional.IsCollectionDefined(Containers)) + { + writer.WritePropertyName("containers"u8); + writer.WriteStartArray(); + foreach (var item in Containers) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + ReplicaExecutionStatus IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ReplicaExecutionStatus)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeReplicaExecutionStatus(document.RootElement, options); + } + + internal static ReplicaExecutionStatus DeserializeReplicaExecutionStatus(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string name = default; + IReadOnlyList containers = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("containers"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(ContainerExecutionStatus.DeserializeContainerExecutionStatus(item, options)); + } + containers = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ReplicaExecutionStatus(name, containers ?? new ChangeTrackingList(), serializedAdditionalRawData); + } + + private BinaryData SerializeBicep(ModelReaderWriterOptions options) + { + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Name), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" name: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Name)) + { + builder.Append(" name: "); + if (Name.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{Name}'''"); + } + else + { + builder.AppendLine($"'{Name}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Containers), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" containers: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsCollectionDefined(Containers)) + { + if (Containers.Any()) + { + builder.Append(" containers: "); + builder.AppendLine("["); + foreach (var item in Containers) + { + BicepSerializationHelpers.AppendChildObject(builder, item, options, 4, true, " containers: "); + } + builder.AppendLine(" ]"); + } + } + } + + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerAppContainersContext.Default); + case "bicep": + return SerializeBicep(options); + default: + throw new FormatException($"The model {nameof(ReplicaExecutionStatus)} does not support writing '{options.Format}' format."); + } + } + + ReplicaExecutionStatus IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeReplicaExecutionStatus(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ReplicaExecutionStatus)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/ReplicaExecutionStatus.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/ReplicaExecutionStatus.cs new file mode 100644 index 000000000000..4a71d08314be --- /dev/null +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/ReplicaExecutionStatus.cs @@ -0,0 +1,72 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.AppContainers.Models +{ + /// Container Apps Job execution replica status. + public partial class ReplicaExecutionStatus + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + internal ReplicaExecutionStatus() + { + Containers = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// Replica Name. + /// Containers in the execution replica. + /// Keeps track of any properties unknown to the library. + internal ReplicaExecutionStatus(string name, IReadOnlyList containers, IDictionary serializedAdditionalRawData) + { + Name = name; + Containers = containers; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Replica Name. + [WirePath("name")] + public string Name { get; } + /// Containers in the execution replica. + [WirePath("containers")] + public IReadOnlyList Containers { get; } + } +} diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/RuntimeJava.Serialization.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/RuntimeDotnet.Serialization.cs similarity index 65% rename from sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/RuntimeJava.Serialization.cs rename to sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/RuntimeDotnet.Serialization.cs index df74e653b5fb..ece333d4a967 100644 --- a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/RuntimeJava.Serialization.cs +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/RuntimeDotnet.Serialization.cs @@ -14,11 +14,11 @@ namespace Azure.ResourceManager.AppContainers.Models { - internal partial class RuntimeJava : IUtf8JsonSerializable, IJsonModel + internal partial class RuntimeDotnet : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); JsonModelWriteCore(writer, options); @@ -29,16 +29,16 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptio /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(RuntimeJava)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(RuntimeDotnet)} does not support writing '{format}' format."); } - if (Optional.IsDefined(EnableMetrics)) + if (Optional.IsDefined(AutoConfigureDataProtection)) { - writer.WritePropertyName("enableMetrics"u8); - writer.WriteBooleanValue(EnableMetrics.Value); + writer.WritePropertyName("autoConfigureDataProtection"u8); + writer.WriteBooleanValue(AutoConfigureDataProtection.Value); } if (options.Format != "W" && _serializedAdditionalRawData != null) { @@ -57,19 +57,19 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - RuntimeJava IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + RuntimeDotnet IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(RuntimeJava)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(RuntimeDotnet)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeRuntimeJava(document.RootElement, options); + return DeserializeRuntimeDotnet(document.RootElement, options); } - internal static RuntimeJava DeserializeRuntimeJava(JsonElement element, ModelReaderWriterOptions options = null) + internal static RuntimeDotnet DeserializeRuntimeDotnet(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -77,18 +77,18 @@ internal static RuntimeJava DeserializeRuntimeJava(JsonElement element, ModelRea { return null; } - bool? enableMetrics = default; + bool? autoConfigureDataProtection = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("enableMetrics"u8)) + if (property.NameEquals("autoConfigureDataProtection"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) { continue; } - enableMetrics = property.Value.GetBoolean(); + autoConfigureDataProtection = property.Value.GetBoolean(); continue; } if (options.Format != "W") @@ -97,7 +97,7 @@ internal static RuntimeJava DeserializeRuntimeJava(JsonElement element, ModelRea } } serializedAdditionalRawData = rawDataDictionary; - return new RuntimeJava(enableMetrics, serializedAdditionalRawData); + return new RuntimeDotnet(autoConfigureDataProtection, serializedAdditionalRawData); } private BinaryData SerializeBicep(ModelReaderWriterOptions options) @@ -111,18 +111,18 @@ private BinaryData SerializeBicep(ModelReaderWriterOptions options) builder.AppendLine("{"); - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(EnableMetrics), out propertyOverride); + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(AutoConfigureDataProtection), out propertyOverride); if (hasPropertyOverride) { - builder.Append(" enableMetrics: "); + builder.Append(" autoConfigureDataProtection: "); builder.AppendLine(propertyOverride); } else { - if (Optional.IsDefined(EnableMetrics)) + if (Optional.IsDefined(AutoConfigureDataProtection)) { - builder.Append(" enableMetrics: "); - var boolValue = EnableMetrics.Value == true ? "true" : "false"; + builder.Append(" autoConfigureDataProtection: "); + var boolValue = AutoConfigureDataProtection.Value == true ? "true" : "false"; builder.AppendLine($"{boolValue}"); } } @@ -131,9 +131,9 @@ private BinaryData SerializeBicep(ModelReaderWriterOptions options) return BinaryData.FromString(builder.ToString()); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { @@ -142,26 +142,26 @@ BinaryData IPersistableModel.Write(ModelReaderWriterOptions options case "bicep": return SerializeBicep(options); default: - throw new FormatException($"The model {nameof(RuntimeJava)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(RuntimeDotnet)} does not support writing '{options.Format}' format."); } } - RuntimeJava IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + RuntimeDotnet IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeRuntimeJava(document.RootElement, options); + return DeserializeRuntimeDotnet(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(RuntimeJava)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(RuntimeDotnet)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/Runtime.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/RuntimeDotnet.cs similarity index 69% rename from sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/Runtime.cs rename to sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/RuntimeDotnet.cs index 96c42be89b23..9222ca2ac942 100644 --- a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/Runtime.cs +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/RuntimeDotnet.cs @@ -10,8 +10,8 @@ namespace Azure.ResourceManager.AppContainers.Models { - /// Container App Runtime configuration. - internal partial class Runtime + /// .NET app configuration. + internal partial class RuntimeDotnet { /// /// Keeps track of any properties unknown to the library. @@ -45,33 +45,22 @@ internal partial class Runtime /// private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . - public Runtime() + /// Initializes a new instance of . + public RuntimeDotnet() { } - /// Initializes a new instance of . - /// Java app configuration. + /// Initializes a new instance of . + /// Auto configure the ASP.NET Core Data Protection feature. /// Keeps track of any properties unknown to the library. - internal Runtime(RuntimeJava java, IDictionary serializedAdditionalRawData) + internal RuntimeDotnet(bool? autoConfigureDataProtection, IDictionary serializedAdditionalRawData) { - Java = java; + AutoConfigureDataProtection = autoConfigureDataProtection; _serializedAdditionalRawData = serializedAdditionalRawData; } - /// Java app configuration. - internal RuntimeJava Java { get; set; } - /// Enable jmx core metrics for the java app. - [WirePath("java.enableMetrics")] - public bool? EnableMetrics - { - get => Java is null ? default : Java.EnableMetrics; - set - { - if (Java is null) - Java = new RuntimeJava(); - Java.EnableMetrics = value; - } - } + /// Auto configure the ASP.NET Core Data Protection feature. + [WirePath("autoConfigureDataProtection")] + public bool? AutoConfigureDataProtection { get; set; } } } diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/RuntimeJavaAgentLogging.Serialization.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/RuntimeJavaAgentLogging.Serialization.cs new file mode 100644 index 000000000000..65b8453d5a02 --- /dev/null +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/RuntimeJavaAgentLogging.Serialization.cs @@ -0,0 +1,185 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.AppContainers.Models +{ + internal partial class RuntimeJavaAgentLogging : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(RuntimeJavaAgentLogging)} does not support writing '{format}' format."); + } + + if (Optional.IsCollectionDefined(LoggerSettings)) + { + writer.WritePropertyName("loggerSettings"u8); + writer.WriteStartArray(); + foreach (var item in LoggerSettings) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + RuntimeJavaAgentLogging IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(RuntimeJavaAgentLogging)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeRuntimeJavaAgentLogging(document.RootElement, options); + } + + internal static RuntimeJavaAgentLogging DeserializeRuntimeJavaAgentLogging(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IList loggerSettings = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("loggerSettings"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(LoggerSetting.DeserializeLoggerSetting(item, options)); + } + loggerSettings = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new RuntimeJavaAgentLogging(loggerSettings ?? new ChangeTrackingList(), serializedAdditionalRawData); + } + + private BinaryData SerializeBicep(ModelReaderWriterOptions options) + { + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(LoggerSettings), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" loggerSettings: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsCollectionDefined(LoggerSettings)) + { + if (LoggerSettings.Any()) + { + builder.Append(" loggerSettings: "); + builder.AppendLine("["); + foreach (var item in LoggerSettings) + { + BicepSerializationHelpers.AppendChildObject(builder, item, options, 4, true, " loggerSettings: "); + } + builder.AppendLine(" ]"); + } + } + } + + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerAppContainersContext.Default); + case "bicep": + return SerializeBicep(options); + default: + throw new FormatException($"The model {nameof(RuntimeJavaAgentLogging)} does not support writing '{options.Format}' format."); + } + } + + RuntimeJavaAgentLogging IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeRuntimeJavaAgentLogging(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(RuntimeJavaAgentLogging)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/RuntimeJavaAgentLogging.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/RuntimeJavaAgentLogging.cs new file mode 100644 index 000000000000..a80f8c4b306d --- /dev/null +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/RuntimeJavaAgentLogging.cs @@ -0,0 +1,67 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.AppContainers.Models +{ + /// Capabilities on the java logging scenario. + internal partial class RuntimeJavaAgentLogging + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public RuntimeJavaAgentLogging() + { + LoggerSettings = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// Settings of the logger for the java app. + /// Keeps track of any properties unknown to the library. + internal RuntimeJavaAgentLogging(IList loggerSettings, IDictionary serializedAdditionalRawData) + { + LoggerSettings = loggerSettings; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Settings of the logger for the java app. + [WirePath("loggerSettings")] + public IList LoggerSettings { get; } + } +} diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/ScgRoute.Serialization.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/ScgRoute.Serialization.cs new file mode 100644 index 000000000000..26fe6e69eb73 --- /dev/null +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/ScgRoute.Serialization.cs @@ -0,0 +1,349 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.AppContainers.Models +{ + public partial class ScgRoute : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ScgRoute)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("id"u8); + writer.WriteStringValue(Id); + writer.WritePropertyName("uri"u8); + writer.WriteStringValue(Uri.AbsoluteUri); + if (Optional.IsCollectionDefined(Predicates)) + { + writer.WritePropertyName("predicates"u8); + writer.WriteStartArray(); + foreach (var item in Predicates) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(Filters)) + { + writer.WritePropertyName("filters"u8); + writer.WriteStartArray(); + foreach (var item in Filters) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(Order)) + { + writer.WritePropertyName("order"u8); + writer.WriteNumberValue(Order.Value); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + ScgRoute IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ScgRoute)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeScgRoute(document.RootElement, options); + } + + internal static ScgRoute DeserializeScgRoute(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string id = default; + Uri uri = default; + IList predicates = default; + IList filters = default; + long? order = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("id"u8)) + { + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("uri"u8)) + { + uri = new Uri(property.Value.GetString()); + continue; + } + if (property.NameEquals("predicates"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + predicates = array; + continue; + } + if (property.NameEquals("filters"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + filters = array; + continue; + } + if (property.NameEquals("order"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + order = property.Value.GetInt64(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ScgRoute( + id, + uri, + predicates ?? new ChangeTrackingList(), + filters ?? new ChangeTrackingList(), + order, + serializedAdditionalRawData); + } + + private BinaryData SerializeBicep(ModelReaderWriterOptions options) + { + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Id), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" id: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Id)) + { + builder.Append(" id: "); + if (Id.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{Id}'''"); + } + else + { + builder.AppendLine($"'{Id}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Uri), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" uri: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Uri)) + { + builder.Append(" uri: "); + builder.AppendLine($"'{Uri.AbsoluteUri}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Predicates), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" predicates: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsCollectionDefined(Predicates)) + { + if (Predicates.Any()) + { + builder.Append(" predicates: "); + builder.AppendLine("["); + foreach (var item in Predicates) + { + if (item == null) + { + builder.Append("null"); + continue; + } + if (item.Contains(Environment.NewLine)) + { + builder.AppendLine(" '''"); + builder.AppendLine($"{item}'''"); + } + else + { + builder.AppendLine($" '{item}'"); + } + } + builder.AppendLine(" ]"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Filters), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" filters: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsCollectionDefined(Filters)) + { + if (Filters.Any()) + { + builder.Append(" filters: "); + builder.AppendLine("["); + foreach (var item in Filters) + { + if (item == null) + { + builder.Append("null"); + continue; + } + if (item.Contains(Environment.NewLine)) + { + builder.AppendLine(" '''"); + builder.AppendLine($"{item}'''"); + } + else + { + builder.AppendLine($" '{item}'"); + } + } + builder.AppendLine(" ]"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Order), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" order: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Order)) + { + builder.Append(" order: "); + builder.AppendLine($"'{Order.Value.ToString()}'"); + } + } + + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerAppContainersContext.Default); + case "bicep": + return SerializeBicep(options); + default: + throw new FormatException($"The model {nameof(ScgRoute)} does not support writing '{options.Format}' format."); + } + } + + ScgRoute IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeScgRoute(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ScgRoute)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/ScgRoute.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/ScgRoute.cs new file mode 100644 index 000000000000..5c268d1ebbd0 --- /dev/null +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/ScgRoute.cs @@ -0,0 +1,101 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.AppContainers.Models +{ + /// Spring Cloud Gateway route definition. + public partial class ScgRoute + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// Id of the route. + /// Uri of the route. + /// or is null. + public ScgRoute(string id, Uri uri) + { + Argument.AssertNotNull(id, nameof(id)); + Argument.AssertNotNull(uri, nameof(uri)); + + Id = id; + Uri = uri; + Predicates = new ChangeTrackingList(); + Filters = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// Id of the route. + /// Uri of the route. + /// Predicates of the route. + /// Filters of the route. + /// Order of the route. + /// Keeps track of any properties unknown to the library. + internal ScgRoute(string id, Uri uri, IList predicates, IList filters, long? order, IDictionary serializedAdditionalRawData) + { + Id = id; + Uri = uri; + Predicates = predicates; + Filters = filters; + Order = order; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal ScgRoute() + { + } + + /// Id of the route. + [WirePath("id")] + public string Id { get; set; } + /// Uri of the route. + [WirePath("uri")] + public Uri Uri { get; set; } + /// Predicates of the route. + [WirePath("predicates")] + public IList Predicates { get; } + /// Filters of the route. + [WirePath("filters")] + public IList Filters { get; } + /// Order of the route. + [WirePath("order")] + public long? Order { get; set; } + } +} diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/ScheduledEntry.Serialization.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/ScheduledEntry.Serialization.cs new file mode 100644 index 000000000000..5269efa4c614 --- /dev/null +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/ScheduledEntry.Serialization.cs @@ -0,0 +1,196 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.AppContainers.Models +{ + public partial class ScheduledEntry : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ScheduledEntry)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("weekDay"u8); + writer.WriteStringValue(WeekDay.ToSerialString()); + writer.WritePropertyName("startHourUtc"u8); + writer.WriteNumberValue(StartHourUtc); + writer.WritePropertyName("durationHours"u8); + writer.WriteNumberValue(DurationHours); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + ScheduledEntry IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ScheduledEntry)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeScheduledEntry(document.RootElement, options); + } + + internal static ScheduledEntry DeserializeScheduledEntry(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ContainerAppWeekDay weekDay = default; + int startHourUtc = default; + int durationHours = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("weekDay"u8)) + { + weekDay = property.Value.GetString().ToContainerAppWeekDay(); + continue; + } + if (property.NameEquals("startHourUtc"u8)) + { + startHourUtc = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("durationHours"u8)) + { + durationHours = property.Value.GetInt32(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ScheduledEntry(weekDay, startHourUtc, durationHours, serializedAdditionalRawData); + } + + private BinaryData SerializeBicep(ModelReaderWriterOptions options) + { + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(WeekDay), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" weekDay: "); + builder.AppendLine(propertyOverride); + } + else + { + builder.Append(" weekDay: "); + builder.AppendLine($"'{WeekDay.ToSerialString()}'"); + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(StartHourUtc), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" startHourUtc: "); + builder.AppendLine(propertyOverride); + } + else + { + builder.Append(" startHourUtc: "); + builder.AppendLine($"{StartHourUtc}"); + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(DurationHours), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" durationHours: "); + builder.AppendLine(propertyOverride); + } + else + { + builder.Append(" durationHours: "); + builder.AppendLine($"{DurationHours}"); + } + + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerAppContainersContext.Default); + case "bicep": + return SerializeBicep(options); + default: + throw new FormatException($"The model {nameof(ScheduledEntry)} does not support writing '{options.Format}' format."); + } + } + + ScheduledEntry IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeScheduledEntry(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ScheduledEntry)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/ScheduledEntry.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/ScheduledEntry.cs new file mode 100644 index 000000000000..1e3213b43335 --- /dev/null +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/ScheduledEntry.cs @@ -0,0 +1,87 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.AppContainers.Models +{ + /// Maintenance schedule entry for a managed environment. + public partial class ScheduledEntry + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// Day of the week when a managed environment can be patched. + /// Start hour after which managed environment maintenance can start from 0 to 23 hour. + /// Length of maintenance window range from 8 to 24 hours. + public ScheduledEntry(ContainerAppWeekDay weekDay, int startHourUtc, int durationHours) + { + WeekDay = weekDay; + StartHourUtc = startHourUtc; + DurationHours = durationHours; + } + + /// Initializes a new instance of . + /// Day of the week when a managed environment can be patched. + /// Start hour after which managed environment maintenance can start from 0 to 23 hour. + /// Length of maintenance window range from 8 to 24 hours. + /// Keeps track of any properties unknown to the library. + internal ScheduledEntry(ContainerAppWeekDay weekDay, int startHourUtc, int durationHours, IDictionary serializedAdditionalRawData) + { + WeekDay = weekDay; + StartHourUtc = startHourUtc; + DurationHours = durationHours; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal ScheduledEntry() + { + } + + /// Day of the week when a managed environment can be patched. + [WirePath("weekDay")] + public ContainerAppWeekDay WeekDay { get; set; } + /// Start hour after which managed environment maintenance can start from 0 to 23 hour. + [WirePath("startHourUtc")] + public int StartHourUtc { get; set; } + /// Length of maintenance window range from 8 to 24 hours. + [WirePath("durationHours")] + public int DurationHours { get; set; } + } +} diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/SecretKeyVaultProperties.Serialization.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/SecretKeyVaultProperties.Serialization.cs new file mode 100644 index 000000000000..76e1d73e0c48 --- /dev/null +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/SecretKeyVaultProperties.Serialization.cs @@ -0,0 +1,200 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.AppContainers.Models +{ + public partial class SecretKeyVaultProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SecretKeyVaultProperties)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(Identity)) + { + writer.WritePropertyName("identity"u8); + writer.WriteStringValue(Identity); + } + if (Optional.IsDefined(KeyVaultUri)) + { + writer.WritePropertyName("keyVaultUrl"u8); + writer.WriteStringValue(KeyVaultUri.AbsoluteUri); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + SecretKeyVaultProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SecretKeyVaultProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeSecretKeyVaultProperties(document.RootElement, options); + } + + internal static SecretKeyVaultProperties DeserializeSecretKeyVaultProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string identity = default; + Uri keyVaultUrl = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("identity"u8)) + { + identity = property.Value.GetString(); + continue; + } + if (property.NameEquals("keyVaultUrl"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + keyVaultUrl = new Uri(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new SecretKeyVaultProperties(identity, keyVaultUrl, serializedAdditionalRawData); + } + + private BinaryData SerializeBicep(ModelReaderWriterOptions options) + { + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Identity), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" identity: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Identity)) + { + builder.Append(" identity: "); + if (Identity.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{Identity}'''"); + } + else + { + builder.AppendLine($"'{Identity}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(KeyVaultUri), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" keyVaultUrl: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(KeyVaultUri)) + { + builder.Append(" keyVaultUrl: "); + builder.AppendLine($"'{KeyVaultUri.AbsoluteUri}'"); + } + } + + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerAppContainersContext.Default); + case "bicep": + return SerializeBicep(options); + default: + throw new FormatException($"The model {nameof(SecretKeyVaultProperties)} does not support writing '{options.Format}' format."); + } + } + + SecretKeyVaultProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeSecretKeyVaultProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(SecretKeyVaultProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/SecretKeyVaultProperties.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/SecretKeyVaultProperties.cs new file mode 100644 index 000000000000..33a0dabcb57c --- /dev/null +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/SecretKeyVaultProperties.cs @@ -0,0 +1,71 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.AppContainers.Models +{ + /// Properties for a secret stored in a Key Vault. + public partial class SecretKeyVaultProperties + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public SecretKeyVaultProperties() + { + } + + /// Initializes a new instance of . + /// Resource ID of a managed identity to authenticate with Azure Key Vault, or System to use a system-assigned identity. + /// URL pointing to the Azure Key Vault secret. + /// Keeps track of any properties unknown to the library. + internal SecretKeyVaultProperties(string identity, Uri keyVaultUri, IDictionary serializedAdditionalRawData) + { + Identity = identity; + KeyVaultUri = keyVaultUri; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Resource ID of a managed identity to authenticate with Azure Key Vault, or System to use a system-assigned identity. + [WirePath("identity")] + public string Identity { get; set; } + /// URL pointing to the Azure Key Vault secret. + [WirePath("keyVaultUrl")] + public Uri KeyVaultUri { get; set; } + } +} diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/SessionContainer.Serialization.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/SessionContainer.Serialization.cs index 9a61e7d78697..687dc884677f 100644 --- a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/SessionContainer.Serialization.cs +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/SessionContainer.Serialization.cs @@ -81,6 +81,16 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WritePropertyName("resources"u8); writer.WriteObjectValue(Resources, options); } + if (Optional.IsCollectionDefined(Probes)) + { + writer.WritePropertyName("probes"u8); + writer.WriteStartArray(); + foreach (var item in Probes) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) @@ -124,6 +134,7 @@ internal static SessionContainer DeserializeSessionContainer(JsonElement element IList args = default; IList env = default; SessionContainerResources resources = default; + IList probes = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -189,6 +200,20 @@ internal static SessionContainer DeserializeSessionContainer(JsonElement element resources = SessionContainerResources.DeserializeSessionContainerResources(property.Value, options); continue; } + if (property.NameEquals("probes"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(SessionProbe.DeserializeSessionProbe(item, options)); + } + probes = array; + continue; + } if (options.Format != "W") { rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); @@ -202,6 +227,7 @@ internal static SessionContainer DeserializeSessionContainer(JsonElement element args ?? new ChangeTrackingList(), env ?? new ChangeTrackingList(), resources, + probes ?? new ChangeTrackingList(), serializedAdditionalRawData); } @@ -372,6 +398,29 @@ private BinaryData SerializeBicep(ModelReaderWriterOptions options) } } + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Probes), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" probes: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsCollectionDefined(Probes)) + { + if (Probes.Any()) + { + builder.Append(" probes: "); + builder.AppendLine("["); + foreach (var item in Probes) + { + BicepSerializationHelpers.AppendChildObject(builder, item, options, 4, true, " probes: "); + } + builder.AppendLine(" ]"); + } + } + } + builder.AppendLine("}"); return BinaryData.FromString(builder.ToString()); } diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/SessionContainer.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/SessionContainer.cs index 7b60375f0083..83e8a690848d 100644 --- a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/SessionContainer.cs +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/SessionContainer.cs @@ -51,6 +51,7 @@ public SessionContainer() Command = new ChangeTrackingList(); Args = new ChangeTrackingList(); Env = new ChangeTrackingList(); + Probes = new ChangeTrackingList(); } /// Initializes a new instance of . @@ -60,8 +61,9 @@ public SessionContainer() /// Container start command arguments. /// Container environment variables. /// Container resource requirements. + /// List of probes for the container. /// Keeps track of any properties unknown to the library. - internal SessionContainer(string image, string name, IList command, IList args, IList env, SessionContainerResources resources, IDictionary serializedAdditionalRawData) + internal SessionContainer(string image, string name, IList command, IList args, IList env, SessionContainerResources resources, IList probes, IDictionary serializedAdditionalRawData) { Image = image; Name = name; @@ -69,6 +71,7 @@ internal SessionContainer(string image, string name, IList command, ILis Args = args; Env = env; Resources = resources; + Probes = probes; _serializedAdditionalRawData = serializedAdditionalRawData; } @@ -90,5 +93,8 @@ internal SessionContainer(string image, string name, IList command, ILis /// Container resource requirements. [WirePath("resources")] public SessionContainerResources Resources { get; set; } + /// List of probes for the container. + [WirePath("probes")] + public IList Probes { get; } } } diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/SessionProbe.Serialization.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/SessionProbe.Serialization.cs new file mode 100644 index 000000000000..2548348cdeef --- /dev/null +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/SessionProbe.Serialization.cs @@ -0,0 +1,416 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.AppContainers.Models +{ + public partial class SessionProbe : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SessionProbe)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(ProbeType)) + { + writer.WritePropertyName("type"u8); + writer.WriteStringValue(ProbeType.Value.ToString()); + } + if (Optional.IsDefined(HttpGet)) + { + writer.WritePropertyName("httpGet"u8); + writer.WriteObjectValue(HttpGet, options); + } + if (Optional.IsDefined(TcpSocket)) + { + writer.WritePropertyName("tcpSocket"u8); + writer.WriteObjectValue(TcpSocket, options); + } + if (Optional.IsDefined(FailureThreshold)) + { + writer.WritePropertyName("failureThreshold"u8); + writer.WriteNumberValue(FailureThreshold.Value); + } + if (Optional.IsDefined(InitialDelaySeconds)) + { + writer.WritePropertyName("initialDelaySeconds"u8); + writer.WriteNumberValue(InitialDelaySeconds.Value); + } + if (Optional.IsDefined(PeriodSeconds)) + { + writer.WritePropertyName("periodSeconds"u8); + writer.WriteNumberValue(PeriodSeconds.Value); + } + if (Optional.IsDefined(SuccessThreshold)) + { + writer.WritePropertyName("successThreshold"u8); + writer.WriteNumberValue(SuccessThreshold.Value); + } + if (Optional.IsDefined(TerminationGracePeriodSeconds)) + { + writer.WritePropertyName("terminationGracePeriodSeconds"u8); + writer.WriteNumberValue(TerminationGracePeriodSeconds.Value); + } + if (Optional.IsDefined(TimeoutSeconds)) + { + writer.WritePropertyName("timeoutSeconds"u8); + writer.WriteNumberValue(TimeoutSeconds.Value); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + SessionProbe IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SessionProbe)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeSessionProbe(document.RootElement, options); + } + + internal static SessionProbe DeserializeSessionProbe(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + SessionProbeType? type = default; + SessionProbeHttpGet httpGet = default; + SessionProbeTcpSocket tcpSocket = default; + int? failureThreshold = default; + int? initialDelaySeconds = default; + int? periodSeconds = default; + int? successThreshold = default; + long? terminationGracePeriodSeconds = default; + int? timeoutSeconds = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("type"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + type = new SessionProbeType(property.Value.GetString()); + continue; + } + if (property.NameEquals("httpGet"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + httpGet = SessionProbeHttpGet.DeserializeSessionProbeHttpGet(property.Value, options); + continue; + } + if (property.NameEquals("tcpSocket"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + tcpSocket = SessionProbeTcpSocket.DeserializeSessionProbeTcpSocket(property.Value, options); + continue; + } + if (property.NameEquals("failureThreshold"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + failureThreshold = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("initialDelaySeconds"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + initialDelaySeconds = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("periodSeconds"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + periodSeconds = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("successThreshold"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + successThreshold = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("terminationGracePeriodSeconds"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + terminationGracePeriodSeconds = property.Value.GetInt64(); + continue; + } + if (property.NameEquals("timeoutSeconds"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + timeoutSeconds = property.Value.GetInt32(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new SessionProbe( + type, + httpGet, + tcpSocket, + failureThreshold, + initialDelaySeconds, + periodSeconds, + successThreshold, + terminationGracePeriodSeconds, + timeoutSeconds, + serializedAdditionalRawData); + } + + private BinaryData SerializeBicep(ModelReaderWriterOptions options) + { + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(ProbeType), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" type: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(ProbeType)) + { + builder.Append(" type: "); + builder.AppendLine($"'{ProbeType.Value.ToString()}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(HttpGet), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" httpGet: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(HttpGet)) + { + builder.Append(" httpGet: "); + BicepSerializationHelpers.AppendChildObject(builder, HttpGet, options, 2, false, " httpGet: "); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(TcpSocket), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" tcpSocket: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(TcpSocket)) + { + builder.Append(" tcpSocket: "); + BicepSerializationHelpers.AppendChildObject(builder, TcpSocket, options, 2, false, " tcpSocket: "); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(FailureThreshold), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" failureThreshold: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(FailureThreshold)) + { + builder.Append(" failureThreshold: "); + builder.AppendLine($"{FailureThreshold.Value}"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(InitialDelaySeconds), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" initialDelaySeconds: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(InitialDelaySeconds)) + { + builder.Append(" initialDelaySeconds: "); + builder.AppendLine($"{InitialDelaySeconds.Value}"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(PeriodSeconds), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" periodSeconds: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(PeriodSeconds)) + { + builder.Append(" periodSeconds: "); + builder.AppendLine($"{PeriodSeconds.Value}"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(SuccessThreshold), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" successThreshold: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(SuccessThreshold)) + { + builder.Append(" successThreshold: "); + builder.AppendLine($"{SuccessThreshold.Value}"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(TerminationGracePeriodSeconds), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" terminationGracePeriodSeconds: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(TerminationGracePeriodSeconds)) + { + builder.Append(" terminationGracePeriodSeconds: "); + builder.AppendLine($"'{TerminationGracePeriodSeconds.Value.ToString()}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(TimeoutSeconds), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" timeoutSeconds: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(TimeoutSeconds)) + { + builder.Append(" timeoutSeconds: "); + builder.AppendLine($"{TimeoutSeconds.Value}"); + } + } + + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerAppContainersContext.Default); + case "bicep": + return SerializeBicep(options); + default: + throw new FormatException($"The model {nameof(SessionProbe)} does not support writing '{options.Format}' format."); + } + } + + SessionProbe IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeSessionProbe(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(SessionProbe)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/SessionProbe.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/SessionProbe.cs new file mode 100644 index 000000000000..dc1b2eba3461 --- /dev/null +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/SessionProbe.cs @@ -0,0 +1,106 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.AppContainers.Models +{ + /// Session probe configuration. + public partial class SessionProbe + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public SessionProbe() + { + } + + /// Initializes a new instance of . + /// Denotes the type of probe. Can be Liveness or Startup, Readiness probe is not supported in sessions. Type must be unique for each probe within the context of a list of probes (SessionProbes). + /// HTTPGet specifies the http request to perform. + /// TCPSocket specifies an action involving a TCP port. TCP hooks not yet supported. + /// Minimum consecutive failures for the probe to be considered failed after having succeeded. Defaults to 3. Minimum value is 1. Maximum value is 10. + /// Number of seconds after the container has started before liveness probes are initiated. Minimum value is 1. Maximum value is 60. + /// How often (in seconds) to perform the probe. Default to 10 seconds. Minimum value is 1. Maximum value is 240. + /// Minimum consecutive successes for the probe to be considered successful after having failed. Defaults to 1. Must be 1 for liveness and startup. Minimum value is 1. Maximum value is 10. + /// Optional duration in seconds the pod needs to terminate gracefully upon probe failure. The grace period is the duration in seconds after the processes running in the pod are sent a termination signal and the time when the processes are forcibly halted with a kill signal. Set this value longer than the expected cleanup time for your process. If this value is nil, the pod's terminationGracePeriodSeconds will be used. Otherwise, this value overrides the value provided by the pod spec. Value must be non-negative integer. The value zero indicates stop immediately via the kill signal (no opportunity to shut down). This is an alpha field and requires enabling ProbeTerminationGracePeriod feature gate. Maximum value is 3600 seconds (1 hour). + /// Number of seconds after which the probe times out. Defaults to 1 second. Minimum value is 1. Maximum value is 240. + /// Keeps track of any properties unknown to the library. + internal SessionProbe(SessionProbeType? probeType, SessionProbeHttpGet httpGet, SessionProbeTcpSocket tcpSocket, int? failureThreshold, int? initialDelaySeconds, int? periodSeconds, int? successThreshold, long? terminationGracePeriodSeconds, int? timeoutSeconds, IDictionary serializedAdditionalRawData) + { + ProbeType = probeType; + HttpGet = httpGet; + TcpSocket = tcpSocket; + FailureThreshold = failureThreshold; + InitialDelaySeconds = initialDelaySeconds; + PeriodSeconds = periodSeconds; + SuccessThreshold = successThreshold; + TerminationGracePeriodSeconds = terminationGracePeriodSeconds; + TimeoutSeconds = timeoutSeconds; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Denotes the type of probe. Can be Liveness or Startup, Readiness probe is not supported in sessions. Type must be unique for each probe within the context of a list of probes (SessionProbes). + [WirePath("type")] + public SessionProbeType? ProbeType { get; set; } + /// HTTPGet specifies the http request to perform. + [WirePath("httpGet")] + public SessionProbeHttpGet HttpGet { get; set; } + /// TCPSocket specifies an action involving a TCP port. TCP hooks not yet supported. + [WirePath("tcpSocket")] + public SessionProbeTcpSocket TcpSocket { get; set; } + /// Minimum consecutive failures for the probe to be considered failed after having succeeded. Defaults to 3. Minimum value is 1. Maximum value is 10. + [WirePath("failureThreshold")] + public int? FailureThreshold { get; set; } + /// Number of seconds after the container has started before liveness probes are initiated. Minimum value is 1. Maximum value is 60. + [WirePath("initialDelaySeconds")] + public int? InitialDelaySeconds { get; set; } + /// How often (in seconds) to perform the probe. Default to 10 seconds. Minimum value is 1. Maximum value is 240. + [WirePath("periodSeconds")] + public int? PeriodSeconds { get; set; } + /// Minimum consecutive successes for the probe to be considered successful after having failed. Defaults to 1. Must be 1 for liveness and startup. Minimum value is 1. Maximum value is 10. + [WirePath("successThreshold")] + public int? SuccessThreshold { get; set; } + /// Optional duration in seconds the pod needs to terminate gracefully upon probe failure. The grace period is the duration in seconds after the processes running in the pod are sent a termination signal and the time when the processes are forcibly halted with a kill signal. Set this value longer than the expected cleanup time for your process. If this value is nil, the pod's terminationGracePeriodSeconds will be used. Otherwise, this value overrides the value provided by the pod spec. Value must be non-negative integer. The value zero indicates stop immediately via the kill signal (no opportunity to shut down). This is an alpha field and requires enabling ProbeTerminationGracePeriod feature gate. Maximum value is 3600 seconds (1 hour). + [WirePath("terminationGracePeriodSeconds")] + public long? TerminationGracePeriodSeconds { get; set; } + /// Number of seconds after which the probe times out. Defaults to 1 second. Minimum value is 1. Maximum value is 240. + [WirePath("timeoutSeconds")] + public int? TimeoutSeconds { get; set; } + } +} diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/SessionProbeHttpGet.Serialization.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/SessionProbeHttpGet.Serialization.cs new file mode 100644 index 000000000000..0d91e8f46af2 --- /dev/null +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/SessionProbeHttpGet.Serialization.cs @@ -0,0 +1,309 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.AppContainers.Models +{ + public partial class SessionProbeHttpGet : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SessionProbeHttpGet)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(Host)) + { + writer.WritePropertyName("host"u8); + writer.WriteStringValue(Host); + } + if (Optional.IsCollectionDefined(HttpHeaders)) + { + writer.WritePropertyName("httpHeaders"u8); + writer.WriteStartArray(); + foreach (var item in HttpHeaders) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(Path)) + { + writer.WritePropertyName("path"u8); + writer.WriteStringValue(Path); + } + writer.WritePropertyName("port"u8); + writer.WriteNumberValue(Port); + if (Optional.IsDefined(Scheme)) + { + writer.WritePropertyName("scheme"u8); + writer.WriteStringValue(Scheme.Value.ToString()); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + SessionProbeHttpGet IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SessionProbeHttpGet)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeSessionProbeHttpGet(document.RootElement, options); + } + + internal static SessionProbeHttpGet DeserializeSessionProbeHttpGet(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string host = default; + IList httpHeaders = default; + string path = default; + int port = default; + ContainerAppHttpScheme? scheme = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("host"u8)) + { + host = property.Value.GetString(); + continue; + } + if (property.NameEquals("httpHeaders"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(SessionProbeHttpGetHttpHeadersItem.DeserializeSessionProbeHttpGetHttpHeadersItem(item, options)); + } + httpHeaders = array; + continue; + } + if (property.NameEquals("path"u8)) + { + path = property.Value.GetString(); + continue; + } + if (property.NameEquals("port"u8)) + { + port = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("scheme"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + scheme = new ContainerAppHttpScheme(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new SessionProbeHttpGet( + host, + httpHeaders ?? new ChangeTrackingList(), + path, + port, + scheme, + serializedAdditionalRawData); + } + + private BinaryData SerializeBicep(ModelReaderWriterOptions options) + { + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Host), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" host: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Host)) + { + builder.Append(" host: "); + if (Host.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{Host}'''"); + } + else + { + builder.AppendLine($"'{Host}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(HttpHeaders), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" httpHeaders: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsCollectionDefined(HttpHeaders)) + { + if (HttpHeaders.Any()) + { + builder.Append(" httpHeaders: "); + builder.AppendLine("["); + foreach (var item in HttpHeaders) + { + BicepSerializationHelpers.AppendChildObject(builder, item, options, 4, true, " httpHeaders: "); + } + builder.AppendLine(" ]"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Path), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" path: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Path)) + { + builder.Append(" path: "); + if (Path.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{Path}'''"); + } + else + { + builder.AppendLine($"'{Path}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Port), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" port: "); + builder.AppendLine(propertyOverride); + } + else + { + builder.Append(" port: "); + builder.AppendLine($"{Port}"); + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Scheme), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" scheme: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Scheme)) + { + builder.Append(" scheme: "); + builder.AppendLine($"'{Scheme.Value.ToString()}'"); + } + } + + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerAppContainersContext.Default); + case "bicep": + return SerializeBicep(options); + default: + throw new FormatException($"The model {nameof(SessionProbeHttpGet)} does not support writing '{options.Format}' format."); + } + } + + SessionProbeHttpGet IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeSessionProbeHttpGet(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(SessionProbeHttpGet)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/SessionProbeHttpGet.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/SessionProbeHttpGet.cs new file mode 100644 index 000000000000..3f2944460794 --- /dev/null +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/SessionProbeHttpGet.cs @@ -0,0 +1,94 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.AppContainers.Models +{ + /// HTTPGet specifies the http request to perform. + public partial class SessionProbeHttpGet + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// Name or number of the port to access on the container. Number must be in the range 1 to 65535. Name must be an IANA_SVC_NAME. + public SessionProbeHttpGet(int port) + { + HttpHeaders = new ChangeTrackingList(); + Port = port; + } + + /// Initializes a new instance of . + /// Host name to connect to, defaults to the pod IP. You probably want to set "Host" in httpHeaders instead. + /// Custom headers to set in the request. HTTP allows repeated headers. + /// Path to access on the HTTP server. + /// Name or number of the port to access on the container. Number must be in the range 1 to 65535. Name must be an IANA_SVC_NAME. + /// Scheme to use for connecting to the host. Defaults to HTTP. + /// Keeps track of any properties unknown to the library. + internal SessionProbeHttpGet(string host, IList httpHeaders, string path, int port, ContainerAppHttpScheme? scheme, IDictionary serializedAdditionalRawData) + { + Host = host; + HttpHeaders = httpHeaders; + Path = path; + Port = port; + Scheme = scheme; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal SessionProbeHttpGet() + { + } + + /// Host name to connect to, defaults to the pod IP. You probably want to set "Host" in httpHeaders instead. + [WirePath("host")] + public string Host { get; set; } + /// Custom headers to set in the request. HTTP allows repeated headers. + [WirePath("httpHeaders")] + public IList HttpHeaders { get; } + /// Path to access on the HTTP server. + [WirePath("path")] + public string Path { get; set; } + /// Name or number of the port to access on the container. Number must be in the range 1 to 65535. Name must be an IANA_SVC_NAME. + [WirePath("port")] + public int Port { get; set; } + /// Scheme to use for connecting to the host. Defaults to HTTP. + [WirePath("scheme")] + public ContainerAppHttpScheme? Scheme { get; set; } + } +} diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/SessionProbeHttpGetHttpHeadersItem.Serialization.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/SessionProbeHttpGetHttpHeadersItem.Serialization.cs new file mode 100644 index 000000000000..4929559b4a4b --- /dev/null +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/SessionProbeHttpGetHttpHeadersItem.Serialization.cs @@ -0,0 +1,198 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.AppContainers.Models +{ + public partial class SessionProbeHttpGetHttpHeadersItem : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SessionProbeHttpGetHttpHeadersItem)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("name"u8); + writer.WriteStringValue(Name); + writer.WritePropertyName("value"u8); + writer.WriteStringValue(Value); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + SessionProbeHttpGetHttpHeadersItem IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SessionProbeHttpGetHttpHeadersItem)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeSessionProbeHttpGetHttpHeadersItem(document.RootElement, options); + } + + internal static SessionProbeHttpGetHttpHeadersItem DeserializeSessionProbeHttpGetHttpHeadersItem(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string name = default; + string value = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("value"u8)) + { + value = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new SessionProbeHttpGetHttpHeadersItem(name, value, serializedAdditionalRawData); + } + + private BinaryData SerializeBicep(ModelReaderWriterOptions options) + { + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Name), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" name: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Name)) + { + builder.Append(" name: "); + if (Name.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{Name}'''"); + } + else + { + builder.AppendLine($"'{Name}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Value), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" value: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Value)) + { + builder.Append(" value: "); + if (Value.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{Value}'''"); + } + else + { + builder.AppendLine($"'{Value}'"); + } + } + } + + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerAppContainersContext.Default); + case "bicep": + return SerializeBicep(options); + default: + throw new FormatException($"The model {nameof(SessionProbeHttpGetHttpHeadersItem)} does not support writing '{options.Format}' format."); + } + } + + SessionProbeHttpGetHttpHeadersItem IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeSessionProbeHttpGetHttpHeadersItem(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(SessionProbeHttpGetHttpHeadersItem)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/SessionProbeHttpGetHttpHeadersItem.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/SessionProbeHttpGetHttpHeadersItem.cs new file mode 100644 index 000000000000..c38b8bfb8f26 --- /dev/null +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/SessionProbeHttpGetHttpHeadersItem.cs @@ -0,0 +1,84 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.AppContainers.Models +{ + /// HTTPHeader describes a custom header to be used in HTTP probes. + public partial class SessionProbeHttpGetHttpHeadersItem + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The header field name. + /// The header field value. + /// or is null. + public SessionProbeHttpGetHttpHeadersItem(string name, string value) + { + Argument.AssertNotNull(name, nameof(name)); + Argument.AssertNotNull(value, nameof(value)); + + Name = name; + Value = value; + } + + /// Initializes a new instance of . + /// The header field name. + /// The header field value. + /// Keeps track of any properties unknown to the library. + internal SessionProbeHttpGetHttpHeadersItem(string name, string value, IDictionary serializedAdditionalRawData) + { + Name = name; + Value = value; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal SessionProbeHttpGetHttpHeadersItem() + { + } + + /// The header field name. + [WirePath("name")] + public string Name { get; set; } + /// The header field value. + [WirePath("value")] + public string Value { get; set; } + } +} diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/BlobStorageTokenStore.Serialization.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/SessionProbeTcpSocket.Serialization.cs similarity index 63% rename from sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/BlobStorageTokenStore.Serialization.cs rename to sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/SessionProbeTcpSocket.Serialization.cs index ce6097231265..110e72b68097 100644 --- a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/BlobStorageTokenStore.Serialization.cs +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/SessionProbeTcpSocket.Serialization.cs @@ -14,11 +14,11 @@ namespace Azure.ResourceManager.AppContainers.Models { - internal partial class BlobStorageTokenStore : IUtf8JsonSerializable, IJsonModel + public partial class SessionProbeTcpSocket : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); JsonModelWriteCore(writer, options); @@ -29,14 +29,19 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderW /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(BlobStorageTokenStore)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(SessionProbeTcpSocket)} does not support writing '{format}' format."); } - writer.WritePropertyName("sasUrlSettingName"u8); - writer.WriteStringValue(SasUrlSettingName); + if (Optional.IsDefined(Host)) + { + writer.WritePropertyName("host"u8); + writer.WriteStringValue(Host); + } + writer.WritePropertyName("port"u8); + writer.WriteNumberValue(Port); if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) @@ -54,19 +59,19 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - BlobStorageTokenStore IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + SessionProbeTcpSocket IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(BlobStorageTokenStore)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(SessionProbeTcpSocket)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeBlobStorageTokenStore(document.RootElement, options); + return DeserializeSessionProbeTcpSocket(document.RootElement, options); } - internal static BlobStorageTokenStore DeserializeBlobStorageTokenStore(JsonElement element, ModelReaderWriterOptions options = null) + internal static SessionProbeTcpSocket DeserializeSessionProbeTcpSocket(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -74,14 +79,20 @@ internal static BlobStorageTokenStore DeserializeBlobStorageTokenStore(JsonEleme { return null; } - string sasUrlSettingName = default; + string host = default; + int port = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("sasUrlSettingName"u8)) + if (property.NameEquals("host"u8)) { - sasUrlSettingName = property.Value.GetString(); + host = property.Value.GetString(); + continue; + } + if (property.NameEquals("port"u8)) + { + port = property.Value.GetInt32(); continue; } if (options.Format != "W") @@ -90,7 +101,7 @@ internal static BlobStorageTokenStore DeserializeBlobStorageTokenStore(JsonEleme } } serializedAdditionalRawData = rawDataDictionary; - return new BlobStorageTokenStore(sasUrlSettingName, serializedAdditionalRawData); + return new SessionProbeTcpSocket(host, port, serializedAdditionalRawData); } private BinaryData SerializeBicep(ModelReaderWriterOptions options) @@ -104,36 +115,48 @@ private BinaryData SerializeBicep(ModelReaderWriterOptions options) builder.AppendLine("{"); - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(SasUrlSettingName), out propertyOverride); + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Host), out propertyOverride); if (hasPropertyOverride) { - builder.Append(" sasUrlSettingName: "); + builder.Append(" host: "); builder.AppendLine(propertyOverride); } else { - if (Optional.IsDefined(SasUrlSettingName)) + if (Optional.IsDefined(Host)) { - builder.Append(" sasUrlSettingName: "); - if (SasUrlSettingName.Contains(Environment.NewLine)) + builder.Append(" host: "); + if (Host.Contains(Environment.NewLine)) { builder.AppendLine("'''"); - builder.AppendLine($"{SasUrlSettingName}'''"); + builder.AppendLine($"{Host}'''"); } else { - builder.AppendLine($"'{SasUrlSettingName}'"); + builder.AppendLine($"'{Host}'"); } } } + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Port), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" port: "); + builder.AppendLine(propertyOverride); + } + else + { + builder.Append(" port: "); + builder.AppendLine($"{Port}"); + } + builder.AppendLine("}"); return BinaryData.FromString(builder.ToString()); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { @@ -142,26 +165,26 @@ BinaryData IPersistableModel.Write(ModelReaderWriterOptio case "bicep": return SerializeBicep(options); default: - throw new FormatException($"The model {nameof(BlobStorageTokenStore)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(SessionProbeTcpSocket)} does not support writing '{options.Format}' format."); } } - BlobStorageTokenStore IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + SessionProbeTcpSocket IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeBlobStorageTokenStore(document.RootElement, options); + return DeserializeSessionProbeTcpSocket(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(BlobStorageTokenStore)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(SessionProbeTcpSocket)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/SessionProbeTcpSocket.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/SessionProbeTcpSocket.cs new file mode 100644 index 000000000000..6d4eebe76202 --- /dev/null +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/SessionProbeTcpSocket.cs @@ -0,0 +1,78 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.AppContainers.Models +{ + /// TCPSocket specifies an action involving a TCP port. TCP hooks not yet supported. + public partial class SessionProbeTcpSocket + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// Number or name of the port to access on the container. Number must be in the range 1 to 65535. Name must be an IANA_SVC_NAME. + public SessionProbeTcpSocket(int port) + { + Port = port; + } + + /// Initializes a new instance of . + /// Optional: Host name to connect to, defaults to the pod IP. + /// Number or name of the port to access on the container. Number must be in the range 1 to 65535. Name must be an IANA_SVC_NAME. + /// Keeps track of any properties unknown to the library. + internal SessionProbeTcpSocket(string host, int port, IDictionary serializedAdditionalRawData) + { + Host = host; + Port = port; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal SessionProbeTcpSocket() + { + } + + /// Optional: Host name to connect to, defaults to the pod IP. + [WirePath("host")] + public string Host { get; set; } + /// Number or name of the port to access on the container. Number must be in the range 1 to 65535. Name must be an IANA_SVC_NAME. + [WirePath("port")] + public int Port { get; set; } + } +} diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/SessionProbeType.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/SessionProbeType.cs new file mode 100644 index 000000000000..e37f608babd9 --- /dev/null +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/SessionProbeType.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.AppContainers.Models +{ + /// Denotes the type of probe. Can be Liveness or Startup, Readiness probe is not supported in sessions. Type must be unique for each probe within the context of a list of probes (SessionProbes). + public readonly partial struct SessionProbeType : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public SessionProbeType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string LivenessValue = "Liveness"; + private const string StartupValue = "Startup"; + + /// Liveness. + public static SessionProbeType Liveness { get; } = new SessionProbeType(LivenessValue); + /// Startup. + public static SessionProbeType Startup { get; } = new SessionProbeType(StartupValue); + /// Determines if two values are the same. + public static bool operator ==(SessionProbeType left, SessionProbeType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(SessionProbeType left, SessionProbeType right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator SessionProbeType(string value) => new SessionProbeType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is SessionProbeType other && Equals(other); + /// + public bool Equals(SessionProbeType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/SmbStorage.Serialization.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/SmbStorage.Serialization.cs new file mode 100644 index 000000000000..22920ead7d27 --- /dev/null +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/SmbStorage.Serialization.cs @@ -0,0 +1,343 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.AppContainers.Models +{ + public partial class SmbStorage : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SmbStorage)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(Host)) + { + writer.WritePropertyName("host"u8); + writer.WriteStringValue(Host); + } + if (Optional.IsDefined(ShareName)) + { + writer.WritePropertyName("shareName"u8); + writer.WriteStringValue(ShareName); + } + if (Optional.IsDefined(Username)) + { + writer.WritePropertyName("username"u8); + writer.WriteStringValue(Username); + } + if (Optional.IsDefined(Domain)) + { + writer.WritePropertyName("domain"u8); + writer.WriteStringValue(Domain); + } + if (Optional.IsDefined(Password)) + { + writer.WritePropertyName("password"u8); + writer.WriteStringValue(Password); + } + if (Optional.IsDefined(AccessMode)) + { + writer.WritePropertyName("accessMode"u8); + writer.WriteStringValue(AccessMode.Value.ToString()); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + SmbStorage IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SmbStorage)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeSmbStorage(document.RootElement, options); + } + + internal static SmbStorage DeserializeSmbStorage(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string host = default; + string shareName = default; + string username = default; + string domain = default; + string password = default; + ContainerAppAccessMode? accessMode = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("host"u8)) + { + host = property.Value.GetString(); + continue; + } + if (property.NameEquals("shareName"u8)) + { + shareName = property.Value.GetString(); + continue; + } + if (property.NameEquals("username"u8)) + { + username = property.Value.GetString(); + continue; + } + if (property.NameEquals("domain"u8)) + { + domain = property.Value.GetString(); + continue; + } + if (property.NameEquals("password"u8)) + { + password = property.Value.GetString(); + continue; + } + if (property.NameEquals("accessMode"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + accessMode = new ContainerAppAccessMode(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new SmbStorage( + host, + shareName, + username, + domain, + password, + accessMode, + serializedAdditionalRawData); + } + + private BinaryData SerializeBicep(ModelReaderWriterOptions options) + { + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Host), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" host: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Host)) + { + builder.Append(" host: "); + if (Host.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{Host}'''"); + } + else + { + builder.AppendLine($"'{Host}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(ShareName), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" shareName: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(ShareName)) + { + builder.Append(" shareName: "); + if (ShareName.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{ShareName}'''"); + } + else + { + builder.AppendLine($"'{ShareName}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Username), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" username: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Username)) + { + builder.Append(" username: "); + if (Username.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{Username}'''"); + } + else + { + builder.AppendLine($"'{Username}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Domain), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" domain: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Domain)) + { + builder.Append(" domain: "); + if (Domain.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{Domain}'''"); + } + else + { + builder.AppendLine($"'{Domain}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Password), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" password: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Password)) + { + builder.Append(" password: "); + if (Password.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{Password}'''"); + } + else + { + builder.AppendLine($"'{Password}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(AccessMode), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" accessMode: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(AccessMode)) + { + builder.Append(" accessMode: "); + builder.AppendLine($"'{AccessMode.Value.ToString()}'"); + } + } + + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerAppContainersContext.Default); + case "bicep": + return SerializeBicep(options); + default: + throw new FormatException($"The model {nameof(SmbStorage)} does not support writing '{options.Format}' format."); + } + } + + SmbStorage IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeSmbStorage(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(SmbStorage)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/SmbStorage.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/SmbStorage.cs new file mode 100644 index 000000000000..5f597aa90754 --- /dev/null +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/SmbStorage.cs @@ -0,0 +1,91 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.AppContainers.Models +{ + /// SMB storage properties. + public partial class SmbStorage + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public SmbStorage() + { + } + + /// Initializes a new instance of . + /// The host name or IP address of the SMB server. + /// The path to the SMB shared folder. + /// The user to log on to the SMB server. + /// The domain name for the user. + /// The password for the user. + /// Access mode for storage. + /// Keeps track of any properties unknown to the library. + internal SmbStorage(string host, string shareName, string username, string domain, string password, ContainerAppAccessMode? accessMode, IDictionary serializedAdditionalRawData) + { + Host = host; + ShareName = shareName; + Username = username; + Domain = domain; + Password = password; + AccessMode = accessMode; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The host name or IP address of the SMB server. + [WirePath("host")] + public string Host { get; set; } + /// The path to the SMB shared folder. + [WirePath("shareName")] + public string ShareName { get; set; } + /// The user to log on to the SMB server. + [WirePath("username")] + public string Username { get; set; } + /// The domain name for the user. + [WirePath("domain")] + public string Domain { get; set; } + /// The password for the user. + [WirePath("password")] + public string Password { get; set; } + /// Access mode for storage. + [WirePath("accessMode")] + public ContainerAppAccessMode? AccessMode { get; set; } + } +} diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/SpringCloudGatewayComponent.Serialization.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/SpringCloudGatewayComponent.Serialization.cs new file mode 100644 index 000000000000..e2d1885ce9b2 --- /dev/null +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/SpringCloudGatewayComponent.Serialization.cs @@ -0,0 +1,356 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.AppContainers.Models +{ + public partial class SpringCloudGatewayComponent : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SpringCloudGatewayComponent)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + if (Optional.IsDefined(Ingress)) + { + writer.WritePropertyName("ingress"u8); + writer.WriteObjectValue(Ingress, options); + } + if (Optional.IsCollectionDefined(SpringCloudGatewayRoutes)) + { + writer.WritePropertyName("springCloudGatewayRoutes"u8); + writer.WriteStartArray(); + foreach (var item in SpringCloudGatewayRoutes) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + } + + SpringCloudGatewayComponent IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SpringCloudGatewayComponent)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeSpringCloudGatewayComponent(document.RootElement, options); + } + + internal static SpringCloudGatewayComponent DeserializeSpringCloudGatewayComponent(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + JavaComponentIngress ingress = default; + IList springCloudGatewayRoutes = default; + JavaComponentType componentType = default; + JavaComponentProvisioningState? provisioningState = default; + IList configurations = default; + JavaComponentPropertiesScale scale = default; + IList serviceBinds = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("ingress"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + ingress = JavaComponentIngress.DeserializeJavaComponentIngress(property.Value, options); + continue; + } + if (property.NameEquals("springCloudGatewayRoutes"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(ScgRoute.DeserializeScgRoute(item, options)); + } + springCloudGatewayRoutes = array; + continue; + } + if (property.NameEquals("componentType"u8)) + { + componentType = new JavaComponentType(property.Value.GetString()); + continue; + } + if (property.NameEquals("provisioningState"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + provisioningState = new JavaComponentProvisioningState(property.Value.GetString()); + continue; + } + if (property.NameEquals("configurations"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(JavaComponentConfigurationProperty.DeserializeJavaComponentConfigurationProperty(item, options)); + } + configurations = array; + continue; + } + if (property.NameEquals("scale"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + scale = JavaComponentPropertiesScale.DeserializeJavaComponentPropertiesScale(property.Value, options); + continue; + } + if (property.NameEquals("serviceBinds"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(JavaComponentServiceBind.DeserializeJavaComponentServiceBind(item, options)); + } + serviceBinds = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new SpringCloudGatewayComponent( + componentType, + provisioningState, + configurations ?? new ChangeTrackingList(), + scale, + serviceBinds ?? new ChangeTrackingList(), + serializedAdditionalRawData, + ingress, + springCloudGatewayRoutes ?? new ChangeTrackingList()); + } + + private BinaryData SerializeBicep(ModelReaderWriterOptions options) + { + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue("IngressFqdn", out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" ingress: "); + builder.AppendLine("{"); + builder.Append(" fqdn: "); + builder.AppendLine(propertyOverride); + builder.AppendLine(" }"); + } + else + { + if (Optional.IsDefined(Ingress)) + { + builder.Append(" ingress: "); + BicepSerializationHelpers.AppendChildObject(builder, Ingress, options, 2, false, " ingress: "); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(SpringCloudGatewayRoutes), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" springCloudGatewayRoutes: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsCollectionDefined(SpringCloudGatewayRoutes)) + { + if (SpringCloudGatewayRoutes.Any()) + { + builder.Append(" springCloudGatewayRoutes: "); + builder.AppendLine("["); + foreach (var item in SpringCloudGatewayRoutes) + { + BicepSerializationHelpers.AppendChildObject(builder, item, options, 4, true, " springCloudGatewayRoutes: "); + } + builder.AppendLine(" ]"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(ComponentType), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" componentType: "); + builder.AppendLine(propertyOverride); + } + else + { + builder.Append(" componentType: "); + builder.AppendLine($"'{ComponentType.ToString()}'"); + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(ProvisioningState), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" provisioningState: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(ProvisioningState)) + { + builder.Append(" provisioningState: "); + builder.AppendLine($"'{ProvisioningState.Value.ToString()}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Configurations), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" configurations: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsCollectionDefined(Configurations)) + { + if (Configurations.Any()) + { + builder.Append(" configurations: "); + builder.AppendLine("["); + foreach (var item in Configurations) + { + BicepSerializationHelpers.AppendChildObject(builder, item, options, 4, true, " configurations: "); + } + builder.AppendLine(" ]"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Scale), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" scale: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Scale)) + { + builder.Append(" scale: "); + BicepSerializationHelpers.AppendChildObject(builder, Scale, options, 2, false, " scale: "); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(ServiceBinds), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" serviceBinds: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsCollectionDefined(ServiceBinds)) + { + if (ServiceBinds.Any()) + { + builder.Append(" serviceBinds: "); + builder.AppendLine("["); + foreach (var item in ServiceBinds) + { + BicepSerializationHelpers.AppendChildObject(builder, item, options, 4, true, " serviceBinds: "); + } + builder.AppendLine(" ]"); + } + } + } + + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerAppContainersContext.Default); + case "bicep": + return SerializeBicep(options); + default: + throw new FormatException($"The model {nameof(SpringCloudGatewayComponent)} does not support writing '{options.Format}' format."); + } + } + + SpringCloudGatewayComponent IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeSpringCloudGatewayComponent(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(SpringCloudGatewayComponent)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/SpringCloudGatewayComponent.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/SpringCloudGatewayComponent.cs new file mode 100644 index 000000000000..02ecbd222ca9 --- /dev/null +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/SpringCloudGatewayComponent.cs @@ -0,0 +1,52 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.AppContainers.Models +{ + /// Spring Cloud Gateway properties. + public partial class SpringCloudGatewayComponent : JavaComponentProperties + { + /// Initializes a new instance of . + public SpringCloudGatewayComponent() + { + SpringCloudGatewayRoutes = new ChangeTrackingList(); + ComponentType = JavaComponentType.SpringCloudGateway; + } + + /// Initializes a new instance of . + /// Type of the Java Component. + /// Provisioning state of the Java Component. + /// List of Java Components configuration properties. + /// Java component scaling configurations. + /// List of Java Components that are bound to the Java component. + /// Keeps track of any properties unknown to the library. + /// Java Component Ingress configurations. + /// Gateway route definition. + internal SpringCloudGatewayComponent(JavaComponentType componentType, JavaComponentProvisioningState? provisioningState, IList configurations, JavaComponentPropertiesScale scale, IList serviceBinds, IDictionary serializedAdditionalRawData, JavaComponentIngress ingress, IList springCloudGatewayRoutes) : base(componentType, provisioningState, configurations, scale, serviceBinds, serializedAdditionalRawData) + { + Ingress = ingress; + SpringCloudGatewayRoutes = springCloudGatewayRoutes; + ComponentType = componentType; + } + + /// Java Component Ingress configurations. + internal JavaComponentIngress Ingress { get; set; } + /// Hostname of the Java Component endpoint. + [WirePath("ingress.fqdn")] + public string IngressFqdn + { + get => Ingress is null ? default : Ingress.Fqdn; + } + + /// Gateway route definition. + [WirePath("springCloudGatewayRoutes")] + public IList SpringCloudGatewayRoutes { get; } + } +} diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/Runtime.Serialization.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/TcpConnectionPool.Serialization.cs similarity index 65% rename from sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/Runtime.Serialization.cs rename to sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/TcpConnectionPool.Serialization.cs index 04d1be182ecc..86a277f0b51a 100644 --- a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/Runtime.Serialization.cs +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/TcpConnectionPool.Serialization.cs @@ -14,11 +14,11 @@ namespace Azure.ResourceManager.AppContainers.Models { - internal partial class Runtime : IUtf8JsonSerializable, IJsonModel + internal partial class TcpConnectionPool : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); JsonModelWriteCore(writer, options); @@ -29,16 +29,16 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions o /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(Runtime)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(TcpConnectionPool)} does not support writing '{format}' format."); } - if (Optional.IsDefined(Java)) + if (Optional.IsDefined(MaxConnections)) { - writer.WritePropertyName("java"u8); - writer.WriteObjectValue(Java, options); + writer.WritePropertyName("maxConnections"u8); + writer.WriteNumberValue(MaxConnections.Value); } if (options.Format != "W" && _serializedAdditionalRawData != null) { @@ -57,19 +57,19 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - Runtime IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + TcpConnectionPool IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(Runtime)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(TcpConnectionPool)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeRuntime(document.RootElement, options); + return DeserializeTcpConnectionPool(document.RootElement, options); } - internal static Runtime DeserializeRuntime(JsonElement element, ModelReaderWriterOptions options = null) + internal static TcpConnectionPool DeserializeTcpConnectionPool(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -77,18 +77,18 @@ internal static Runtime DeserializeRuntime(JsonElement element, ModelReaderWrite { return null; } - RuntimeJava java = default; + int? maxConnections = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("java"u8)) + if (property.NameEquals("maxConnections"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) { continue; } - java = RuntimeJava.DeserializeRuntimeJava(property.Value, options); + maxConnections = property.Value.GetInt32(); continue; } if (options.Format != "W") @@ -97,7 +97,7 @@ internal static Runtime DeserializeRuntime(JsonElement element, ModelReaderWrite } } serializedAdditionalRawData = rawDataDictionary; - return new Runtime(java, serializedAdditionalRawData); + return new TcpConnectionPool(maxConnections, serializedAdditionalRawData); } private BinaryData SerializeBicep(ModelReaderWriterOptions options) @@ -111,21 +111,18 @@ private BinaryData SerializeBicep(ModelReaderWriterOptions options) builder.AppendLine("{"); - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue("EnableMetrics", out propertyOverride); + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(MaxConnections), out propertyOverride); if (hasPropertyOverride) { - builder.Append(" java: "); - builder.AppendLine("{"); - builder.Append(" enableMetrics: "); + builder.Append(" maxConnections: "); builder.AppendLine(propertyOverride); - builder.AppendLine(" }"); } else { - if (Optional.IsDefined(Java)) + if (Optional.IsDefined(MaxConnections)) { - builder.Append(" java: "); - BicepSerializationHelpers.AppendChildObject(builder, Java, options, 2, false, " java: "); + builder.Append(" maxConnections: "); + builder.AppendLine($"{MaxConnections.Value}"); } } @@ -133,9 +130,9 @@ private BinaryData SerializeBicep(ModelReaderWriterOptions options) return BinaryData.FromString(builder.ToString()); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { @@ -144,26 +141,26 @@ BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) case "bicep": return SerializeBicep(options); default: - throw new FormatException($"The model {nameof(Runtime)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(TcpConnectionPool)} does not support writing '{options.Format}' format."); } } - Runtime IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + TcpConnectionPool IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeRuntime(document.RootElement, options); + return DeserializeTcpConnectionPool(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(Runtime)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(TcpConnectionPool)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/TcpConnectionPool.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/TcpConnectionPool.cs new file mode 100644 index 000000000000..a4d477857c84 --- /dev/null +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/TcpConnectionPool.cs @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.AppContainers.Models +{ + /// Defines parameters for tcp connection pooling. + internal partial class TcpConnectionPool + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public TcpConnectionPool() + { + } + + /// Initializes a new instance of . + /// Maximum number of tcp connections allowed. + /// Keeps track of any properties unknown to the library. + internal TcpConnectionPool(int? maxConnections, IDictionary serializedAdditionalRawData) + { + MaxConnections = maxConnections; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Maximum number of tcp connections allowed. + [WirePath("maxConnections")] + public int? MaxConnections { get; set; } + } +} diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/TcpRetryPolicy.Serialization.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/TcpRetryPolicy.Serialization.cs new file mode 100644 index 000000000000..f2c6ac8de5a4 --- /dev/null +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/TcpRetryPolicy.Serialization.cs @@ -0,0 +1,166 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.AppContainers.Models +{ + internal partial class TcpRetryPolicy : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(TcpRetryPolicy)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(MaxConnectAttempts)) + { + writer.WritePropertyName("maxConnectAttempts"u8); + writer.WriteNumberValue(MaxConnectAttempts.Value); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + TcpRetryPolicy IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(TcpRetryPolicy)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeTcpRetryPolicy(document.RootElement, options); + } + + internal static TcpRetryPolicy DeserializeTcpRetryPolicy(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + int? maxConnectAttempts = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("maxConnectAttempts"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + maxConnectAttempts = property.Value.GetInt32(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new TcpRetryPolicy(maxConnectAttempts, serializedAdditionalRawData); + } + + private BinaryData SerializeBicep(ModelReaderWriterOptions options) + { + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(MaxConnectAttempts), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" maxConnectAttempts: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(MaxConnectAttempts)) + { + builder.Append(" maxConnectAttempts: "); + builder.AppendLine($"{MaxConnectAttempts.Value}"); + } + } + + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerAppContainersContext.Default); + case "bicep": + return SerializeBicep(options); + default: + throw new FormatException($"The model {nameof(TcpRetryPolicy)} does not support writing '{options.Format}' format."); + } + } + + TcpRetryPolicy IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeTcpRetryPolicy(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(TcpRetryPolicy)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/TcpRetryPolicy.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/TcpRetryPolicy.cs new file mode 100644 index 000000000000..d6151534e601 --- /dev/null +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/TcpRetryPolicy.cs @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.AppContainers.Models +{ + /// Policy that defines tcp request retry conditions. + internal partial class TcpRetryPolicy + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public TcpRetryPolicy() + { + } + + /// Initializes a new instance of . + /// Maximum number of attempts to connect to the tcp service. + /// Keeps track of any properties unknown to the library. + internal TcpRetryPolicy(int? maxConnectAttempts, IDictionary serializedAdditionalRawData) + { + MaxConnectAttempts = maxConnectAttempts; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Maximum number of attempts to connect to the tcp service. + [WirePath("maxConnectAttempts")] + public int? MaxConnectAttempts { get; set; } + } +} diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/TracesConfiguration.Serialization.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/TracesConfiguration.Serialization.cs new file mode 100644 index 000000000000..84d9cc07f19b --- /dev/null +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/TracesConfiguration.Serialization.cs @@ -0,0 +1,229 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.AppContainers.Models +{ + public partial class TracesConfiguration : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(TracesConfiguration)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(IncludeDapr)) + { + writer.WritePropertyName("includeDapr"u8); + writer.WriteBooleanValue(IncludeDapr.Value); + } + if (Optional.IsCollectionDefined(Destinations)) + { + writer.WritePropertyName("destinations"u8); + writer.WriteStartArray(); + foreach (var item in Destinations) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + TracesConfiguration IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(TracesConfiguration)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeTracesConfiguration(document.RootElement, options); + } + + internal static TracesConfiguration DeserializeTracesConfiguration(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + bool? includeDapr = default; + IList destinations = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("includeDapr"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + includeDapr = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("destinations"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + destinations = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new TracesConfiguration(includeDapr, destinations ?? new ChangeTrackingList(), serializedAdditionalRawData); + } + + private BinaryData SerializeBicep(ModelReaderWriterOptions options) + { + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(IncludeDapr), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" includeDapr: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(IncludeDapr)) + { + builder.Append(" includeDapr: "); + var boolValue = IncludeDapr.Value == true ? "true" : "false"; + builder.AppendLine($"{boolValue}"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Destinations), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" destinations: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsCollectionDefined(Destinations)) + { + if (Destinations.Any()) + { + builder.Append(" destinations: "); + builder.AppendLine("["); + foreach (var item in Destinations) + { + if (item == null) + { + builder.Append("null"); + continue; + } + if (item.Contains(Environment.NewLine)) + { + builder.AppendLine(" '''"); + builder.AppendLine($"{item}'''"); + } + else + { + builder.AppendLine($" '{item}'"); + } + } + builder.AppendLine(" ]"); + } + } + } + + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerAppContainersContext.Default); + case "bicep": + return SerializeBicep(options); + default: + throw new FormatException($"The model {nameof(TracesConfiguration)} does not support writing '{options.Format}' format."); + } + } + + TracesConfiguration IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeTracesConfiguration(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(TracesConfiguration)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/TracesConfiguration.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/TracesConfiguration.cs new file mode 100644 index 000000000000..11109e680256 --- /dev/null +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/TracesConfiguration.cs @@ -0,0 +1,72 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.AppContainers.Models +{ + /// Configuration of Open Telemetry traces. + public partial class TracesConfiguration + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public TracesConfiguration() + { + Destinations = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// Boolean indicating if including dapr traces. + /// Open telemetry traces destinations. + /// Keeps track of any properties unknown to the library. + internal TracesConfiguration(bool? includeDapr, IList destinations, IDictionary serializedAdditionalRawData) + { + IncludeDapr = includeDapr; + Destinations = destinations; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Boolean indicating if including dapr traces. + [WirePath("includeDapr")] + public bool? IncludeDapr { get; set; } + /// Open telemetry traces destinations. + [WirePath("destinations")] + public IList Destinations { get; } + } +} diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/WorkflowEnvelopeCollection.Serialization.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/WorkflowEnvelopeCollection.Serialization.cs new file mode 100644 index 000000000000..544a9d4c9d40 --- /dev/null +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/WorkflowEnvelopeCollection.Serialization.cs @@ -0,0 +1,212 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.AppContainers.Models +{ + internal partial class WorkflowEnvelopeCollection : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(WorkflowEnvelopeCollection)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("value"u8); + writer.WriteStartArray(); + foreach (var item in Value) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + if (options.Format != "W" && Optional.IsDefined(NextLink)) + { + writer.WritePropertyName("nextLink"u8); + writer.WriteStringValue(NextLink); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + WorkflowEnvelopeCollection IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(WorkflowEnvelopeCollection)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeWorkflowEnvelopeCollection(document.RootElement, options); + } + + internal static WorkflowEnvelopeCollection DeserializeWorkflowEnvelopeCollection(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IReadOnlyList value = default; + string nextLink = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(WorkflowEnvelopeData.DeserializeWorkflowEnvelopeData(item, options)); + } + value = array; + continue; + } + if (property.NameEquals("nextLink"u8)) + { + nextLink = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new WorkflowEnvelopeCollection(value, nextLink, serializedAdditionalRawData); + } + + private BinaryData SerializeBicep(ModelReaderWriterOptions options) + { + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Value), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" value: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsCollectionDefined(Value)) + { + if (Value.Any()) + { + builder.Append(" value: "); + builder.AppendLine("["); + foreach (var item in Value) + { + BicepSerializationHelpers.AppendChildObject(builder, item, options, 4, true, " value: "); + } + builder.AppendLine(" ]"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(NextLink), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" nextLink: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(NextLink)) + { + builder.Append(" nextLink: "); + if (NextLink.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{NextLink}'''"); + } + else + { + builder.AppendLine($"'{NextLink}'"); + } + } + } + + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerAppContainersContext.Default); + case "bicep": + return SerializeBicep(options); + default: + throw new FormatException($"The model {nameof(WorkflowEnvelopeCollection)} does not support writing '{options.Format}' format."); + } + } + + WorkflowEnvelopeCollection IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeWorkflowEnvelopeCollection(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(WorkflowEnvelopeCollection)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/WorkflowEnvelopeCollection.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/WorkflowEnvelopeCollection.cs new file mode 100644 index 000000000000..b40cc2bee6f7 --- /dev/null +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/Models/WorkflowEnvelopeCollection.cs @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.ResourceManager.AppContainers.Models +{ + /// Collection of workflow information elements. + internal partial class WorkflowEnvelopeCollection + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// Collection of resources. + /// is null. + internal WorkflowEnvelopeCollection(IEnumerable value) + { + Argument.AssertNotNull(value, nameof(value)); + + Value = value.ToList(); + } + + /// Initializes a new instance of . + /// Collection of resources. + /// Link to next page of resources. + /// Keeps track of any properties unknown to the library. + internal WorkflowEnvelopeCollection(IReadOnlyList value, string nextLink, IDictionary serializedAdditionalRawData) + { + Value = value; + NextLink = nextLink; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal WorkflowEnvelopeCollection() + { + } + + /// Collection of resources. + public IReadOnlyList Value { get; } + /// Link to next page of resources. + public string NextLink { get; } + } +} diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/RestOperations/AppResiliencyRestOperations.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/RestOperations/AppResiliencyRestOperations.cs new file mode 100644 index 000000000000..c9fa240e6cdb --- /dev/null +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/RestOperations/AppResiliencyRestOperations.cs @@ -0,0 +1,631 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.AppContainers.Models; + +namespace Azure.ResourceManager.AppContainers +{ + internal partial class AppResiliencyRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of AppResiliencyRestOperations. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// The application id to use for user agent. + /// server parameter. + /// Api Version. + /// or is null. + public AppResiliencyRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) + { + _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); + _endpoint = endpoint ?? new Uri("https://management.azure.com"); + _apiVersion = apiVersion ?? "2025-02-02-preview"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal RequestUriBuilder CreateCreateOrUpdateRequestUri(string subscriptionId, string resourceGroupName, string appName, string name, AppResiliencyData data) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.App/containerApps/", false); + uri.AppendPath(appName, true); + uri.AppendPath("/resiliencyPolicies/", false); + uri.AppendPath(name, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateCreateOrUpdateRequest(string subscriptionId, string resourceGroupName, string appName, string name, AppResiliencyData data) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Put; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.App/containerApps/", false); + uri.AppendPath(appName, true); + uri.AppendPath("/resiliencyPolicies/", false); + uri.AppendPath(name, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(data, ModelSerializationExtensions.WireOptions); + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// Create or update container app resiliency policy. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the Container App. + /// Name of the resiliency policy. + /// The resiliency policy to create or update. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task> CreateOrUpdateAsync(string subscriptionId, string resourceGroupName, string appName, string name, AppResiliencyData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(appName, nameof(appName)); + Argument.AssertNotNullOrEmpty(name, nameof(name)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, appName, name, data); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 201: + { + AppResiliencyData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = AppResiliencyData.DeserializeAppResiliencyData(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Create or update container app resiliency policy. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the Container App. + /// Name of the resiliency policy. + /// The resiliency policy to create or update. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response CreateOrUpdate(string subscriptionId, string resourceGroupName, string appName, string name, AppResiliencyData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(appName, nameof(appName)); + Argument.AssertNotNullOrEmpty(name, nameof(name)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, appName, name, data); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 201: + { + AppResiliencyData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = AppResiliencyData.DeserializeAppResiliencyData(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateUpdateRequestUri(string subscriptionId, string resourceGroupName, string appName, string name, AppResiliencyData data) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.App/containerApps/", false); + uri.AppendPath(appName, true); + uri.AppendPath("/resiliencyPolicies/", false); + uri.AppendPath(name, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceGroupName, string appName, string name, AppResiliencyData data) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Patch; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.App/containerApps/", false); + uri.AppendPath(appName, true); + uri.AppendPath("/resiliencyPolicies/", false); + uri.AppendPath(name, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(data, ModelSerializationExtensions.WireOptions); + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// Update container app resiliency policy. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the Container App. + /// Name of the resiliency policy. + /// The resiliency policy to update. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task> UpdateAsync(string subscriptionId, string resourceGroupName, string appName, string name, AppResiliencyData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(appName, nameof(appName)); + Argument.AssertNotNullOrEmpty(name, nameof(name)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, appName, name, data); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + AppResiliencyData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = AppResiliencyData.DeserializeAppResiliencyData(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Update container app resiliency policy. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the Container App. + /// Name of the resiliency policy. + /// The resiliency policy to update. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response Update(string subscriptionId, string resourceGroupName, string appName, string name, AppResiliencyData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(appName, nameof(appName)); + Argument.AssertNotNullOrEmpty(name, nameof(name)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, appName, name, data); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + AppResiliencyData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = AppResiliencyData.DeserializeAppResiliencyData(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string resourceGroupName, string appName, string name) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.App/containerApps/", false); + uri.AppendPath(appName, true); + uri.AppendPath("/resiliencyPolicies/", false); + uri.AppendPath(name, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string appName, string name) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Delete; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.App/containerApps/", false); + uri.AppendPath(appName, true); + uri.AppendPath("/resiliencyPolicies/", false); + uri.AppendPath(name, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Delete container app resiliency policy. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the Container App. + /// Name of the resiliency policy. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task DeleteAsync(string subscriptionId, string resourceGroupName, string appName, string name, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(appName, nameof(appName)); + Argument.AssertNotNullOrEmpty(name, nameof(name)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, appName, name); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Delete container app resiliency policy. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the Container App. + /// Name of the resiliency policy. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response Delete(string subscriptionId, string resourceGroupName, string appName, string name, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(appName, nameof(appName)); + Argument.AssertNotNullOrEmpty(name, nameof(name)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, appName, name); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string appName, string name) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.App/containerApps/", false); + uri.AppendPath(appName, true); + uri.AppendPath("/resiliencyPolicies/", false); + uri.AppendPath(name, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string appName, string name) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.App/containerApps/", false); + uri.AppendPath(appName, true); + uri.AppendPath("/resiliencyPolicies/", false); + uri.AppendPath(name, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Get container app resiliency policy. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the Container App. + /// Name of the resiliency policy. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task> GetAsync(string subscriptionId, string resourceGroupName, string appName, string name, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(appName, nameof(appName)); + Argument.AssertNotNullOrEmpty(name, nameof(name)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, appName, name); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + AppResiliencyData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = AppResiliencyData.DeserializeAppResiliencyData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((AppResiliencyData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + /// Get container app resiliency policy. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the Container App. + /// Name of the resiliency policy. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response Get(string subscriptionId, string resourceGroupName, string appName, string name, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(appName, nameof(appName)); + Argument.AssertNotNullOrEmpty(name, nameof(name)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, appName, name); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + AppResiliencyData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = AppResiliencyData.DeserializeAppResiliencyData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((AppResiliencyData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListRequestUri(string subscriptionId, string resourceGroupName, string appName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.App/containerApps/", false); + uri.AppendPath(appName, true); + uri.AppendPath("/resiliencyPolicies", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateListRequest(string subscriptionId, string resourceGroupName, string appName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.App/containerApps/", false); + uri.AppendPath(appName, true); + uri.AppendPath("/resiliencyPolicies", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List container app resiliency policies. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the Container App. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> ListAsync(string subscriptionId, string resourceGroupName, string appName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(appName, nameof(appName)); + + using var message = CreateListRequest(subscriptionId, resourceGroupName, appName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + Models.AppResiliencyCollection value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = Models.AppResiliencyCollection.DeserializeAppResiliencyCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List container app resiliency policies. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the Container App. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response List(string subscriptionId, string resourceGroupName, string appName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(appName, nameof(appName)); + + using var message = CreateListRequest(subscriptionId, resourceGroupName, appName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + Models.AppResiliencyCollection value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = Models.AppResiliencyCollection.DeserializeAppResiliencyCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName, string appName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + return uri; + } + + internal HttpMessage CreateListNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string appName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List container app resiliency policies. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the Container App. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> ListNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string appName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(appName, nameof(appName)); + + using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, appName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + Models.AppResiliencyCollection value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = Models.AppResiliencyCollection.DeserializeAppResiliencyCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List container app resiliency policies. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the Container App. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response ListNextPage(string nextLink, string subscriptionId, string resourceGroupName, string appName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(appName, nameof(appName)); + + using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, appName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + Models.AppResiliencyCollection value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = Models.AppResiliencyCollection.DeserializeAppResiliencyCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/RestOperations/AvailableWorkloadProfilesRestOperations.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/RestOperations/AvailableWorkloadProfilesRestOperations.cs index ff9cac36819a..d7114b22b77c 100644 --- a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/RestOperations/AvailableWorkloadProfilesRestOperations.cs +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/RestOperations/AvailableWorkloadProfilesRestOperations.cs @@ -32,7 +32,7 @@ public AvailableWorkloadProfilesRestOperations(HttpPipeline pipeline, string app { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2025-01-01"; + _apiVersion = apiVersion ?? "2025-02-02-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } @@ -69,7 +69,7 @@ internal HttpMessage CreateGetRequest(string subscriptionId, AzureLocation locat } /// Get all available workload profiles for a location. - /// The ID of the target subscription. + /// The ID of the target subscription. The value must be an UUID. /// The name of Azure region. /// The cancellation token to use. /// is null. @@ -95,7 +95,7 @@ public async Task> GetAsync(string } /// Get all available workload profiles for a location. - /// The ID of the target subscription. + /// The ID of the target subscription. The value must be an UUID. /// The name of Azure region. /// The cancellation token to use. /// is null. @@ -144,7 +144,7 @@ internal HttpMessage CreateGetNextPageRequest(string nextLink, string subscripti /// Get all available workload profiles for a location. /// The URL to the next page of results. - /// The ID of the target subscription. + /// The ID of the target subscription. The value must be an UUID. /// The name of Azure region. /// The cancellation token to use. /// or is null. @@ -172,7 +172,7 @@ public async Task> GetNextPageAsyn /// Get all available workload profiles for a location. /// The URL to the next page of results. - /// The ID of the target subscription. + /// The ID of the target subscription. The value must be an UUID. /// The name of Azure region. /// The cancellation token to use. /// or is null. diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/RestOperations/BillingMetersRestOperations.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/RestOperations/BillingMetersRestOperations.cs index 733b76fb2e9d..2f461d034e85 100644 --- a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/RestOperations/BillingMetersRestOperations.cs +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/RestOperations/BillingMetersRestOperations.cs @@ -32,7 +32,7 @@ public BillingMetersRestOperations(HttpPipeline pipeline, string applicationId, { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2025-01-01"; + _apiVersion = apiVersion ?? "2025-02-02-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } @@ -69,7 +69,7 @@ internal HttpMessage CreateGetRequest(string subscriptionId, AzureLocation locat } /// Get all billingMeters for a location. - /// The ID of the target subscription. + /// The ID of the target subscription. The value must be an UUID. /// The name of Azure region. /// The cancellation token to use. /// is null. @@ -95,7 +95,7 @@ public async Task> GetAsync(string subscription } /// Get all billingMeters for a location. - /// The ID of the target subscription. + /// The ID of the target subscription. The value must be an UUID. /// The name of Azure region. /// The cancellation token to use. /// is null. diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/RestOperations/BuildAuthTokenRestOperations.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/RestOperations/BuildAuthTokenRestOperations.cs new file mode 100644 index 000000000000..a76c629cf69c --- /dev/null +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/RestOperations/BuildAuthTokenRestOperations.cs @@ -0,0 +1,141 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.AppContainers.Models; + +namespace Azure.ResourceManager.AppContainers +{ + internal partial class BuildAuthTokenRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of BuildAuthTokenRestOperations. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// The application id to use for user agent. + /// server parameter. + /// Api Version. + /// or is null. + public BuildAuthTokenRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) + { + _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); + _endpoint = endpoint ?? new Uri("https://management.azure.com"); + _apiVersion = apiVersion ?? "2025-02-02-preview"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal RequestUriBuilder CreateListRequestUri(string subscriptionId, string resourceGroupName, string builderName, string buildName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.App/builders/", false); + uri.AppendPath(builderName, true); + uri.AppendPath("/builds/", false); + uri.AppendPath(buildName, true); + uri.AppendPath("/listAuthToken", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateListRequest(string subscriptionId, string resourceGroupName, string builderName, string buildName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.App/builders/", false); + uri.AppendPath(builderName, true); + uri.AppendPath("/builds/", false); + uri.AppendPath(buildName, true); + uri.AppendPath("/listAuthToken", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Gets the token used to connect to the endpoint where source code can be uploaded for a build. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the builder. + /// The name of a build. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task> ListAsync(string subscriptionId, string resourceGroupName, string builderName, string buildName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(builderName, nameof(builderName)); + Argument.AssertNotNullOrEmpty(buildName, nameof(buildName)); + + using var message = CreateListRequest(subscriptionId, resourceGroupName, builderName, buildName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + ContainerAppBuildToken value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = ContainerAppBuildToken.DeserializeContainerAppBuildToken(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Gets the token used to connect to the endpoint where source code can be uploaded for a build. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the builder. + /// The name of a build. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response List(string subscriptionId, string resourceGroupName, string builderName, string buildName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(builderName, nameof(builderName)); + Argument.AssertNotNullOrEmpty(buildName, nameof(buildName)); + + using var message = CreateListRequest(subscriptionId, resourceGroupName, builderName, buildName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + ContainerAppBuildToken value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = ContainerAppBuildToken.DeserializeContainerAppBuildToken(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/RestOperations/BuildersRestOperations.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/RestOperations/BuildersRestOperations.cs new file mode 100644 index 000000000000..9a390fde2f14 --- /dev/null +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/RestOperations/BuildersRestOperations.cs @@ -0,0 +1,723 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.AppContainers.Models; + +namespace Azure.ResourceManager.AppContainers +{ + internal partial class BuildersRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of BuildersRestOperations. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// The application id to use for user agent. + /// server parameter. + /// Api Version. + /// or is null. + public BuildersRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) + { + _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); + _endpoint = endpoint ?? new Uri("https://management.azure.com"); + _apiVersion = apiVersion ?? "2025-02-02-preview"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal RequestUriBuilder CreateListBySubscriptionRequestUri(string subscriptionId) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/providers/Microsoft.App/builders", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateListBySubscriptionRequest(string subscriptionId) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/providers/Microsoft.App/builders", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List BuilderResource resources by subscription ID. + /// The ID of the target subscription. The value must be an UUID. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + public async Task> ListBySubscriptionAsync(string subscriptionId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + + using var message = CreateListBySubscriptionRequest(subscriptionId); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + BuilderCollection value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = BuilderCollection.DeserializeBuilderCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List BuilderResource resources by subscription ID. + /// The ID of the target subscription. The value must be an UUID. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + public Response ListBySubscription(string subscriptionId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + + using var message = CreateListBySubscriptionRequest(subscriptionId); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + BuilderCollection value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = BuilderCollection.DeserializeBuilderCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListByResourceGroupRequestUri(string subscriptionId, string resourceGroupName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.App/builders", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateListByResourceGroupRequest(string subscriptionId, string resourceGroupName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.App/builders", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List BuilderResource resources by resource group. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + public async Task> ListByResourceGroupAsync(string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + + using var message = CreateListByResourceGroupRequest(subscriptionId, resourceGroupName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + BuilderCollection value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = BuilderCollection.DeserializeBuilderCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List BuilderResource resources by resource group. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + public Response ListByResourceGroup(string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + + using var message = CreateListByResourceGroupRequest(subscriptionId, resourceGroupName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + BuilderCollection value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = BuilderCollection.DeserializeBuilderCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string builderName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.App/builders/", false); + uri.AppendPath(builderName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string builderName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.App/builders/", false); + uri.AppendPath(builderName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Get a BuilderResource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the builder. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> GetAsync(string subscriptionId, string resourceGroupName, string builderName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(builderName, nameof(builderName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, builderName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + BuilderResourceData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = BuilderResourceData.DeserializeBuilderResourceData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((BuilderResourceData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + /// Get a BuilderResource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the builder. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response Get(string subscriptionId, string resourceGroupName, string builderName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(builderName, nameof(builderName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, builderName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + BuilderResourceData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = BuilderResourceData.DeserializeBuilderResourceData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((BuilderResourceData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateCreateOrUpdateRequestUri(string subscriptionId, string resourceGroupName, string builderName, BuilderResourceData data) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.App/builders/", false); + uri.AppendPath(builderName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateCreateOrUpdateRequest(string subscriptionId, string resourceGroupName, string builderName, BuilderResourceData data) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Put; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.App/builders/", false); + uri.AppendPath(builderName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(data, ModelSerializationExtensions.WireOptions); + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// Create or update a BuilderResource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the builder. + /// Resource create parameters. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task CreateOrUpdateAsync(string subscriptionId, string resourceGroupName, string builderName, BuilderResourceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(builderName, nameof(builderName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, builderName, data); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 201: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Create or update a BuilderResource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the builder. + /// Resource create parameters. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response CreateOrUpdate(string subscriptionId, string resourceGroupName, string builderName, BuilderResourceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(builderName, nameof(builderName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, builderName, data); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 201: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateUpdateRequestUri(string subscriptionId, string resourceGroupName, string builderName, BuilderResourcePatch patch) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.App/builders/", false); + uri.AppendPath(builderName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceGroupName, string builderName, BuilderResourcePatch patch) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Patch; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.App/builders/", false); + uri.AppendPath(builderName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(patch, ModelSerializationExtensions.WireOptions); + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// Update a BuilderResource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the builder. + /// The resource properties to be updated. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task UpdateAsync(string subscriptionId, string resourceGroupName, string builderName, BuilderResourcePatch patch, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(builderName, nameof(builderName)); + Argument.AssertNotNull(patch, nameof(patch)); + + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, builderName, patch); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Update a BuilderResource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the builder. + /// The resource properties to be updated. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response Update(string subscriptionId, string resourceGroupName, string builderName, BuilderResourcePatch patch, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(builderName, nameof(builderName)); + Argument.AssertNotNull(patch, nameof(patch)); + + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, builderName, patch); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string resourceGroupName, string builderName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.App/builders/", false); + uri.AppendPath(builderName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string builderName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Delete; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.App/builders/", false); + uri.AppendPath(builderName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Delete a BuilderResource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the builder. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task DeleteAsync(string subscriptionId, string resourceGroupName, string builderName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(builderName, nameof(builderName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, builderName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Delete a BuilderResource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the builder. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response Delete(string subscriptionId, string resourceGroupName, string builderName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(builderName, nameof(builderName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, builderName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListBySubscriptionNextPageRequestUri(string nextLink, string subscriptionId) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + return uri; + } + + internal HttpMessage CreateListBySubscriptionNextPageRequest(string nextLink, string subscriptionId) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List BuilderResource resources by subscription ID. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + public async Task> ListBySubscriptionNextPageAsync(string nextLink, string subscriptionId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + + using var message = CreateListBySubscriptionNextPageRequest(nextLink, subscriptionId); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + BuilderCollection value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = BuilderCollection.DeserializeBuilderCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List BuilderResource resources by subscription ID. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + public Response ListBySubscriptionNextPage(string nextLink, string subscriptionId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + + using var message = CreateListBySubscriptionNextPageRequest(nextLink, subscriptionId); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + BuilderCollection value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = BuilderCollection.DeserializeBuilderCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListByResourceGroupNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + return uri; + } + + internal HttpMessage CreateListByResourceGroupNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List BuilderResource resources by resource group. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The cancellation token to use. + /// , or is null. + /// or is an empty string, and was expected to be non-empty. + public async Task> ListByResourceGroupNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + + using var message = CreateListByResourceGroupNextPageRequest(nextLink, subscriptionId, resourceGroupName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + BuilderCollection value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = BuilderCollection.DeserializeBuilderCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List BuilderResource resources by resource group. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The cancellation token to use. + /// , or is null. + /// or is an empty string, and was expected to be non-empty. + public Response ListByResourceGroupNextPage(string nextLink, string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + + using var message = CreateListByResourceGroupNextPageRequest(nextLink, subscriptionId, resourceGroupName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + BuilderCollection value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = BuilderCollection.DeserializeBuilderCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/RestOperations/BuildsByBuilderResourceRestOperations.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/RestOperations/BuildsByBuilderResourceRestOperations.cs new file mode 100644 index 000000000000..acc4dfba1eec --- /dev/null +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/RestOperations/BuildsByBuilderResourceRestOperations.cs @@ -0,0 +1,217 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.AppContainers.Models; + +namespace Azure.ResourceManager.AppContainers +{ + internal partial class BuildsByBuilderResourceRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of BuildsByBuilderResourceRestOperations. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// The application id to use for user agent. + /// server parameter. + /// Api Version. + /// or is null. + public BuildsByBuilderResourceRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) + { + _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); + _endpoint = endpoint ?? new Uri("https://management.azure.com"); + _apiVersion = apiVersion ?? "2025-02-02-preview"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal RequestUriBuilder CreateListRequestUri(string subscriptionId, string resourceGroupName, string builderName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.App/builders/", false); + uri.AppendPath(builderName, true); + uri.AppendPath("/builds", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateListRequest(string subscriptionId, string resourceGroupName, string builderName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.App/builders/", false); + uri.AppendPath(builderName, true); + uri.AppendPath("/builds", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List BuildResource resources by BuilderResource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the builder. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> ListAsync(string subscriptionId, string resourceGroupName, string builderName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(builderName, nameof(builderName)); + + using var message = CreateListRequest(subscriptionId, resourceGroupName, builderName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + BuildCollection value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = BuildCollection.DeserializeBuildCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List BuildResource resources by BuilderResource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the builder. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response List(string subscriptionId, string resourceGroupName, string builderName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(builderName, nameof(builderName)); + + using var message = CreateListRequest(subscriptionId, resourceGroupName, builderName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + BuildCollection value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = BuildCollection.DeserializeBuildCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName, string builderName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + return uri; + } + + internal HttpMessage CreateListNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string builderName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List BuildResource resources by BuilderResource. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the builder. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> ListNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string builderName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(builderName, nameof(builderName)); + + using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, builderName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + BuildCollection value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = BuildCollection.DeserializeBuildCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List BuildResource resources by BuilderResource. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the builder. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response ListNextPage(string nextLink, string subscriptionId, string resourceGroupName, string builderName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(builderName, nameof(builderName)); + + using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, builderName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + BuildCollection value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = BuildCollection.DeserializeBuildCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/RestOperations/BuildsRestOperations.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/RestOperations/BuildsRestOperations.cs new file mode 100644 index 000000000000..42851c3f1d75 --- /dev/null +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/RestOperations/BuildsRestOperations.cs @@ -0,0 +1,334 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.AppContainers +{ + internal partial class BuildsRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of BuildsRestOperations. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// The application id to use for user agent. + /// server parameter. + /// Api Version. + /// or is null. + public BuildsRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) + { + _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); + _endpoint = endpoint ?? new Uri("https://management.azure.com"); + _apiVersion = apiVersion ?? "2025-02-02-preview"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string builderName, string buildName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.App/builders/", false); + uri.AppendPath(builderName, true); + uri.AppendPath("/builds/", false); + uri.AppendPath(buildName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string builderName, string buildName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.App/builders/", false); + uri.AppendPath(builderName, true); + uri.AppendPath("/builds/", false); + uri.AppendPath(buildName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Get a BuildResource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the builder. + /// The name of a build. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task> GetAsync(string subscriptionId, string resourceGroupName, string builderName, string buildName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(builderName, nameof(builderName)); + Argument.AssertNotNullOrEmpty(buildName, nameof(buildName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, builderName, buildName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + BuildResourceData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = BuildResourceData.DeserializeBuildResourceData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((BuildResourceData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + /// Get a BuildResource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the builder. + /// The name of a build. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response Get(string subscriptionId, string resourceGroupName, string builderName, string buildName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(builderName, nameof(builderName)); + Argument.AssertNotNullOrEmpty(buildName, nameof(buildName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, builderName, buildName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + BuildResourceData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = BuildResourceData.DeserializeBuildResourceData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((BuildResourceData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateCreateOrUpdateRequestUri(string subscriptionId, string resourceGroupName, string builderName, string buildName, BuildResourceData data) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.App/builders/", false); + uri.AppendPath(builderName, true); + uri.AppendPath("/builds/", false); + uri.AppendPath(buildName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateCreateOrUpdateRequest(string subscriptionId, string resourceGroupName, string builderName, string buildName, BuildResourceData data) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Put; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.App/builders/", false); + uri.AppendPath(builderName, true); + uri.AppendPath("/builds/", false); + uri.AppendPath(buildName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(data, ModelSerializationExtensions.WireOptions); + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// Create a BuildResource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the builder. + /// The name of a build. + /// Resource create or update parameters. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task CreateOrUpdateAsync(string subscriptionId, string resourceGroupName, string builderName, string buildName, BuildResourceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(builderName, nameof(builderName)); + Argument.AssertNotNullOrEmpty(buildName, nameof(buildName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, builderName, buildName, data); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 201: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Create a BuildResource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the builder. + /// The name of a build. + /// Resource create or update parameters. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response CreateOrUpdate(string subscriptionId, string resourceGroupName, string builderName, string buildName, BuildResourceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(builderName, nameof(builderName)); + Argument.AssertNotNullOrEmpty(buildName, nameof(buildName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, builderName, buildName, data); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 201: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string resourceGroupName, string builderName, string buildName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.App/builders/", false); + uri.AppendPath(builderName, true); + uri.AppendPath("/builds/", false); + uri.AppendPath(buildName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string builderName, string buildName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Delete; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.App/builders/", false); + uri.AppendPath(builderName, true); + uri.AppendPath("/builds/", false); + uri.AppendPath(buildName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Delete a BuildResource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the builder. + /// The name of a build. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task DeleteAsync(string subscriptionId, string resourceGroupName, string builderName, string buildName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(builderName, nameof(builderName)); + Argument.AssertNotNullOrEmpty(buildName, nameof(buildName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, builderName, buildName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Delete a BuildResource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the builder. + /// The name of a build. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response Delete(string subscriptionId, string resourceGroupName, string builderName, string buildName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(builderName, nameof(builderName)); + Argument.AssertNotNullOrEmpty(buildName, nameof(buildName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, builderName, buildName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/RestOperations/CertificatesRestOperations.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/RestOperations/CertificatesRestOperations.cs index f39c1aecfbea..2639430366f8 100644 --- a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/RestOperations/CertificatesRestOperations.cs +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/RestOperations/CertificatesRestOperations.cs @@ -32,7 +32,7 @@ public CertificatesRestOperations(HttpPipeline pipeline, string applicationId, U { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2025-01-01"; + _apiVersion = apiVersion ?? "2025-02-02-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } @@ -73,7 +73,7 @@ internal HttpMessage CreateListRequest(string subscriptionId, string resourceGro } /// Get the Certificates in a given managed environment. - /// The ID of the target subscription. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Name of the Managed Environment. /// The cancellation token to use. @@ -102,7 +102,7 @@ public async Task> ListAsync(string subscription } /// Get the Certificates in a given managed environment. - /// The ID of the target subscription. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Name of the Managed Environment. /// The cancellation token to use. @@ -169,7 +169,7 @@ internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGrou } /// Get the specified Certificate. - /// The ID of the target subscription. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Name of the Managed Environment. /// Name of the Certificate. @@ -202,7 +202,7 @@ public async Task> GetAsync(string subscri } /// Get the specified Certificate. - /// The ID of the target subscription. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Name of the Managed Environment. /// Name of the Certificate. @@ -277,7 +277,7 @@ internal HttpMessage CreateCreateOrUpdateRequest(string subscriptionId, string r } /// Create or Update a Certificate. - /// The ID of the target subscription. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Name of the Managed Environment. /// Name of the Certificate. @@ -310,7 +310,7 @@ public async Task> CreateOrUpdateAsync(str } /// Create or Update a Certificate. - /// The ID of the target subscription. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Name of the Managed Environment. /// Name of the Certificate. @@ -381,7 +381,7 @@ internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceG } /// Deletes the specified Certificate. - /// The ID of the target subscription. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Name of the Managed Environment. /// Name of the Certificate. @@ -408,7 +408,7 @@ public async Task DeleteAsync(string subscriptionId, string resourceGr } /// Deletes the specified Certificate. - /// The ID of the target subscription. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Name of the Managed Environment. /// Name of the Certificate. @@ -477,7 +477,7 @@ internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceG } /// Patches a certificate. Currently only patching of tags is supported. - /// The ID of the target subscription. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Name of the Managed Environment. /// Name of the Certificate. @@ -510,7 +510,7 @@ public async Task> UpdateAsync(string subs } /// Patches a certificate. Currently only patching of tags is supported. - /// The ID of the target subscription. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Name of the Managed Environment. /// Name of the Certificate. @@ -566,7 +566,7 @@ internal HttpMessage CreateListNextPageRequest(string nextLink, string subscript /// Get the Certificates in a given managed environment. /// The URL to the next page of results. - /// The ID of the target subscription. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Name of the Managed Environment. /// The cancellation token to use. @@ -597,7 +597,7 @@ public async Task> ListNextPageAsync(string next /// Get the Certificates in a given managed environment. /// The URL to the next page of results. - /// The ID of the target subscription. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Name of the Managed Environment. /// The cancellation token to use. diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/RestOperations/ConnectedEnvironmentsCertificatesRestOperations.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/RestOperations/ConnectedEnvironmentsCertificatesRestOperations.cs index a44831a21ca0..1b6072b4d86a 100644 --- a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/RestOperations/ConnectedEnvironmentsCertificatesRestOperations.cs +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/RestOperations/ConnectedEnvironmentsCertificatesRestOperations.cs @@ -32,7 +32,7 @@ public ConnectedEnvironmentsCertificatesRestOperations(HttpPipeline pipeline, st { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2025-01-01"; + _apiVersion = apiVersion ?? "2025-02-02-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } @@ -73,7 +73,7 @@ internal HttpMessage CreateListRequest(string subscriptionId, string resourceGro } /// Get the Certificates in a given connected environment. - /// The ID of the target subscription. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Name of the Connected Environment. /// The cancellation token to use. @@ -102,7 +102,7 @@ public async Task> ListAsync(string subscription } /// Get the Certificates in a given connected environment. - /// The ID of the target subscription. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Name of the Connected Environment. /// The cancellation token to use. @@ -169,7 +169,7 @@ internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGrou } /// Get the specified Certificate. - /// The ID of the target subscription. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Name of the Connected Environment. /// Name of the Certificate. @@ -202,7 +202,7 @@ public async Task> GetAsync(string subscri } /// Get the specified Certificate. - /// The ID of the target subscription. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Name of the Connected Environment. /// Name of the Certificate. @@ -277,7 +277,7 @@ internal HttpMessage CreateCreateOrUpdateRequest(string subscriptionId, string r } /// Create or Update a Certificate. - /// The ID of the target subscription. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Name of the Connected Environment. /// Name of the Certificate. @@ -285,7 +285,7 @@ internal HttpMessage CreateCreateOrUpdateRequest(string subscriptionId, string r /// The cancellation token to use. /// , , , or is null. /// , , or is an empty string, and was expected to be non-empty. - public async Task> CreateOrUpdateAsync(string subscriptionId, string resourceGroupName, string connectedEnvironmentName, string certificateName, ContainerAppCertificateData data, CancellationToken cancellationToken = default) + public async Task CreateOrUpdateAsync(string subscriptionId, string resourceGroupName, string connectedEnvironmentName, string certificateName, ContainerAppCertificateData data, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); @@ -298,19 +298,15 @@ public async Task> CreateOrUpdateAsync(str switch (message.Response.Status) { case 200: - { - ContainerAppCertificateData value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); - value = ContainerAppCertificateData.DeserializeContainerAppCertificateData(document.RootElement); - return Response.FromValue(value, message.Response); - } + case 201: + return message.Response; default: throw new RequestFailedException(message.Response); } } /// Create or Update a Certificate. - /// The ID of the target subscription. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Name of the Connected Environment. /// Name of the Certificate. @@ -318,7 +314,7 @@ public async Task> CreateOrUpdateAsync(str /// The cancellation token to use. /// , , , or is null. /// , , or is an empty string, and was expected to be non-empty. - public Response CreateOrUpdate(string subscriptionId, string resourceGroupName, string connectedEnvironmentName, string certificateName, ContainerAppCertificateData data, CancellationToken cancellationToken = default) + public Response CreateOrUpdate(string subscriptionId, string resourceGroupName, string connectedEnvironmentName, string certificateName, ContainerAppCertificateData data, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); @@ -331,12 +327,8 @@ public Response CreateOrUpdate(string subscriptionI switch (message.Response.Status) { case 200: - { - ContainerAppCertificateData value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); - value = ContainerAppCertificateData.DeserializeContainerAppCertificateData(document.RootElement); - return Response.FromValue(value, message.Response); - } + case 201: + return message.Response; default: throw new RequestFailedException(message.Response); } @@ -381,7 +373,7 @@ internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceG } /// Deletes the specified Certificate. - /// The ID of the target subscription. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Name of the Connected Environment. /// Name of the Certificate. @@ -399,7 +391,7 @@ public async Task DeleteAsync(string subscriptionId, string resourceGr await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { - case 200: + case 202: case 204: return message.Response; default: @@ -408,7 +400,7 @@ public async Task DeleteAsync(string subscriptionId, string resourceGr } /// Deletes the specified Certificate. - /// The ID of the target subscription. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Name of the Connected Environment. /// Name of the Certificate. @@ -426,7 +418,7 @@ public Response Delete(string subscriptionId, string resourceGroupName, string c _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { - case 200: + case 202: case 204: return message.Response; default: @@ -477,7 +469,7 @@ internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceG } /// Patches a certificate. Currently only patching of tags is supported. - /// The ID of the target subscription. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Name of the Connected Environment. /// Name of the Certificate. @@ -485,7 +477,7 @@ internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceG /// The cancellation token to use. /// , , , or is null. /// , , or is an empty string, and was expected to be non-empty. - public async Task> UpdateAsync(string subscriptionId, string resourceGroupName, string connectedEnvironmentName, string certificateName, ContainerAppCertificatePatch patch, CancellationToken cancellationToken = default) + public async Task UpdateAsync(string subscriptionId, string resourceGroupName, string connectedEnvironmentName, string certificateName, ContainerAppCertificatePatch patch, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); @@ -498,19 +490,15 @@ public async Task> UpdateAsync(string subs switch (message.Response.Status) { case 200: - { - ContainerAppCertificateData value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); - value = ContainerAppCertificateData.DeserializeContainerAppCertificateData(document.RootElement); - return Response.FromValue(value, message.Response); - } + case 202: + return message.Response; default: throw new RequestFailedException(message.Response); } } /// Patches a certificate. Currently only patching of tags is supported. - /// The ID of the target subscription. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Name of the Connected Environment. /// Name of the Certificate. @@ -518,7 +506,7 @@ public async Task> UpdateAsync(string subs /// The cancellation token to use. /// , , , or is null. /// , , or is an empty string, and was expected to be non-empty. - public Response Update(string subscriptionId, string resourceGroupName, string connectedEnvironmentName, string certificateName, ContainerAppCertificatePatch patch, CancellationToken cancellationToken = default) + public Response Update(string subscriptionId, string resourceGroupName, string connectedEnvironmentName, string certificateName, ContainerAppCertificatePatch patch, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); @@ -531,12 +519,8 @@ public Response Update(string subscriptionId, strin switch (message.Response.Status) { case 200: - { - ContainerAppCertificateData value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); - value = ContainerAppCertificateData.DeserializeContainerAppCertificateData(document.RootElement); - return Response.FromValue(value, message.Response); - } + case 202: + return message.Response; default: throw new RequestFailedException(message.Response); } @@ -566,7 +550,7 @@ internal HttpMessage CreateListNextPageRequest(string nextLink, string subscript /// Get the Certificates in a given connected environment. /// The URL to the next page of results. - /// The ID of the target subscription. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Name of the Connected Environment. /// The cancellation token to use. @@ -597,7 +581,7 @@ public async Task> ListNextPageAsync(string next /// Get the Certificates in a given connected environment. /// The URL to the next page of results. - /// The ID of the target subscription. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Name of the Connected Environment. /// The cancellation token to use. diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/RestOperations/ConnectedEnvironmentsDaprComponentsRestOperations.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/RestOperations/ConnectedEnvironmentsDaprComponentsRestOperations.cs index b4759846b525..74220c7c0b0a 100644 --- a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/RestOperations/ConnectedEnvironmentsDaprComponentsRestOperations.cs +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/RestOperations/ConnectedEnvironmentsDaprComponentsRestOperations.cs @@ -32,7 +32,7 @@ public ConnectedEnvironmentsDaprComponentsRestOperations(HttpPipeline pipeline, { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2025-01-01"; + _apiVersion = apiVersion ?? "2025-02-02-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } @@ -73,13 +73,13 @@ internal HttpMessage CreateListRequest(string subscriptionId, string resourceGro } /// Get the Dapr Components for a connected environment. - /// The ID of the target subscription. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Name of the connected environment. /// The cancellation token to use. /// , or is null. /// , or is an empty string, and was expected to be non-empty. - public async Task> ListAsync(string subscriptionId, string resourceGroupName, string connectedEnvironmentName, CancellationToken cancellationToken = default) + public async Task> ListAsync(string subscriptionId, string resourceGroupName, string connectedEnvironmentName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); @@ -91,9 +91,9 @@ public async Task> ListAsync(string subscript { case 200: { - DaprComponentsCollection value = default; + ConnectedEnvironmentDaprComponentsCollection value = default; using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); - value = DaprComponentsCollection.DeserializeDaprComponentsCollection(document.RootElement); + value = ConnectedEnvironmentDaprComponentsCollection.DeserializeConnectedEnvironmentDaprComponentsCollection(document.RootElement); return Response.FromValue(value, message.Response); } default: @@ -102,13 +102,13 @@ public async Task> ListAsync(string subscript } /// Get the Dapr Components for a connected environment. - /// The ID of the target subscription. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Name of the connected environment. /// The cancellation token to use. /// , or is null. /// , or is an empty string, and was expected to be non-empty. - public Response List(string subscriptionId, string resourceGroupName, string connectedEnvironmentName, CancellationToken cancellationToken = default) + public Response List(string subscriptionId, string resourceGroupName, string connectedEnvironmentName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); @@ -120,9 +120,9 @@ public Response List(string subscriptionId, string res { case 200: { - DaprComponentsCollection value = default; + ConnectedEnvironmentDaprComponentsCollection value = default; using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); - value = DaprComponentsCollection.DeserializeDaprComponentsCollection(document.RootElement); + value = ConnectedEnvironmentDaprComponentsCollection.DeserializeConnectedEnvironmentDaprComponentsCollection(document.RootElement); return Response.FromValue(value, message.Response); } default: @@ -169,14 +169,14 @@ internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGrou } /// Get a dapr component. - /// The ID of the target subscription. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Name of the connected environment. /// Name of the Dapr Component. /// The cancellation token to use. /// , , or is null. /// , , or is an empty string, and was expected to be non-empty. - public async Task> GetAsync(string subscriptionId, string resourceGroupName, string connectedEnvironmentName, string componentName, CancellationToken cancellationToken = default) + public async Task> GetAsync(string subscriptionId, string resourceGroupName, string connectedEnvironmentName, string componentName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); @@ -189,27 +189,27 @@ public async Task> GetAsync(string subsc { case 200: { - ContainerAppDaprComponentData value = default; + ConnectedEnvironmentDaprComponentData value = default; using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); - value = ContainerAppDaprComponentData.DeserializeContainerAppDaprComponentData(document.RootElement); + value = ConnectedEnvironmentDaprComponentData.DeserializeConnectedEnvironmentDaprComponentData(document.RootElement); return Response.FromValue(value, message.Response); } case 404: - return Response.FromValue((ContainerAppDaprComponentData)null, message.Response); + return Response.FromValue((ConnectedEnvironmentDaprComponentData)null, message.Response); default: throw new RequestFailedException(message.Response); } } /// Get a dapr component. - /// The ID of the target subscription. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Name of the connected environment. /// Name of the Dapr Component. /// The cancellation token to use. /// , , or is null. /// , , or is an empty string, and was expected to be non-empty. - public Response Get(string subscriptionId, string resourceGroupName, string connectedEnvironmentName, string componentName, CancellationToken cancellationToken = default) + public Response Get(string subscriptionId, string resourceGroupName, string connectedEnvironmentName, string componentName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); @@ -222,19 +222,19 @@ public Response Get(string subscriptionId, string { case 200: { - ContainerAppDaprComponentData value = default; + ConnectedEnvironmentDaprComponentData value = default; using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); - value = ContainerAppDaprComponentData.DeserializeContainerAppDaprComponentData(document.RootElement); + value = ConnectedEnvironmentDaprComponentData.DeserializeConnectedEnvironmentDaprComponentData(document.RootElement); return Response.FromValue(value, message.Response); } case 404: - return Response.FromValue((ContainerAppDaprComponentData)null, message.Response); + return Response.FromValue((ConnectedEnvironmentDaprComponentData)null, message.Response); default: throw new RequestFailedException(message.Response); } } - internal RequestUriBuilder CreateCreateOrUpdateRequestUri(string subscriptionId, string resourceGroupName, string connectedEnvironmentName, string componentName, ContainerAppDaprComponentData data) + internal RequestUriBuilder CreateCreateOrUpdateRequestUri(string subscriptionId, string resourceGroupName, string connectedEnvironmentName, string componentName, ConnectedEnvironmentDaprComponentData data) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -250,7 +250,7 @@ internal RequestUriBuilder CreateCreateOrUpdateRequestUri(string subscriptionId, return uri; } - internal HttpMessage CreateCreateOrUpdateRequest(string subscriptionId, string resourceGroupName, string connectedEnvironmentName, string componentName, ContainerAppDaprComponentData data) + internal HttpMessage CreateCreateOrUpdateRequest(string subscriptionId, string resourceGroupName, string connectedEnvironmentName, string componentName, ConnectedEnvironmentDaprComponentData data) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -277,7 +277,7 @@ internal HttpMessage CreateCreateOrUpdateRequest(string subscriptionId, string r } /// Creates or updates a Dapr Component in a connected environment. - /// The ID of the target subscription. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Name of the connected environment. /// Name of the Dapr Component. @@ -285,7 +285,7 @@ internal HttpMessage CreateCreateOrUpdateRequest(string subscriptionId, string r /// The cancellation token to use. /// , , , or is null. /// , , or is an empty string, and was expected to be non-empty. - public async Task> CreateOrUpdateAsync(string subscriptionId, string resourceGroupName, string connectedEnvironmentName, string componentName, ContainerAppDaprComponentData data, CancellationToken cancellationToken = default) + public async Task CreateOrUpdateAsync(string subscriptionId, string resourceGroupName, string connectedEnvironmentName, string componentName, ConnectedEnvironmentDaprComponentData data, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); @@ -298,19 +298,15 @@ public async Task> CreateOrUpdateAsync(s switch (message.Response.Status) { case 200: - { - ContainerAppDaprComponentData value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); - value = ContainerAppDaprComponentData.DeserializeContainerAppDaprComponentData(document.RootElement); - return Response.FromValue(value, message.Response); - } + case 201: + return message.Response; default: throw new RequestFailedException(message.Response); } } /// Creates or updates a Dapr Component in a connected environment. - /// The ID of the target subscription. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Name of the connected environment. /// Name of the Dapr Component. @@ -318,7 +314,7 @@ public async Task> CreateOrUpdateAsync(s /// The cancellation token to use. /// , , , or is null. /// , , or is an empty string, and was expected to be non-empty. - public Response CreateOrUpdate(string subscriptionId, string resourceGroupName, string connectedEnvironmentName, string componentName, ContainerAppDaprComponentData data, CancellationToken cancellationToken = default) + public Response CreateOrUpdate(string subscriptionId, string resourceGroupName, string connectedEnvironmentName, string componentName, ConnectedEnvironmentDaprComponentData data, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); @@ -331,12 +327,8 @@ public Response CreateOrUpdate(string subscriptio switch (message.Response.Status) { case 200: - { - ContainerAppDaprComponentData value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); - value = ContainerAppDaprComponentData.DeserializeContainerAppDaprComponentData(document.RootElement); - return Response.FromValue(value, message.Response); - } + case 201: + return message.Response; default: throw new RequestFailedException(message.Response); } @@ -381,7 +373,7 @@ internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceG } /// Delete a Dapr Component from a connected environment. - /// The ID of the target subscription. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Name of the connected environment. /// Name of the Dapr Component. @@ -399,7 +391,7 @@ public async Task DeleteAsync(string subscriptionId, string resourceGr await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { - case 200: + case 202: case 204: return message.Response; default: @@ -408,7 +400,7 @@ public async Task DeleteAsync(string subscriptionId, string resourceGr } /// Delete a Dapr Component from a connected environment. - /// The ID of the target subscription. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Name of the connected environment. /// Name of the Dapr Component. @@ -426,7 +418,7 @@ public Response Delete(string subscriptionId, string resourceGroupName, string c _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { - case 200: + case 202: case 204: return message.Response; default: @@ -475,7 +467,7 @@ internal HttpMessage CreateListSecretsRequest(string subscriptionId, string reso } /// List secrets for a dapr component. - /// The ID of the target subscription. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Name of the connected environment. /// Name of the Dapr Component. @@ -506,7 +498,7 @@ public async Task> ListSecretsAsync(string subsc } /// List secrets for a dapr component. - /// The ID of the target subscription. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Name of the connected environment. /// Name of the Dapr Component. @@ -560,13 +552,13 @@ internal HttpMessage CreateListNextPageRequest(string nextLink, string subscript /// Get the Dapr Components for a connected environment. /// The URL to the next page of results. - /// The ID of the target subscription. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Name of the connected environment. /// The cancellation token to use. /// , , or is null. /// , or is an empty string, and was expected to be non-empty. - public async Task> ListNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string connectedEnvironmentName, CancellationToken cancellationToken = default) + public async Task> ListNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string connectedEnvironmentName, CancellationToken cancellationToken = default) { Argument.AssertNotNull(nextLink, nameof(nextLink)); Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); @@ -579,9 +571,9 @@ public async Task> ListNextPageAsync(string n { case 200: { - DaprComponentsCollection value = default; + ConnectedEnvironmentDaprComponentsCollection value = default; using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); - value = DaprComponentsCollection.DeserializeDaprComponentsCollection(document.RootElement); + value = ConnectedEnvironmentDaprComponentsCollection.DeserializeConnectedEnvironmentDaprComponentsCollection(document.RootElement); return Response.FromValue(value, message.Response); } default: @@ -591,13 +583,13 @@ public async Task> ListNextPageAsync(string n /// Get the Dapr Components for a connected environment. /// The URL to the next page of results. - /// The ID of the target subscription. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Name of the connected environment. /// The cancellation token to use. /// , , or is null. /// , or is an empty string, and was expected to be non-empty. - public Response ListNextPage(string nextLink, string subscriptionId, string resourceGroupName, string connectedEnvironmentName, CancellationToken cancellationToken = default) + public Response ListNextPage(string nextLink, string subscriptionId, string resourceGroupName, string connectedEnvironmentName, CancellationToken cancellationToken = default) { Argument.AssertNotNull(nextLink, nameof(nextLink)); Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); @@ -610,9 +602,9 @@ public Response ListNextPage(string nextLink, string s { case 200: { - DaprComponentsCollection value = default; + ConnectedEnvironmentDaprComponentsCollection value = default; using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); - value = DaprComponentsCollection.DeserializeDaprComponentsCollection(document.RootElement); + value = ConnectedEnvironmentDaprComponentsCollection.DeserializeConnectedEnvironmentDaprComponentsCollection(document.RootElement); return Response.FromValue(value, message.Response); } default: diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/RestOperations/ConnectedEnvironmentsRestOperations.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/RestOperations/ConnectedEnvironmentsRestOperations.cs index c8f431ab6c4d..0f4512fdf947 100644 --- a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/RestOperations/ConnectedEnvironmentsRestOperations.cs +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/RestOperations/ConnectedEnvironmentsRestOperations.cs @@ -32,7 +32,7 @@ public ConnectedEnvironmentsRestOperations(HttpPipeline pipeline, string applica { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2025-01-01"; + _apiVersion = apiVersion ?? "2025-02-02-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } @@ -65,7 +65,7 @@ internal HttpMessage CreateListBySubscriptionRequest(string subscriptionId) } /// Get all connectedEnvironments for a subscription. - /// The ID of the target subscription. + /// The ID of the target subscription. The value must be an UUID. /// The cancellation token to use. /// is null. /// is an empty string, and was expected to be non-empty. @@ -90,7 +90,7 @@ public async Task> ListBySubscriptionAs } /// Get all connectedEnvironments for a subscription. - /// The ID of the target subscription. + /// The ID of the target subscription. The value must be an UUID. /// The cancellation token to use. /// is null. /// is an empty string, and was expected to be non-empty. @@ -147,7 +147,7 @@ internal HttpMessage CreateListByResourceGroupRequest(string subscriptionId, str } /// Get all connectedEnvironments in a resource group. - /// The ID of the target subscription. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// The cancellation token to use. /// or is null. @@ -174,7 +174,7 @@ public async Task> ListByResourceGroupA } /// Get all connectedEnvironments in a resource group. - /// The ID of the target subscription. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// The cancellation token to use. /// or is null. @@ -235,7 +235,7 @@ internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGrou } /// Get the properties of an connectedEnvironment. - /// The ID of the target subscription. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Name of the connectedEnvironment. /// The cancellation token to use. @@ -266,7 +266,7 @@ public async Task> GetAsync(strin } /// Get the properties of an connectedEnvironment. - /// The ID of the target subscription. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Name of the connectedEnvironment. /// The cancellation token to use. @@ -335,7 +335,7 @@ internal HttpMessage CreateCreateOrUpdateRequest(string subscriptionId, string r } /// Creates or updates an connectedEnvironment. - /// The ID of the target subscription. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Name of the connectedEnvironment. /// Configuration details of the connectedEnvironment. @@ -362,7 +362,7 @@ public async Task CreateOrUpdateAsync(string subscriptionId, string re } /// Creates or updates an connectedEnvironment. - /// The ID of the target subscription. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Name of the connectedEnvironment. /// Configuration details of the connectedEnvironment. @@ -423,7 +423,7 @@ internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceG } /// Delete an connectedEnvironment. - /// The ID of the target subscription. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Name of the connectedEnvironment. /// The cancellation token to use. @@ -449,7 +449,7 @@ public async Task DeleteAsync(string subscriptionId, string resourceGr } /// Delete an connectedEnvironment. - /// The ID of the target subscription. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Name of the connectedEnvironment. /// The cancellation token to use. @@ -474,7 +474,7 @@ public Response Delete(string subscriptionId, string resourceGroupName, string c } } - internal RequestUriBuilder CreateUpdateRequestUri(string subscriptionId, string resourceGroupName, string connectedEnvironmentName) + internal RequestUriBuilder CreateUpdateRequestUri(string subscriptionId, string resourceGroupName, string connectedEnvironmentName, ContainerAppConnectedEnvironmentPatch patch) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -488,7 +488,7 @@ internal RequestUriBuilder CreateUpdateRequestUri(string subscriptionId, string return uri; } - internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceGroupName, string connectedEnvironmentName) + internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceGroupName, string connectedEnvironmentName, ContainerAppConnectedEnvironmentPatch patch) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -504,24 +504,30 @@ internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceG uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(patch, ModelSerializationExtensions.WireOptions); + request.Content = content; _userAgent.Apply(message); return message; } /// Patches a Managed Environment. Only patching of tags is supported currently. - /// The ID of the target subscription. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Name of the connectedEnvironment. + /// Configuration details of the connectedEnvironment. /// The cancellation token to use. - /// , or is null. + /// , , or is null. /// , or is an empty string, and was expected to be non-empty. - public async Task> UpdateAsync(string subscriptionId, string resourceGroupName, string connectedEnvironmentName, CancellationToken cancellationToken = default) + public async Task> UpdateAsync(string subscriptionId, string resourceGroupName, string connectedEnvironmentName, ContainerAppConnectedEnvironmentPatch patch, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(connectedEnvironmentName, nameof(connectedEnvironmentName)); + Argument.AssertNotNull(patch, nameof(patch)); - using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, connectedEnvironmentName); + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, connectedEnvironmentName, patch); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { @@ -538,19 +544,21 @@ public async Task> UpdateAsync(st } /// Patches a Managed Environment. Only patching of tags is supported currently. - /// The ID of the target subscription. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Name of the connectedEnvironment. + /// Configuration details of the connectedEnvironment. /// The cancellation token to use. - /// , or is null. + /// , , or is null. /// , or is an empty string, and was expected to be non-empty. - public Response Update(string subscriptionId, string resourceGroupName, string connectedEnvironmentName, CancellationToken cancellationToken = default) + public Response Update(string subscriptionId, string resourceGroupName, string connectedEnvironmentName, ContainerAppConnectedEnvironmentPatch patch, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(connectedEnvironmentName, nameof(connectedEnvironmentName)); + Argument.AssertNotNull(patch, nameof(patch)); - using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, connectedEnvironmentName); + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, connectedEnvironmentName, patch); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { @@ -607,7 +615,7 @@ internal HttpMessage CreateCheckNameAvailabilityRequest(string subscriptionId, s } /// Checks if resource connectedEnvironmentName is available. - /// The ID of the target subscription. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Name of the Managed Environment. /// The check connectedEnvironmentName availability request. @@ -638,7 +646,7 @@ public async Task> CheckNameAvailab } /// Checks if resource connectedEnvironmentName is available. - /// The ID of the target subscription. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Name of the Managed Environment. /// The check connectedEnvironmentName availability request. @@ -692,7 +700,7 @@ internal HttpMessage CreateListBySubscriptionNextPageRequest(string nextLink, st /// Get all connectedEnvironments for a subscription. /// The URL to the next page of results. - /// The ID of the target subscription. + /// The ID of the target subscription. The value must be an UUID. /// The cancellation token to use. /// or is null. /// is an empty string, and was expected to be non-empty. @@ -719,7 +727,7 @@ public async Task> ListBySubscriptionNe /// Get all connectedEnvironments for a subscription. /// The URL to the next page of results. - /// The ID of the target subscription. + /// The ID of the target subscription. The value must be an UUID. /// The cancellation token to use. /// or is null. /// is an empty string, and was expected to be non-empty. @@ -768,7 +776,7 @@ internal HttpMessage CreateListByResourceGroupNextPageRequest(string nextLink, s /// Get all connectedEnvironments in a resource group. /// The URL to the next page of results. - /// The ID of the target subscription. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// The cancellation token to use. /// , or is null. @@ -797,7 +805,7 @@ public async Task> ListByResourceGroupN /// Get all connectedEnvironments in a resource group. /// The URL to the next page of results. - /// The ID of the target subscription. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// The cancellation token to use. /// , or is null. diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/RestOperations/ConnectedEnvironmentsStoragesRestOperations.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/RestOperations/ConnectedEnvironmentsStoragesRestOperations.cs index a5adcf3b53e4..8c997f6c3b30 100644 --- a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/RestOperations/ConnectedEnvironmentsStoragesRestOperations.cs +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/RestOperations/ConnectedEnvironmentsStoragesRestOperations.cs @@ -32,7 +32,7 @@ public ConnectedEnvironmentsStoragesRestOperations(HttpPipeline pipeline, string { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2025-01-01"; + _apiVersion = apiVersion ?? "2025-02-02-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } @@ -73,7 +73,7 @@ internal HttpMessage CreateListRequest(string subscriptionId, string resourceGro } /// Get all storages for a connectedEnvironment. - /// The ID of the target subscription. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Name of the Environment. /// The cancellation token to use. @@ -102,7 +102,7 @@ public async Task> ListAsync(st } /// Get all storages for a connectedEnvironment. - /// The ID of the target subscription. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Name of the Environment. /// The cancellation token to use. @@ -169,7 +169,7 @@ internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGrou } /// Get storage for a connectedEnvironment. - /// The ID of the target subscription. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Name of the Environment. /// Name of the storage. @@ -202,7 +202,7 @@ public async Task> GetAsyn } /// Get storage for a connectedEnvironment. - /// The ID of the target subscription. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Name of the Environment. /// Name of the storage. @@ -277,7 +277,7 @@ internal HttpMessage CreateCreateOrUpdateRequest(string subscriptionId, string r } /// Create or update storage for a connectedEnvironment. - /// The ID of the target subscription. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Name of the Environment. /// Name of the storage. @@ -285,7 +285,7 @@ internal HttpMessage CreateCreateOrUpdateRequest(string subscriptionId, string r /// The cancellation token to use. /// , , , or is null. /// , , or is an empty string, and was expected to be non-empty. - public async Task> CreateOrUpdateAsync(string subscriptionId, string resourceGroupName, string connectedEnvironmentName, string storageName, ContainerAppConnectedEnvironmentStorageData data, CancellationToken cancellationToken = default) + public async Task CreateOrUpdateAsync(string subscriptionId, string resourceGroupName, string connectedEnvironmentName, string storageName, ContainerAppConnectedEnvironmentStorageData data, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); @@ -298,19 +298,15 @@ public async Task> CreateO switch (message.Response.Status) { case 200: - { - ContainerAppConnectedEnvironmentStorageData value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); - value = ContainerAppConnectedEnvironmentStorageData.DeserializeContainerAppConnectedEnvironmentStorageData(document.RootElement); - return Response.FromValue(value, message.Response); - } + case 201: + return message.Response; default: throw new RequestFailedException(message.Response); } } /// Create or update storage for a connectedEnvironment. - /// The ID of the target subscription. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Name of the Environment. /// Name of the storage. @@ -318,7 +314,7 @@ public async Task> CreateO /// The cancellation token to use. /// , , , or is null. /// , , or is an empty string, and was expected to be non-empty. - public Response CreateOrUpdate(string subscriptionId, string resourceGroupName, string connectedEnvironmentName, string storageName, ContainerAppConnectedEnvironmentStorageData data, CancellationToken cancellationToken = default) + public Response CreateOrUpdate(string subscriptionId, string resourceGroupName, string connectedEnvironmentName, string storageName, ContainerAppConnectedEnvironmentStorageData data, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); @@ -331,12 +327,8 @@ public Response CreateOrUpdate(stri switch (message.Response.Status) { case 200: - { - ContainerAppConnectedEnvironmentStorageData value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); - value = ContainerAppConnectedEnvironmentStorageData.DeserializeContainerAppConnectedEnvironmentStorageData(document.RootElement); - return Response.FromValue(value, message.Response); - } + case 201: + return message.Response; default: throw new RequestFailedException(message.Response); } @@ -381,7 +373,7 @@ internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceG } /// Delete storage for a connectedEnvironment. - /// The ID of the target subscription. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Name of the Environment. /// Name of the storage. @@ -399,7 +391,7 @@ public async Task DeleteAsync(string subscriptionId, string resourceGr await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { - case 200: + case 202: case 204: return message.Response; default: @@ -408,7 +400,7 @@ public async Task DeleteAsync(string subscriptionId, string resourceGr } /// Delete storage for a connectedEnvironment. - /// The ID of the target subscription. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Name of the Environment. /// Name of the storage. @@ -426,7 +418,7 @@ public Response Delete(string subscriptionId, string resourceGroupName, string c _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { - case 200: + case 202: case 204: return message.Response; default: diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/RestOperations/ContainerAppsAPIRestOperations.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/RestOperations/ContainerAppsAPIRestOperations.cs index 3622df65e657..4928cdeed6be 100644 --- a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/RestOperations/ContainerAppsAPIRestOperations.cs +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/RestOperations/ContainerAppsAPIRestOperations.cs @@ -31,7 +31,7 @@ public ContainerAppsAPIRestOperations(HttpPipeline pipeline, string applicationI { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2025-01-01"; + _apiVersion = apiVersion ?? "2025-02-02-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } @@ -74,7 +74,7 @@ internal HttpMessage CreateJobExecutionRequest(string subscriptionId, string res } /// Get details of a single job execution. - /// The ID of the target subscription. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Job Name. /// Job execution name. @@ -107,7 +107,7 @@ public async Task> JobExecutionAsync(stri } /// Get details of a single job execution. - /// The ID of the target subscription. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Job Name. /// Job execution name. @@ -168,7 +168,7 @@ internal HttpMessage CreateGetCustomDomainVerificationIdRequest(string subscript } /// Get the verification id of a subscription used for verifying custom domains. - /// The ID of the target subscription. + /// The ID of the target subscription. The value must be an UUID. /// The cancellation token to use. /// is null. /// is an empty string, and was expected to be non-empty. @@ -193,7 +193,7 @@ public async Task> GetCustomDomainVerificationIdAsync(string su } /// Get the verification id of a subscription used for verifying custom domains. - /// The ID of the target subscription. + /// The ID of the target subscription. The value must be an UUID. /// The cancellation token to use. /// is null. /// is an empty string, and was expected to be non-empty. diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/RestOperations/ContainerAppsAuthConfigsRestOperations.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/RestOperations/ContainerAppsAuthConfigsRestOperations.cs index 04033d058e81..67bf8e56176c 100644 --- a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/RestOperations/ContainerAppsAuthConfigsRestOperations.cs +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/RestOperations/ContainerAppsAuthConfigsRestOperations.cs @@ -32,7 +32,7 @@ public ContainerAppsAuthConfigsRestOperations(HttpPipeline pipeline, string appl { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2025-01-01"; + _apiVersion = apiVersion ?? "2025-02-02-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } @@ -73,7 +73,7 @@ internal HttpMessage CreateListByContainerAppRequest(string subscriptionId, stri } /// Get the Container App AuthConfigs in a given resource group. - /// The ID of the target subscription. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Name of the Container App. /// The cancellation token to use. @@ -102,7 +102,7 @@ public async Task> ListByContainerAppAsync(string } /// Get the Container App AuthConfigs in a given resource group. - /// The ID of the target subscription. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Name of the Container App. /// The cancellation token to use. @@ -169,7 +169,7 @@ internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGrou } /// Get a AuthConfig of a Container App. - /// The ID of the target subscription. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Name of the Container App. /// Name of the Container App AuthConfig. @@ -202,7 +202,7 @@ public async Task> GetAsync(string subscrip } /// Get a AuthConfig of a Container App. - /// The ID of the target subscription. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Name of the Container App. /// Name of the Container App AuthConfig. @@ -277,7 +277,7 @@ internal HttpMessage CreateCreateOrUpdateRequest(string subscriptionId, string r } /// Create or update the AuthConfig for a Container App. - /// The ID of the target subscription. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Name of the Container App. /// Name of the Container App AuthConfig. @@ -310,7 +310,7 @@ public async Task> CreateOrUpdateAsync(stri } /// Create or update the AuthConfig for a Container App. - /// The ID of the target subscription. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Name of the Container App. /// Name of the Container App AuthConfig. @@ -381,7 +381,7 @@ internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceG } /// Delete a Container App AuthConfig. - /// The ID of the target subscription. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Name of the Container App. /// Name of the Container App AuthConfig. @@ -408,7 +408,7 @@ public async Task DeleteAsync(string subscriptionId, string resourceGr } /// Delete a Container App AuthConfig. - /// The ID of the target subscription. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Name of the Container App. /// Name of the Container App AuthConfig. @@ -458,7 +458,7 @@ internal HttpMessage CreateListByContainerAppNextPageRequest(string nextLink, st /// Get the Container App AuthConfigs in a given resource group. /// The URL to the next page of results. - /// The ID of the target subscription. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Name of the Container App. /// The cancellation token to use. @@ -489,7 +489,7 @@ public async Task> ListByContainerAppNextPageAsyn /// Get the Container App AuthConfigs in a given resource group. /// The URL to the next page of results. - /// The ID of the target subscription. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Name of the Container App. /// The cancellation token to use. diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/RestOperations/ContainerAppsBuildsByContainerAppRestOperations.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/RestOperations/ContainerAppsBuildsByContainerAppRestOperations.cs new file mode 100644 index 000000000000..8a46a8ac58dd --- /dev/null +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/RestOperations/ContainerAppsBuildsByContainerAppRestOperations.cs @@ -0,0 +1,217 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.AppContainers.Models; + +namespace Azure.ResourceManager.AppContainers +{ + internal partial class ContainerAppsBuildsByContainerAppRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of ContainerAppsBuildsByContainerAppRestOperations. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// The application id to use for user agent. + /// server parameter. + /// Api Version. + /// or is null. + public ContainerAppsBuildsByContainerAppRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) + { + _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); + _endpoint = endpoint ?? new Uri("https://management.azure.com"); + _apiVersion = apiVersion ?? "2025-02-02-preview"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal RequestUriBuilder CreateListRequestUri(string subscriptionId, string resourceGroupName, string containerAppName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.App/containerApps/", false); + uri.AppendPath(containerAppName, true); + uri.AppendPath("/builds", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateListRequest(string subscriptionId, string resourceGroupName, string containerAppName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.App/containerApps/", false); + uri.AppendPath(containerAppName, true); + uri.AppendPath("/builds", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List Container Apps Build resources by Container App. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the Container App the Build is associated. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> ListAsync(string subscriptionId, string resourceGroupName, string containerAppName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(containerAppName, nameof(containerAppName)); + + using var message = CreateListRequest(subscriptionId, resourceGroupName, containerAppName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + ContainerAppsBuildCollection value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = ContainerAppsBuildCollection.DeserializeContainerAppsBuildCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List Container Apps Build resources by Container App. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the Container App the Build is associated. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response List(string subscriptionId, string resourceGroupName, string containerAppName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(containerAppName, nameof(containerAppName)); + + using var message = CreateListRequest(subscriptionId, resourceGroupName, containerAppName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + ContainerAppsBuildCollection value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = ContainerAppsBuildCollection.DeserializeContainerAppsBuildCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName, string containerAppName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + return uri; + } + + internal HttpMessage CreateListNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string containerAppName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List Container Apps Build resources by Container App. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the Container App the Build is associated. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> ListNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string containerAppName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(containerAppName, nameof(containerAppName)); + + using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, containerAppName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + ContainerAppsBuildCollection value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = ContainerAppsBuildCollection.DeserializeContainerAppsBuildCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List Container Apps Build resources by Container App. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the Container App the Build is associated. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response ListNextPage(string nextLink, string subscriptionId, string resourceGroupName, string containerAppName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(containerAppName, nameof(containerAppName)); + + using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, containerAppName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + ContainerAppsBuildCollection value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = ContainerAppsBuildCollection.DeserializeContainerAppsBuildCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/RestOperations/ContainerAppsBuildsRestOperations.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/RestOperations/ContainerAppsBuildsRestOperations.cs new file mode 100644 index 000000000000..599ea8501392 --- /dev/null +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/RestOperations/ContainerAppsBuildsRestOperations.cs @@ -0,0 +1,234 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.AppContainers +{ + internal partial class ContainerAppsBuildsRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of ContainerAppsBuildsRestOperations. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// The application id to use for user agent. + /// server parameter. + /// Api Version. + /// or is null. + public ContainerAppsBuildsRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) + { + _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); + _endpoint = endpoint ?? new Uri("https://management.azure.com"); + _apiVersion = apiVersion ?? "2025-02-02-preview"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string containerAppName, string buildName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.App/containerApps/", false); + uri.AppendPath(containerAppName, true); + uri.AppendPath("/builds/", false); + uri.AppendPath(buildName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string containerAppName, string buildName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.App/containerApps/", false); + uri.AppendPath(containerAppName, true); + uri.AppendPath("/builds/", false); + uri.AppendPath(buildName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Get a Container Apps Build resource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the Container App the Build is associated. + /// The name of a build. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task> GetAsync(string subscriptionId, string resourceGroupName, string containerAppName, string buildName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(containerAppName, nameof(containerAppName)); + Argument.AssertNotNullOrEmpty(buildName, nameof(buildName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, containerAppName, buildName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + ContainerAppsBuildResourceData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = ContainerAppsBuildResourceData.DeserializeContainerAppsBuildResourceData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((ContainerAppsBuildResourceData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + /// Get a Container Apps Build resource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the Container App the Build is associated. + /// The name of a build. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response Get(string subscriptionId, string resourceGroupName, string containerAppName, string buildName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(containerAppName, nameof(containerAppName)); + Argument.AssertNotNullOrEmpty(buildName, nameof(buildName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, containerAppName, buildName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + ContainerAppsBuildResourceData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = ContainerAppsBuildResourceData.DeserializeContainerAppsBuildResourceData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((ContainerAppsBuildResourceData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string resourceGroupName, string containerAppName, string buildName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.App/containerApps/", false); + uri.AppendPath(containerAppName, true); + uri.AppendPath("/builds/", false); + uri.AppendPath(buildName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string containerAppName, string buildName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Delete; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.App/containerApps/", false); + uri.AppendPath(containerAppName, true); + uri.AppendPath("/builds/", false); + uri.AppendPath(buildName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Delete a Container Apps Build resource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the Container App the Build is associated. + /// The name of a build. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task DeleteAsync(string subscriptionId, string resourceGroupName, string containerAppName, string buildName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(containerAppName, nameof(containerAppName)); + Argument.AssertNotNullOrEmpty(buildName, nameof(buildName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, containerAppName, buildName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Delete a Container Apps Build resource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the Container App the Build is associated. + /// The name of a build. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response Delete(string subscriptionId, string resourceGroupName, string containerAppName, string buildName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(containerAppName, nameof(containerAppName)); + Argument.AssertNotNullOrEmpty(buildName, nameof(buildName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, containerAppName, buildName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/RestOperations/ContainerAppsDiagnosticsRestOperations.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/RestOperations/ContainerAppsDiagnosticsRestOperations.cs index 10daf8edbee3..fe7405e52dfc 100644 --- a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/RestOperations/ContainerAppsDiagnosticsRestOperations.cs +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/RestOperations/ContainerAppsDiagnosticsRestOperations.cs @@ -32,7 +32,7 @@ public ContainerAppsDiagnosticsRestOperations(HttpPipeline pipeline, string appl { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2025-01-01"; + _apiVersion = apiVersion ?? "2025-02-02-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } @@ -73,7 +73,7 @@ internal HttpMessage CreateListDetectorsRequest(string subscriptionId, string re } /// Get the list of diagnostics for a given Container App. - /// The ID of the target subscription. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Name of the Container App for which detector info is needed. /// The cancellation token to use. @@ -102,7 +102,7 @@ public async Task> ListDetectorsAsync(string sub } /// Get the list of diagnostics for a given Container App. - /// The ID of the target subscription. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Name of the Container App for which detector info is needed. /// The cancellation token to use. @@ -169,7 +169,7 @@ internal HttpMessage CreateGetDetectorRequest(string subscriptionId, string reso } /// Get a diagnostics result of a Container App. - /// The ID of the target subscription. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Name of the Container App. /// Name of the Container App Detector. @@ -202,7 +202,7 @@ public async Task> GetDetectorAsync(string } /// Get a diagnostics result of a Container App. - /// The ID of the target subscription. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Name of the Container App. /// Name of the Container App Detector. @@ -279,7 +279,7 @@ internal HttpMessage CreateListRevisionsRequest(string subscriptionId, string re } /// Get the Revisions for a given Container App. - /// The ID of the target subscription. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Name of the Container App for which Revisions are needed. /// The filter to apply on the operation. @@ -309,7 +309,7 @@ public async Task> ListRevisionsAsync(string subscr } /// Get the Revisions for a given Container App. - /// The ID of the target subscription. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Name of the Container App for which Revisions are needed. /// The filter to apply on the operation. @@ -377,7 +377,7 @@ internal HttpMessage CreateGetRevisionRequest(string subscriptionId, string reso } /// Get a revision of a Container App. - /// The ID of the target subscription. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Name of the Container App. /// Name of the Container App Revision. @@ -410,7 +410,7 @@ public async Task> GetRevisionAsync(string su } /// Get a revision of a Container App. - /// The ID of the target subscription. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Name of the Container App. /// Name of the Container App Revision. @@ -479,7 +479,7 @@ internal HttpMessage CreateGetRootRequest(string subscriptionId, string resource } /// Get the properties of a Container App. - /// The ID of the target subscription. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Name of the Container App. /// The cancellation token to use. @@ -510,7 +510,7 @@ public async Task> GetRootAsync(string subscriptionId } /// Get the properties of a Container App. - /// The ID of the target subscription. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Name of the Container App. /// The cancellation token to use. @@ -564,7 +564,7 @@ internal HttpMessage CreateListDetectorsNextPageRequest(string nextLink, string /// Get the list of diagnostics for a given Container App. /// The URL to the next page of results. - /// The ID of the target subscription. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Name of the Container App for which detector info is needed. /// The cancellation token to use. @@ -595,7 +595,7 @@ public async Task> ListDetectorsNextPageAsync(st /// Get the list of diagnostics for a given Container App. /// The URL to the next page of results. - /// The ID of the target subscription. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Name of the Container App for which detector info is needed. /// The cancellation token to use. @@ -648,7 +648,7 @@ internal HttpMessage CreateListRevisionsNextPageRequest(string nextLink, string /// Get the Revisions for a given Container App. /// The URL to the next page of results. - /// The ID of the target subscription. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Name of the Container App for which Revisions are needed. /// The filter to apply on the operation. @@ -680,7 +680,7 @@ public async Task> ListRevisionsNextPageAsync(strin /// Get the Revisions for a given Container App. /// The URL to the next page of results. - /// The ID of the target subscription. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Name of the Container App for which Revisions are needed. /// The filter to apply on the operation. diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/RestOperations/ContainerAppsLabelHistoryRestOperations.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/RestOperations/ContainerAppsLabelHistoryRestOperations.cs new file mode 100644 index 000000000000..d4a6e5e26fe9 --- /dev/null +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/RestOperations/ContainerAppsLabelHistoryRestOperations.cs @@ -0,0 +1,425 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.AppContainers.Models; + +namespace Azure.ResourceManager.AppContainers +{ + internal partial class ContainerAppsLabelHistoryRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of ContainerAppsLabelHistoryRestOperations. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// The application id to use for user agent. + /// server parameter. + /// Api Version. + /// or is null. + public ContainerAppsLabelHistoryRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) + { + _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); + _endpoint = endpoint ?? new Uri("https://management.azure.com"); + _apiVersion = apiVersion ?? "2025-02-02-preview"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal RequestUriBuilder CreateListLabelHistoryRequestUri(string subscriptionId, string resourceGroupName, string containerAppName, string filter) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.App/containerApps/", false); + uri.AppendPath(containerAppName, true); + uri.AppendPath("/labelHistory", false); + uri.AppendQuery("api-version", _apiVersion, true); + if (filter != null) + { + uri.AppendQuery("$filter", filter, true); + } + return uri; + } + + internal HttpMessage CreateListLabelHistoryRequest(string subscriptionId, string resourceGroupName, string containerAppName, string filter) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.App/containerApps/", false); + uri.AppendPath(containerAppName, true); + uri.AppendPath("/labelHistory", false); + uri.AppendQuery("api-version", _apiVersion, true); + if (filter != null) + { + uri.AppendQuery("$filter", filter, true); + } + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Get the Label History for a given Container App. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the Container App. + /// The filter to apply on the operation. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> ListLabelHistoryAsync(string subscriptionId, string resourceGroupName, string containerAppName, string filter = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(containerAppName, nameof(containerAppName)); + + using var message = CreateListLabelHistoryRequest(subscriptionId, resourceGroupName, containerAppName, filter); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + Models.LabelHistoryCollection value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = Models.LabelHistoryCollection.DeserializeLabelHistoryCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Get the Label History for a given Container App. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the Container App. + /// The filter to apply on the operation. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response ListLabelHistory(string subscriptionId, string resourceGroupName, string containerAppName, string filter = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(containerAppName, nameof(containerAppName)); + + using var message = CreateListLabelHistoryRequest(subscriptionId, resourceGroupName, containerAppName, filter); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + Models.LabelHistoryCollection value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = Models.LabelHistoryCollection.DeserializeLabelHistoryCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateGetLabelHistoryRequestUri(string subscriptionId, string resourceGroupName, string containerAppName, string labelName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.App/containerApps/", false); + uri.AppendPath(containerAppName, true); + uri.AppendPath("/labelHistory/", false); + uri.AppendPath(labelName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateGetLabelHistoryRequest(string subscriptionId, string resourceGroupName, string containerAppName, string labelName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.App/containerApps/", false); + uri.AppendPath(containerAppName, true); + uri.AppendPath("/labelHistory/", false); + uri.AppendPath(labelName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Get the history of a label. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the Container App. + /// Name of the Container App label. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task> GetLabelHistoryAsync(string subscriptionId, string resourceGroupName, string containerAppName, string labelName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(containerAppName, nameof(containerAppName)); + Argument.AssertNotNullOrEmpty(labelName, nameof(labelName)); + + using var message = CreateGetLabelHistoryRequest(subscriptionId, resourceGroupName, containerAppName, labelName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + LabelHistoryData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = LabelHistoryData.DeserializeLabelHistoryData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((LabelHistoryData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + /// Get the history of a label. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the Container App. + /// Name of the Container App label. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response GetLabelHistory(string subscriptionId, string resourceGroupName, string containerAppName, string labelName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(containerAppName, nameof(containerAppName)); + Argument.AssertNotNullOrEmpty(labelName, nameof(labelName)); + + using var message = CreateGetLabelHistoryRequest(subscriptionId, resourceGroupName, containerAppName, labelName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + LabelHistoryData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = LabelHistoryData.DeserializeLabelHistoryData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((LabelHistoryData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateDeleteLabelHistoryRequestUri(string subscriptionId, string resourceGroupName, string containerAppName, string labelName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.App/containerApps/", false); + uri.AppendPath(containerAppName, true); + uri.AppendPath("/labelHistory/", false); + uri.AppendPath(labelName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateDeleteLabelHistoryRequest(string subscriptionId, string resourceGroupName, string containerAppName, string labelName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Delete; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.App/containerApps/", false); + uri.AppendPath(containerAppName, true); + uri.AppendPath("/labelHistory/", false); + uri.AppendPath(labelName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Delete the history of a label. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the Container App. + /// Name of the Container App label. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task DeleteLabelHistoryAsync(string subscriptionId, string resourceGroupName, string containerAppName, string labelName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(containerAppName, nameof(containerAppName)); + Argument.AssertNotNullOrEmpty(labelName, nameof(labelName)); + + using var message = CreateDeleteLabelHistoryRequest(subscriptionId, resourceGroupName, containerAppName, labelName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Delete the history of a label. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the Container App. + /// Name of the Container App label. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response DeleteLabelHistory(string subscriptionId, string resourceGroupName, string containerAppName, string labelName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(containerAppName, nameof(containerAppName)); + Argument.AssertNotNullOrEmpty(labelName, nameof(labelName)); + + using var message = CreateDeleteLabelHistoryRequest(subscriptionId, resourceGroupName, containerAppName, labelName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListLabelHistoryNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName, string containerAppName, string filter) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + return uri; + } + + internal HttpMessage CreateListLabelHistoryNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string containerAppName, string filter) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Get the Label History for a given Container App. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the Container App. + /// The filter to apply on the operation. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> ListLabelHistoryNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string containerAppName, string filter = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(containerAppName, nameof(containerAppName)); + + using var message = CreateListLabelHistoryNextPageRequest(nextLink, subscriptionId, resourceGroupName, containerAppName, filter); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + Models.LabelHistoryCollection value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = Models.LabelHistoryCollection.DeserializeLabelHistoryCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Get the Label History for a given Container App. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the Container App. + /// The filter to apply on the operation. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response ListLabelHistoryNextPage(string nextLink, string subscriptionId, string resourceGroupName, string containerAppName, string filter = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(containerAppName, nameof(containerAppName)); + + using var message = CreateListLabelHistoryNextPageRequest(nextLink, subscriptionId, resourceGroupName, containerAppName, filter); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + Models.LabelHistoryCollection value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = Models.LabelHistoryCollection.DeserializeLabelHistoryCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/RestOperations/ContainerAppsPatchesRestOperations.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/RestOperations/ContainerAppsPatchesRestOperations.cs new file mode 100644 index 000000000000..7d74ec053952 --- /dev/null +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/RestOperations/ContainerAppsPatchesRestOperations.cs @@ -0,0 +1,619 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.AppContainers.Models; + +namespace Azure.ResourceManager.AppContainers +{ + internal partial class ContainerAppsPatchesRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of ContainerAppsPatchesRestOperations. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// The application id to use for user agent. + /// server parameter. + /// Api Version. + /// or is null. + public ContainerAppsPatchesRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) + { + _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); + _endpoint = endpoint ?? new Uri("https://management.azure.com"); + _apiVersion = apiVersion ?? "2025-02-02-preview"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal RequestUriBuilder CreateListByContainerAppRequestUri(string subscriptionId, string resourceGroupName, string containerAppName, string filter) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.App/containerApps/", false); + uri.AppendPath(containerAppName, true); + uri.AppendPath("/patches", false); + uri.AppendQuery("api-version", _apiVersion, true); + if (filter != null) + { + uri.AppendQuery("$filter", filter, true); + } + return uri; + } + + internal HttpMessage CreateListByContainerAppRequest(string subscriptionId, string resourceGroupName, string containerAppName, string filter) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.App/containerApps/", false); + uri.AppendPath(containerAppName, true); + uri.AppendPath("/patches", false); + uri.AppendQuery("api-version", _apiVersion, true); + if (filter != null) + { + uri.AppendQuery("$filter", filter, true); + } + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List Container Apps Patch resources by ContainerApp. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the Container App the Patch is associated. + /// The filter to apply on the operation. For example, $filter=properties/patchApplyStatus eq 'Succeeded'. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> ListByContainerAppAsync(string subscriptionId, string resourceGroupName, string containerAppName, string filter = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(containerAppName, nameof(containerAppName)); + + using var message = CreateListByContainerAppRequest(subscriptionId, resourceGroupName, containerAppName, filter); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + PatchCollection value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = PatchCollection.DeserializePatchCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List Container Apps Patch resources by ContainerApp. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the Container App the Patch is associated. + /// The filter to apply on the operation. For example, $filter=properties/patchApplyStatus eq 'Succeeded'. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response ListByContainerApp(string subscriptionId, string resourceGroupName, string containerAppName, string filter = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(containerAppName, nameof(containerAppName)); + + using var message = CreateListByContainerAppRequest(subscriptionId, resourceGroupName, containerAppName, filter); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + PatchCollection value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = PatchCollection.DeserializePatchCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string containerAppName, string patchName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.App/containerApps/", false); + uri.AppendPath(containerAppName, true); + uri.AppendPath("/patches/", false); + uri.AppendPath(patchName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string containerAppName, string patchName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.App/containerApps/", false); + uri.AppendPath(containerAppName, true); + uri.AppendPath("/patches/", false); + uri.AppendPath(patchName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Get details for specific Container Apps Patch by patch name. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the Container App the Patch is associated. + /// The name of the patch. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task> GetAsync(string subscriptionId, string resourceGroupName, string containerAppName, string patchName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(containerAppName, nameof(containerAppName)); + Argument.AssertNotNullOrEmpty(patchName, nameof(patchName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, containerAppName, patchName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + ContainerAppsPatchResourceData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = ContainerAppsPatchResourceData.DeserializeContainerAppsPatchResourceData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((ContainerAppsPatchResourceData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + /// Get details for specific Container Apps Patch by patch name. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the Container App the Patch is associated. + /// The name of the patch. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response Get(string subscriptionId, string resourceGroupName, string containerAppName, string patchName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(containerAppName, nameof(containerAppName)); + Argument.AssertNotNullOrEmpty(patchName, nameof(patchName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, containerAppName, patchName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + ContainerAppsPatchResourceData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = ContainerAppsPatchResourceData.DeserializeContainerAppsPatchResourceData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((ContainerAppsPatchResourceData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string resourceGroupName, string containerAppName, string patchName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.App/containerApps/", false); + uri.AppendPath(containerAppName, true); + uri.AppendPath("/patches/", false); + uri.AppendPath(patchName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string containerAppName, string patchName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Delete; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.App/containerApps/", false); + uri.AppendPath(containerAppName, true); + uri.AppendPath("/patches/", false); + uri.AppendPath(patchName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Delete specific Container Apps Patch by patch name. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the Container App the Patch is associated. + /// The name of the patch. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task DeleteAsync(string subscriptionId, string resourceGroupName, string containerAppName, string patchName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(containerAppName, nameof(containerAppName)); + Argument.AssertNotNullOrEmpty(patchName, nameof(patchName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, containerAppName, patchName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Delete specific Container Apps Patch by patch name. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the Container App the Patch is associated. + /// The name of the patch. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response Delete(string subscriptionId, string resourceGroupName, string containerAppName, string patchName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(containerAppName, nameof(containerAppName)); + Argument.AssertNotNullOrEmpty(patchName, nameof(patchName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, containerAppName, patchName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateSkipConfigureRequestUri(string subscriptionId, string resourceGroupName, string containerAppName, string patchName, PatchSkipConfig patchSkipConfig) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.App/containerApps/", false); + uri.AppendPath(containerAppName, true); + uri.AppendPath("/patches/", false); + uri.AppendPath(patchName, true); + uri.AppendPath("/skipConfig", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateSkipConfigureRequest(string subscriptionId, string resourceGroupName, string containerAppName, string patchName, PatchSkipConfig patchSkipConfig) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.App/containerApps/", false); + uri.AppendPath(containerAppName, true); + uri.AppendPath("/patches/", false); + uri.AppendPath(patchName, true); + uri.AppendPath("/skipConfig", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(patchSkipConfig, ModelSerializationExtensions.WireOptions); + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// Configure the Container Apps Patch skip option by patch name. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the Container App the Patch is associated. + /// The name of the patch. + /// Configure patcher to skip a patch or not. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task SkipConfigureAsync(string subscriptionId, string resourceGroupName, string containerAppName, string patchName, PatchSkipConfig patchSkipConfig, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(containerAppName, nameof(containerAppName)); + Argument.AssertNotNullOrEmpty(patchName, nameof(patchName)); + Argument.AssertNotNull(patchSkipConfig, nameof(patchSkipConfig)); + + using var message = CreateSkipConfigureRequest(subscriptionId, resourceGroupName, containerAppName, patchName, patchSkipConfig); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Configure the Container Apps Patch skip option by patch name. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the Container App the Patch is associated. + /// The name of the patch. + /// Configure patcher to skip a patch or not. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response SkipConfigure(string subscriptionId, string resourceGroupName, string containerAppName, string patchName, PatchSkipConfig patchSkipConfig, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(containerAppName, nameof(containerAppName)); + Argument.AssertNotNullOrEmpty(patchName, nameof(patchName)); + Argument.AssertNotNull(patchSkipConfig, nameof(patchSkipConfig)); + + using var message = CreateSkipConfigureRequest(subscriptionId, resourceGroupName, containerAppName, patchName, patchSkipConfig); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateApplyRequestUri(string subscriptionId, string resourceGroupName, string containerAppName, string patchName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.App/containerApps/", false); + uri.AppendPath(containerAppName, true); + uri.AppendPath("/patches/", false); + uri.AppendPath(patchName, true); + uri.AppendPath("/apply", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateApplyRequest(string subscriptionId, string resourceGroupName, string containerAppName, string patchName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.App/containerApps/", false); + uri.AppendPath(containerAppName, true); + uri.AppendPath("/patches/", false); + uri.AppendPath(patchName, true); + uri.AppendPath("/apply", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Apply a Container Apps Patch resource with patch name. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the Container App the Patch is associated. + /// The name of the patch. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task ApplyAsync(string subscriptionId, string resourceGroupName, string containerAppName, string patchName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(containerAppName, nameof(containerAppName)); + Argument.AssertNotNullOrEmpty(patchName, nameof(patchName)); + + using var message = CreateApplyRequest(subscriptionId, resourceGroupName, containerAppName, patchName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Apply a Container Apps Patch resource with patch name. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the Container App the Patch is associated. + /// The name of the patch. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response Apply(string subscriptionId, string resourceGroupName, string containerAppName, string patchName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(containerAppName, nameof(containerAppName)); + Argument.AssertNotNullOrEmpty(patchName, nameof(patchName)); + + using var message = CreateApplyRequest(subscriptionId, resourceGroupName, containerAppName, patchName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListByContainerAppNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName, string containerAppName, string filter) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + return uri; + } + + internal HttpMessage CreateListByContainerAppNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string containerAppName, string filter) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List Container Apps Patch resources by ContainerApp. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the Container App the Patch is associated. + /// The filter to apply on the operation. For example, $filter=properties/patchApplyStatus eq 'Succeeded'. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> ListByContainerAppNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string containerAppName, string filter = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(containerAppName, nameof(containerAppName)); + + using var message = CreateListByContainerAppNextPageRequest(nextLink, subscriptionId, resourceGroupName, containerAppName, filter); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + PatchCollection value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = PatchCollection.DeserializePatchCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List Container Apps Patch resources by ContainerApp. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the Container App the Patch is associated. + /// The filter to apply on the operation. For example, $filter=properties/patchApplyStatus eq 'Succeeded'. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response ListByContainerAppNextPage(string nextLink, string subscriptionId, string resourceGroupName, string containerAppName, string filter = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(containerAppName, nameof(containerAppName)); + + using var message = CreateListByContainerAppNextPageRequest(nextLink, subscriptionId, resourceGroupName, containerAppName, filter); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + PatchCollection value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = PatchCollection.DeserializePatchCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/RestOperations/ContainerAppsRestOperations.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/RestOperations/ContainerAppsRestOperations.cs index 0aaae77525ff..fcfb786bf336 100644 --- a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/RestOperations/ContainerAppsRestOperations.cs +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/RestOperations/ContainerAppsRestOperations.cs @@ -32,7 +32,7 @@ public ContainerAppsRestOperations(HttpPipeline pipeline, string applicationId, { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2025-01-01"; + _apiVersion = apiVersion ?? "2025-02-02-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } @@ -65,7 +65,7 @@ internal HttpMessage CreateListBySubscriptionRequest(string subscriptionId) } /// Get the Container Apps in a given subscription. - /// The ID of the target subscription. + /// The ID of the target subscription. The value must be an UUID. /// The cancellation token to use. /// is null. /// is an empty string, and was expected to be non-empty. @@ -90,7 +90,7 @@ internal HttpMessage CreateListBySubscriptionRequest(string subscriptionId) } /// Get the Container Apps in a given subscription. - /// The ID of the target subscription. + /// The ID of the target subscription. The value must be an UUID. /// The cancellation token to use. /// is null. /// is an empty string, and was expected to be non-empty. @@ -147,7 +147,7 @@ internal HttpMessage CreateListByResourceGroupRequest(string subscriptionId, str } /// Get the Container Apps in a given resource group. - /// The ID of the target subscription. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// The cancellation token to use. /// or is null. @@ -174,7 +174,7 @@ internal HttpMessage CreateListByResourceGroupRequest(string subscriptionId, str } /// Get the Container Apps in a given resource group. - /// The ID of the target subscription. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// The cancellation token to use. /// or is null. @@ -235,7 +235,7 @@ internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGrou } /// Get the properties of a Container App. - /// The ID of the target subscription. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Name of the Container App. /// The cancellation token to use. @@ -266,7 +266,7 @@ public async Task> GetAsync(string subscriptionId, st } /// Get the properties of a Container App. - /// The ID of the target subscription. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Name of the Container App. /// The cancellation token to use. @@ -335,7 +335,7 @@ internal HttpMessage CreateCreateOrUpdateRequest(string subscriptionId, string r } /// Create or update a Container App. - /// The ID of the target subscription. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Name of the Container App. /// Properties used to create a container app. @@ -362,7 +362,7 @@ public async Task CreateOrUpdateAsync(string subscriptionId, string re } /// Create or update a Container App. - /// The ID of the target subscription. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Name of the Container App. /// Properties used to create a container app. @@ -423,7 +423,7 @@ internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceG } /// Delete a Container App. - /// The ID of the target subscription. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Name of the Container App. /// The cancellation token to use. @@ -449,7 +449,7 @@ public async Task DeleteAsync(string subscriptionId, string resourceGr } /// Delete a Container App. - /// The ID of the target subscription. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Name of the Container App. /// The cancellation token to use. @@ -513,7 +513,7 @@ internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceG } /// Patches a Container App using JSON Merge Patch. - /// The ID of the target subscription. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Name of the Container App. /// Properties of a Container App that need to be updated. @@ -540,7 +540,7 @@ public async Task UpdateAsync(string subscriptionId, string resourceGr } /// Patches a Container App using JSON Merge Patch. - /// The ID of the target subscription. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Name of the Container App. /// Properties of a Container App that need to be updated. @@ -611,7 +611,7 @@ internal HttpMessage CreateListCustomHostNameAnalysisRequest(string subscription } /// Analyzes a custom hostname for a Container App. - /// The ID of the target subscription. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Name of the Container App. /// Custom hostname. @@ -641,7 +641,7 @@ public async Task> ListCustom } /// Analyzes a custom hostname for a Container App. - /// The ID of the target subscription. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Name of the Container App. /// Custom hostname. @@ -707,7 +707,7 @@ internal HttpMessage CreateListSecretsRequest(string subscriptionId, string reso } /// List secrets for a container app. - /// The ID of the target subscription. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Name of the Container App. /// The cancellation token to use. @@ -736,7 +736,7 @@ public async Task> ListSecretsAsync(string subscript } /// List secrets for a container app. - /// The ID of the target subscription. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Name of the Container App. /// The cancellation token to use. @@ -801,7 +801,7 @@ internal HttpMessage CreateGetAuthTokenRequest(string subscriptionId, string res } /// Get auth token for a container app. - /// The ID of the target subscription. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Name of the Container App. /// The cancellation token to use. @@ -830,7 +830,7 @@ public async Task> GetAuthTokenAsync(string subs } /// Get auth token for a container app. - /// The ID of the target subscription. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Name of the Container App. /// The cancellation token to use. @@ -895,7 +895,7 @@ internal HttpMessage CreateStartRequest(string subscriptionId, string resourceGr } /// Start a container app. - /// The ID of the target subscription. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Name of the Container App. /// The cancellation token to use. @@ -920,7 +920,7 @@ public async Task StartAsync(string subscriptionId, string resourceGro } /// Start a container app. - /// The ID of the target subscription. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Name of the Container App. /// The cancellation token to use. @@ -981,7 +981,7 @@ internal HttpMessage CreateStopRequest(string subscriptionId, string resourceGro } /// Stop a container app. - /// The ID of the target subscription. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Name of the Container App. /// The cancellation token to use. @@ -1006,7 +1006,7 @@ public async Task StopAsync(string subscriptionId, string resourceGrou } /// Stop a container app. - /// The ID of the target subscription. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Name of the Container App. /// The cancellation token to use. @@ -1054,7 +1054,7 @@ internal HttpMessage CreateListBySubscriptionNextPageRequest(string nextLink, st /// Get the Container Apps in a given subscription. /// The URL to the next page of results. - /// The ID of the target subscription. + /// The ID of the target subscription. The value must be an UUID. /// The cancellation token to use. /// or is null. /// is an empty string, and was expected to be non-empty. @@ -1081,7 +1081,7 @@ internal HttpMessage CreateListBySubscriptionNextPageRequest(string nextLink, st /// Get the Container Apps in a given subscription. /// The URL to the next page of results. - /// The ID of the target subscription. + /// The ID of the target subscription. The value must be an UUID. /// The cancellation token to use. /// or is null. /// is an empty string, and was expected to be non-empty. @@ -1130,7 +1130,7 @@ internal HttpMessage CreateListByResourceGroupNextPageRequest(string nextLink, s /// Get the Container Apps in a given resource group. /// The URL to the next page of results. - /// The ID of the target subscription. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// The cancellation token to use. /// , or is null. @@ -1159,7 +1159,7 @@ internal HttpMessage CreateListByResourceGroupNextPageRequest(string nextLink, s /// Get the Container Apps in a given resource group. /// The URL to the next page of results. - /// The ID of the target subscription. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// The cancellation token to use. /// , or is null. diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/RestOperations/ContainerAppsRevisionReplicasRestOperations.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/RestOperations/ContainerAppsRevisionReplicasRestOperations.cs index 6f05f90f845d..df315ef16361 100644 --- a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/RestOperations/ContainerAppsRevisionReplicasRestOperations.cs +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/RestOperations/ContainerAppsRevisionReplicasRestOperations.cs @@ -32,7 +32,7 @@ public ContainerAppsRevisionReplicasRestOperations(HttpPipeline pipeline, string { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2025-01-01"; + _apiVersion = apiVersion ?? "2025-02-02-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } @@ -79,7 +79,7 @@ internal HttpMessage CreateGetReplicaRequest(string subscriptionId, string resou } /// Get a replica for a Container App Revision. - /// The ID of the target subscription. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Name of the Container App. /// Name of the Container App Revision. @@ -114,7 +114,7 @@ public async Task> GetReplicaAsync(string subs } /// Get a replica for a Container App Revision. - /// The ID of the target subscription. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Name of the Container App. /// Name of the Container App Revision. @@ -189,7 +189,7 @@ internal HttpMessage CreateListReplicasRequest(string subscriptionId, string res } /// List replicas for a Container App Revision. - /// The ID of the target subscription. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Name of the Container App. /// Name of the Container App Revision. @@ -220,7 +220,7 @@ public async Task> ListReplicasAsync(string subscrip } /// List replicas for a Container App Revision. - /// The ID of the target subscription. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Name of the Container App. /// Name of the Container App Revision. diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/RestOperations/ContainerAppsRevisionsRestOperations.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/RestOperations/ContainerAppsRevisionsRestOperations.cs index 563166c21d37..a28aab587348 100644 --- a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/RestOperations/ContainerAppsRevisionsRestOperations.cs +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/RestOperations/ContainerAppsRevisionsRestOperations.cs @@ -32,7 +32,7 @@ public ContainerAppsRevisionsRestOperations(HttpPipeline pipeline, string applic { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2025-01-01"; + _apiVersion = apiVersion ?? "2025-02-02-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } @@ -81,7 +81,7 @@ internal HttpMessage CreateListRevisionsRequest(string subscriptionId, string re } /// Get the Revisions for a given Container App. - /// The ID of the target subscription. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Name of the Container App for which Revisions are needed. /// The filter to apply on the operation. @@ -111,7 +111,7 @@ public async Task> ListRevisionsAsync(string subscr } /// Get the Revisions for a given Container App. - /// The ID of the target subscription. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Name of the Container App for which Revisions are needed. /// The filter to apply on the operation. @@ -179,7 +179,7 @@ internal HttpMessage CreateGetRevisionRequest(string subscriptionId, string reso } /// Get a revision of a Container App. - /// The ID of the target subscription. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Name of the Container App. /// Name of the Container App Revision. @@ -212,7 +212,7 @@ public async Task> GetRevisionAsync(string su } /// Get a revision of a Container App. - /// The ID of the target subscription. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Name of the Container App. /// Name of the Container App Revision. @@ -285,7 +285,7 @@ internal HttpMessage CreateActivateRevisionRequest(string subscriptionId, string } /// Activates a revision for a Container App. - /// The ID of the target subscription. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Name of the Container App. /// Name of the Container App Revision. @@ -311,7 +311,7 @@ public async Task ActivateRevisionAsync(string subscriptionId, string } /// Activates a revision for a Container App. - /// The ID of the target subscription. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Name of the Container App. /// Name of the Container App Revision. @@ -377,7 +377,7 @@ internal HttpMessage CreateDeactivateRevisionRequest(string subscriptionId, stri } /// Deactivates a revision for a Container App. - /// The ID of the target subscription. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Name of the Container App. /// Name of the Container App Revision. @@ -403,7 +403,7 @@ public async Task DeactivateRevisionAsync(string subscriptionId, strin } /// Deactivates a revision for a Container App. - /// The ID of the target subscription. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Name of the Container App. /// Name of the Container App Revision. @@ -469,7 +469,7 @@ internal HttpMessage CreateRestartRevisionRequest(string subscriptionId, string } /// Restarts a revision for a Container App. - /// The ID of the target subscription. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Name of the Container App. /// Name of the Container App Revision. @@ -495,7 +495,7 @@ public async Task RestartRevisionAsync(string subscriptionId, string r } /// Restarts a revision for a Container App. - /// The ID of the target subscription. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Name of the Container App. /// Name of the Container App Revision. @@ -544,7 +544,7 @@ internal HttpMessage CreateListRevisionsNextPageRequest(string nextLink, string /// Get the Revisions for a given Container App. /// The URL to the next page of results. - /// The ID of the target subscription. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Name of the Container App for which Revisions are needed. /// The filter to apply on the operation. @@ -576,7 +576,7 @@ public async Task> ListRevisionsNextPageAsync(strin /// Get the Revisions for a given Container App. /// The URL to the next page of results. - /// The ID of the target subscription. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Name of the Container App for which Revisions are needed. /// The filter to apply on the operation. diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/RestOperations/ContainerAppsSessionPoolsRestOperations.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/RestOperations/ContainerAppsSessionPoolsRestOperations.cs index 41b4c231b4dd..8a57f93a40d3 100644 --- a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/RestOperations/ContainerAppsSessionPoolsRestOperations.cs +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/RestOperations/ContainerAppsSessionPoolsRestOperations.cs @@ -32,7 +32,7 @@ public ContainerAppsSessionPoolsRestOperations(HttpPipeline pipeline, string app { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2025-01-01"; + _apiVersion = apiVersion ?? "2025-02-02-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } @@ -65,7 +65,7 @@ internal HttpMessage CreateListBySubscriptionRequest(string subscriptionId) } /// Get the session pools in a given subscription. - /// The ID of the target subscription. + /// The ID of the target subscription. The value must be an UUID. /// The cancellation token to use. /// is null. /// is an empty string, and was expected to be non-empty. @@ -90,7 +90,7 @@ internal HttpMessage CreateListBySubscriptionRequest(string subscriptionId) } /// Get the session pools in a given subscription. - /// The ID of the target subscription. + /// The ID of the target subscription. The value must be an UUID. /// The cancellation token to use. /// is null. /// is an empty string, and was expected to be non-empty. @@ -147,7 +147,7 @@ internal HttpMessage CreateListByResourceGroupRequest(string subscriptionId, str } /// Get the session pools in a given resource group of a subscription. - /// The ID of the target subscription. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// The cancellation token to use. /// or is null. @@ -174,7 +174,7 @@ internal HttpMessage CreateListByResourceGroupRequest(string subscriptionId, str } /// Get the session pools in a given resource group of a subscription. - /// The ID of the target subscription. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// The cancellation token to use. /// or is null. @@ -235,7 +235,7 @@ internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGrou } /// Get the properties of a session pool. - /// The ID of the target subscription. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Name of the session pool. /// The cancellation token to use. @@ -266,7 +266,7 @@ public async Task> GetAsync(string subscriptionId, str } /// Get the properties of a session pool. - /// The ID of the target subscription. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Name of the session pool. /// The cancellation token to use. @@ -335,7 +335,7 @@ internal HttpMessage CreateCreateOrUpdateRequest(string subscriptionId, string r } /// Create or update a session pool with the given properties. - /// The ID of the target subscription. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Name of the session pool. /// Properties used to create a session pool. @@ -362,7 +362,7 @@ public async Task CreateOrUpdateAsync(string subscriptionId, string re } /// Create or update a session pool with the given properties. - /// The ID of the target subscription. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Name of the session pool. /// Properties used to create a session pool. @@ -427,7 +427,7 @@ internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceG } /// Patches a session pool using JSON merge patch. - /// The ID of the target subscription. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Name of the session pool. /// Properties used to create a session pool. @@ -454,7 +454,7 @@ public async Task UpdateAsync(string subscriptionId, string resourceGr } /// Patches a session pool using JSON merge patch. - /// The ID of the target subscription. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Name of the session pool. /// Properties used to create a session pool. @@ -515,7 +515,7 @@ internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceG } /// Delete the session pool with the given name. - /// The ID of the target subscription. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Name of the session pool. /// The cancellation token to use. @@ -540,7 +540,7 @@ public async Task DeleteAsync(string subscriptionId, string resourceGr } /// Delete the session pool with the given name. - /// The ID of the target subscription. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Name of the session pool. /// The cancellation token to use. @@ -588,7 +588,7 @@ internal HttpMessage CreateListBySubscriptionNextPageRequest(string nextLink, st /// Get the session pools in a given subscription. /// The URL to the next page of results. - /// The ID of the target subscription. + /// The ID of the target subscription. The value must be an UUID. /// The cancellation token to use. /// or is null. /// is an empty string, and was expected to be non-empty. @@ -615,7 +615,7 @@ internal HttpMessage CreateListBySubscriptionNextPageRequest(string nextLink, st /// Get the session pools in a given subscription. /// The URL to the next page of results. - /// The ID of the target subscription. + /// The ID of the target subscription. The value must be an UUID. /// The cancellation token to use. /// or is null. /// is an empty string, and was expected to be non-empty. @@ -664,7 +664,7 @@ internal HttpMessage CreateListByResourceGroupNextPageRequest(string nextLink, s /// Get the session pools in a given resource group of a subscription. /// The URL to the next page of results. - /// The ID of the target subscription. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// The cancellation token to use. /// , or is null. @@ -693,7 +693,7 @@ internal HttpMessage CreateListByResourceGroupNextPageRequest(string nextLink, s /// Get the session pools in a given resource group of a subscription. /// The URL to the next page of results. - /// The ID of the target subscription. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// The cancellation token to use. /// , or is null. diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/RestOperations/ContainerAppsSourceControlsRestOperations.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/RestOperations/ContainerAppsSourceControlsRestOperations.cs index bfddc824548e..9b41e9868738 100644 --- a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/RestOperations/ContainerAppsSourceControlsRestOperations.cs +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/RestOperations/ContainerAppsSourceControlsRestOperations.cs @@ -32,7 +32,7 @@ public ContainerAppsSourceControlsRestOperations(HttpPipeline pipeline, string a { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2025-01-01"; + _apiVersion = apiVersion ?? "2025-02-02-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } @@ -73,7 +73,7 @@ internal HttpMessage CreateListByContainerAppRequest(string subscriptionId, stri } /// Get the Container App SourceControls in a given resource group. - /// The ID of the target subscription. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Name of the Container App. /// The cancellation token to use. @@ -102,7 +102,7 @@ public async Task> ListByContainerAppAsync(str } /// Get the Container App SourceControls in a given resource group. - /// The ID of the target subscription. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Name of the Container App. /// The cancellation token to use. @@ -169,7 +169,7 @@ internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGrou } /// Get a SourceControl of a Container App. - /// The ID of the target subscription. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Name of the Container App. /// Name of the Container App SourceControl. @@ -202,7 +202,7 @@ public async Task> GetAsync(string subsc } /// Get a SourceControl of a Container App. - /// The ID of the target subscription. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Name of the Container App. /// Name of the Container App SourceControl. @@ -234,7 +234,7 @@ public Response Get(string subscriptionId, string } } - internal RequestUriBuilder CreateCreateOrUpdateRequestUri(string subscriptionId, string resourceGroupName, string containerAppName, string sourceControlName, ContainerAppSourceControlData data) + internal RequestUriBuilder CreateCreateOrUpdateRequestUri(string subscriptionId, string resourceGroupName, string containerAppName, string sourceControlName, ContainerAppSourceControlData data, string xMsGitHubAuxiliary) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -250,7 +250,7 @@ internal RequestUriBuilder CreateCreateOrUpdateRequestUri(string subscriptionId, return uri; } - internal HttpMessage CreateCreateOrUpdateRequest(string subscriptionId, string resourceGroupName, string containerAppName, string sourceControlName, ContainerAppSourceControlData data) + internal HttpMessage CreateCreateOrUpdateRequest(string subscriptionId, string resourceGroupName, string containerAppName, string sourceControlName, ContainerAppSourceControlData data, string xMsGitHubAuxiliary) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -267,6 +267,10 @@ internal HttpMessage CreateCreateOrUpdateRequest(string subscriptionId, string r uri.AppendPath(sourceControlName, true); uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; + if (xMsGitHubAuxiliary != null) + { + request.Headers.Add("x-ms-github-auxiliary", xMsGitHubAuxiliary); + } request.Headers.Add("Accept", "application/json"); request.Headers.Add("Content-Type", "application/json"); var content = new Utf8JsonRequestContent(); @@ -277,15 +281,16 @@ internal HttpMessage CreateCreateOrUpdateRequest(string subscriptionId, string r } /// Create or update the SourceControl for a Container App. - /// The ID of the target subscription. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Name of the Container App. /// Name of the Container App SourceControl. /// Properties used to create a Container App SourceControl. + /// Github personal access token used for SourceControl. /// The cancellation token to use. /// , , , or is null. /// , , or is an empty string, and was expected to be non-empty. - public async Task CreateOrUpdateAsync(string subscriptionId, string resourceGroupName, string containerAppName, string sourceControlName, ContainerAppSourceControlData data, CancellationToken cancellationToken = default) + public async Task CreateOrUpdateAsync(string subscriptionId, string resourceGroupName, string containerAppName, string sourceControlName, ContainerAppSourceControlData data, string xMsGitHubAuxiliary = null, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); @@ -293,7 +298,7 @@ public async Task CreateOrUpdateAsync(string subscriptionId, string re Argument.AssertNotNullOrEmpty(sourceControlName, nameof(sourceControlName)); Argument.AssertNotNull(data, nameof(data)); - using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, containerAppName, sourceControlName, data); + using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, containerAppName, sourceControlName, data, xMsGitHubAuxiliary); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { @@ -306,15 +311,16 @@ public async Task CreateOrUpdateAsync(string subscriptionId, string re } /// Create or update the SourceControl for a Container App. - /// The ID of the target subscription. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Name of the Container App. /// Name of the Container App SourceControl. /// Properties used to create a Container App SourceControl. + /// Github personal access token used for SourceControl. /// The cancellation token to use. /// , , , or is null. /// , , or is an empty string, and was expected to be non-empty. - public Response CreateOrUpdate(string subscriptionId, string resourceGroupName, string containerAppName, string sourceControlName, ContainerAppSourceControlData data, CancellationToken cancellationToken = default) + public Response CreateOrUpdate(string subscriptionId, string resourceGroupName, string containerAppName, string sourceControlName, ContainerAppSourceControlData data, string xMsGitHubAuxiliary = null, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); @@ -322,7 +328,7 @@ public Response CreateOrUpdate(string subscriptionId, string resourceGroupName, Argument.AssertNotNullOrEmpty(sourceControlName, nameof(sourceControlName)); Argument.AssertNotNull(data, nameof(data)); - using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, containerAppName, sourceControlName, data); + using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, containerAppName, sourceControlName, data, xMsGitHubAuxiliary); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { @@ -334,7 +340,7 @@ public Response CreateOrUpdate(string subscriptionId, string resourceGroupName, } } - internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string resourceGroupName, string containerAppName, string sourceControlName) + internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string resourceGroupName, string containerAppName, string sourceControlName, string xMsGitHubAuxiliary, bool? ignoreWorkflowDeletionFailure, bool? deleteWorkflow) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -346,11 +352,19 @@ internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string uri.AppendPath(containerAppName, true); uri.AppendPath("/sourcecontrols/", false); uri.AppendPath(sourceControlName, true); + if (ignoreWorkflowDeletionFailure != null) + { + uri.AppendQuery("ignoreWorkflowDeletionFailure", ignoreWorkflowDeletionFailure.Value, true); + } + if (deleteWorkflow != null) + { + uri.AppendQuery("deleteWorkflow", deleteWorkflow.Value, true); + } uri.AppendQuery("api-version", _apiVersion, true); return uri; } - internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string containerAppName, string sourceControlName) + internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string containerAppName, string sourceControlName, string xMsGitHubAuxiliary, bool? ignoreWorkflowDeletionFailure, bool? deleteWorkflow) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -365,29 +379,44 @@ internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceG uri.AppendPath(containerAppName, true); uri.AppendPath("/sourcecontrols/", false); uri.AppendPath(sourceControlName, true); + if (ignoreWorkflowDeletionFailure != null) + { + uri.AppendQuery("ignoreWorkflowDeletionFailure", ignoreWorkflowDeletionFailure.Value, true); + } + if (deleteWorkflow != null) + { + uri.AppendQuery("deleteWorkflow", deleteWorkflow.Value, true); + } uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; + if (xMsGitHubAuxiliary != null) + { + request.Headers.Add("x-ms-github-auxiliary", xMsGitHubAuxiliary); + } request.Headers.Add("Accept", "application/json"); _userAgent.Apply(message); return message; } /// Delete a Container App SourceControl. - /// The ID of the target subscription. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Name of the Container App. /// Name of the Container App SourceControl. + /// Github personal access token used for SourceControl. + /// Ignore Workflow Deletion Failure. + /// Delete workflow. /// The cancellation token to use. /// , , or is null. /// , , or is an empty string, and was expected to be non-empty. - public async Task DeleteAsync(string subscriptionId, string resourceGroupName, string containerAppName, string sourceControlName, CancellationToken cancellationToken = default) + public async Task DeleteAsync(string subscriptionId, string resourceGroupName, string containerAppName, string sourceControlName, string xMsGitHubAuxiliary = null, bool? ignoreWorkflowDeletionFailure = null, bool? deleteWorkflow = null, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(containerAppName, nameof(containerAppName)); Argument.AssertNotNullOrEmpty(sourceControlName, nameof(sourceControlName)); - using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, containerAppName, sourceControlName); + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, containerAppName, sourceControlName, xMsGitHubAuxiliary, ignoreWorkflowDeletionFailure, deleteWorkflow); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { @@ -401,21 +430,24 @@ public async Task DeleteAsync(string subscriptionId, string resourceGr } /// Delete a Container App SourceControl. - /// The ID of the target subscription. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Name of the Container App. /// Name of the Container App SourceControl. + /// Github personal access token used for SourceControl. + /// Ignore Workflow Deletion Failure. + /// Delete workflow. /// The cancellation token to use. /// , , or is null. /// , , or is an empty string, and was expected to be non-empty. - public Response Delete(string subscriptionId, string resourceGroupName, string containerAppName, string sourceControlName, CancellationToken cancellationToken = default) + public Response Delete(string subscriptionId, string resourceGroupName, string containerAppName, string sourceControlName, string xMsGitHubAuxiliary = null, bool? ignoreWorkflowDeletionFailure = null, bool? deleteWorkflow = null, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(containerAppName, nameof(containerAppName)); Argument.AssertNotNullOrEmpty(sourceControlName, nameof(sourceControlName)); - using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, containerAppName, sourceControlName); + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, containerAppName, sourceControlName, xMsGitHubAuxiliary, ignoreWorkflowDeletionFailure, deleteWorkflow); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { @@ -452,7 +484,7 @@ internal HttpMessage CreateListByContainerAppNextPageRequest(string nextLink, st /// Get the Container App SourceControls in a given resource group. /// The URL to the next page of results. - /// The ID of the target subscription. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Name of the Container App. /// The cancellation token to use. @@ -483,7 +515,7 @@ public async Task> ListByContainerAppNextPageA /// Get the Container App SourceControls in a given resource group. /// The URL to the next page of results. - /// The ID of the target subscription. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Name of the Container App. /// The cancellation token to use. diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/RestOperations/DaprComponentResiliencyPoliciesRestOperations.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/RestOperations/DaprComponentResiliencyPoliciesRestOperations.cs new file mode 100644 index 000000000000..2f4566cf2489 --- /dev/null +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/RestOperations/DaprComponentResiliencyPoliciesRestOperations.cs @@ -0,0 +1,559 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.AppContainers.Models; + +namespace Azure.ResourceManager.AppContainers +{ + internal partial class DaprComponentResiliencyPoliciesRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of DaprComponentResiliencyPoliciesRestOperations. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// The application id to use for user agent. + /// server parameter. + /// Api Version. + /// or is null. + public DaprComponentResiliencyPoliciesRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) + { + _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); + _endpoint = endpoint ?? new Uri("https://management.azure.com"); + _apiVersion = apiVersion ?? "2025-02-02-preview"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal RequestUriBuilder CreateListRequestUri(string subscriptionId, string resourceGroupName, string environmentName, string componentName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.App/managedEnvironments/", false); + uri.AppendPath(environmentName, true); + uri.AppendPath("/daprComponents/", false); + uri.AppendPath(componentName, true); + uri.AppendPath("/resiliencyPolicies", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateListRequest(string subscriptionId, string resourceGroupName, string environmentName, string componentName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.App/managedEnvironments/", false); + uri.AppendPath(environmentName, true); + uri.AppendPath("/daprComponents/", false); + uri.AppendPath(componentName, true); + uri.AppendPath("/resiliencyPolicies", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Get the resiliency policies for a Dapr component. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the Managed Environment. + /// Name of the Dapr Component. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task> ListAsync(string subscriptionId, string resourceGroupName, string environmentName, string componentName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(environmentName, nameof(environmentName)); + Argument.AssertNotNullOrEmpty(componentName, nameof(componentName)); + + using var message = CreateListRequest(subscriptionId, resourceGroupName, environmentName, componentName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + DaprComponentResiliencyPoliciesCollection value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = DaprComponentResiliencyPoliciesCollection.DeserializeDaprComponentResiliencyPoliciesCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Get the resiliency policies for a Dapr component. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the Managed Environment. + /// Name of the Dapr Component. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response List(string subscriptionId, string resourceGroupName, string environmentName, string componentName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(environmentName, nameof(environmentName)); + Argument.AssertNotNullOrEmpty(componentName, nameof(componentName)); + + using var message = CreateListRequest(subscriptionId, resourceGroupName, environmentName, componentName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + DaprComponentResiliencyPoliciesCollection value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = DaprComponentResiliencyPoliciesCollection.DeserializeDaprComponentResiliencyPoliciesCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string environmentName, string componentName, string name) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.App/managedEnvironments/", false); + uri.AppendPath(environmentName, true); + uri.AppendPath("/daprComponents/", false); + uri.AppendPath(componentName, true); + uri.AppendPath("/resiliencyPolicies/", false); + uri.AppendPath(name, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string environmentName, string componentName, string name) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.App/managedEnvironments/", false); + uri.AppendPath(environmentName, true); + uri.AppendPath("/daprComponents/", false); + uri.AppendPath(componentName, true); + uri.AppendPath("/resiliencyPolicies/", false); + uri.AppendPath(name, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Get a Dapr component resiliency policy. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the Managed Environment. + /// Name of the Dapr Component. + /// Name of the Dapr Component Resiliency Policy. + /// The cancellation token to use. + /// , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public async Task> GetAsync(string subscriptionId, string resourceGroupName, string environmentName, string componentName, string name, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(environmentName, nameof(environmentName)); + Argument.AssertNotNullOrEmpty(componentName, nameof(componentName)); + Argument.AssertNotNullOrEmpty(name, nameof(name)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, environmentName, componentName, name); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + DaprComponentResiliencyPolicyData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = DaprComponentResiliencyPolicyData.DeserializeDaprComponentResiliencyPolicyData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((DaprComponentResiliencyPolicyData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + /// Get a Dapr component resiliency policy. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the Managed Environment. + /// Name of the Dapr Component. + /// Name of the Dapr Component Resiliency Policy. + /// The cancellation token to use. + /// , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public Response Get(string subscriptionId, string resourceGroupName, string environmentName, string componentName, string name, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(environmentName, nameof(environmentName)); + Argument.AssertNotNullOrEmpty(componentName, nameof(componentName)); + Argument.AssertNotNullOrEmpty(name, nameof(name)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, environmentName, componentName, name); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + DaprComponentResiliencyPolicyData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = DaprComponentResiliencyPolicyData.DeserializeDaprComponentResiliencyPolicyData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((DaprComponentResiliencyPolicyData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateCreateOrUpdateRequestUri(string subscriptionId, string resourceGroupName, string environmentName, string componentName, string name, DaprComponentResiliencyPolicyData data) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.App/managedEnvironments/", false); + uri.AppendPath(environmentName, true); + uri.AppendPath("/daprComponents/", false); + uri.AppendPath(componentName, true); + uri.AppendPath("/resiliencyPolicies/", false); + uri.AppendPath(name, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateCreateOrUpdateRequest(string subscriptionId, string resourceGroupName, string environmentName, string componentName, string name, DaprComponentResiliencyPolicyData data) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Put; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.App/managedEnvironments/", false); + uri.AppendPath(environmentName, true); + uri.AppendPath("/daprComponents/", false); + uri.AppendPath(componentName, true); + uri.AppendPath("/resiliencyPolicies/", false); + uri.AppendPath(name, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(data, ModelSerializationExtensions.WireOptions); + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// Creates or updates a resiliency policy for a Dapr component. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the Managed Environment. + /// Name of the Dapr Component. + /// Name of the Dapr Component Resiliency Policy. + /// Configuration details of the Dapr Component Resiliency Policy. + /// The cancellation token to use. + /// , , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public async Task> CreateOrUpdateAsync(string subscriptionId, string resourceGroupName, string environmentName, string componentName, string name, DaprComponentResiliencyPolicyData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(environmentName, nameof(environmentName)); + Argument.AssertNotNullOrEmpty(componentName, nameof(componentName)); + Argument.AssertNotNullOrEmpty(name, nameof(name)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, environmentName, componentName, name, data); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 201: + { + DaprComponentResiliencyPolicyData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = DaprComponentResiliencyPolicyData.DeserializeDaprComponentResiliencyPolicyData(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Creates or updates a resiliency policy for a Dapr component. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the Managed Environment. + /// Name of the Dapr Component. + /// Name of the Dapr Component Resiliency Policy. + /// Configuration details of the Dapr Component Resiliency Policy. + /// The cancellation token to use. + /// , , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public Response CreateOrUpdate(string subscriptionId, string resourceGroupName, string environmentName, string componentName, string name, DaprComponentResiliencyPolicyData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(environmentName, nameof(environmentName)); + Argument.AssertNotNullOrEmpty(componentName, nameof(componentName)); + Argument.AssertNotNullOrEmpty(name, nameof(name)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, environmentName, componentName, name, data); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 201: + { + DaprComponentResiliencyPolicyData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = DaprComponentResiliencyPolicyData.DeserializeDaprComponentResiliencyPolicyData(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string resourceGroupName, string environmentName, string componentName, string name) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.App/managedEnvironments/", false); + uri.AppendPath(environmentName, true); + uri.AppendPath("/daprComponents/", false); + uri.AppendPath(componentName, true); + uri.AppendPath("/resiliencyPolicies/", false); + uri.AppendPath(name, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string environmentName, string componentName, string name) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Delete; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.App/managedEnvironments/", false); + uri.AppendPath(environmentName, true); + uri.AppendPath("/daprComponents/", false); + uri.AppendPath(componentName, true); + uri.AppendPath("/resiliencyPolicies/", false); + uri.AppendPath(name, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Delete a resiliency policy for a Dapr component. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the Managed Environment. + /// Name of the Dapr Component. + /// Name of the Dapr Component Resiliency Policy. + /// The cancellation token to use. + /// , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public async Task DeleteAsync(string subscriptionId, string resourceGroupName, string environmentName, string componentName, string name, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(environmentName, nameof(environmentName)); + Argument.AssertNotNullOrEmpty(componentName, nameof(componentName)); + Argument.AssertNotNullOrEmpty(name, nameof(name)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, environmentName, componentName, name); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Delete a resiliency policy for a Dapr component. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the Managed Environment. + /// Name of the Dapr Component. + /// Name of the Dapr Component Resiliency Policy. + /// The cancellation token to use. + /// , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public Response Delete(string subscriptionId, string resourceGroupName, string environmentName, string componentName, string name, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(environmentName, nameof(environmentName)); + Argument.AssertNotNullOrEmpty(componentName, nameof(componentName)); + Argument.AssertNotNullOrEmpty(name, nameof(name)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, environmentName, componentName, name); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName, string environmentName, string componentName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + return uri; + } + + internal HttpMessage CreateListNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string environmentName, string componentName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Get the resiliency policies for a Dapr component. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the Managed Environment. + /// Name of the Dapr Component. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task> ListNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string environmentName, string componentName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(environmentName, nameof(environmentName)); + Argument.AssertNotNullOrEmpty(componentName, nameof(componentName)); + + using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, environmentName, componentName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + DaprComponentResiliencyPoliciesCollection value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = DaprComponentResiliencyPoliciesCollection.DeserializeDaprComponentResiliencyPoliciesCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Get the resiliency policies for a Dapr component. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the Managed Environment. + /// Name of the Dapr Component. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response ListNextPage(string nextLink, string subscriptionId, string resourceGroupName, string environmentName, string componentName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(environmentName, nameof(environmentName)); + Argument.AssertNotNullOrEmpty(componentName, nameof(componentName)); + + using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, environmentName, componentName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + DaprComponentResiliencyPoliciesCollection value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = DaprComponentResiliencyPoliciesCollection.DeserializeDaprComponentResiliencyPoliciesCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/RestOperations/DaprComponentsRestOperations.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/RestOperations/DaprComponentsRestOperations.cs index d606820fbbfe..9d03801800c3 100644 --- a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/RestOperations/DaprComponentsRestOperations.cs +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/RestOperations/DaprComponentsRestOperations.cs @@ -32,7 +32,7 @@ public DaprComponentsRestOperations(HttpPipeline pipeline, string applicationId, { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2025-01-01"; + _apiVersion = apiVersion ?? "2025-02-02-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } @@ -73,7 +73,7 @@ internal HttpMessage CreateListRequest(string subscriptionId, string resourceGro } /// Get the Dapr Components for a managed environment. - /// The ID of the target subscription. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Name of the Managed Environment. /// The cancellation token to use. @@ -102,7 +102,7 @@ public async Task> ListAsync(string subscript } /// Get the Dapr Components for a managed environment. - /// The ID of the target subscription. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Name of the Managed Environment. /// The cancellation token to use. @@ -169,7 +169,7 @@ internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGrou } /// Get a dapr component. - /// The ID of the target subscription. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Name of the Managed Environment. /// Name of the Dapr Component. @@ -202,7 +202,7 @@ public async Task> GetAsync(string subsc } /// Get a dapr component. - /// The ID of the target subscription. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Name of the Managed Environment. /// Name of the Dapr Component. @@ -277,7 +277,7 @@ internal HttpMessage CreateCreateOrUpdateRequest(string subscriptionId, string r } /// Creates or updates a Dapr Component in a Managed Environment. - /// The ID of the target subscription. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Name of the Managed Environment. /// Name of the Dapr Component. @@ -310,7 +310,7 @@ public async Task> CreateOrUpdateAsync(s } /// Creates or updates a Dapr Component in a Managed Environment. - /// The ID of the target subscription. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Name of the Managed Environment. /// Name of the Dapr Component. @@ -381,7 +381,7 @@ internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceG } /// Delete a Dapr Component from a Managed Environment. - /// The ID of the target subscription. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Name of the Managed Environment. /// Name of the Dapr Component. @@ -408,7 +408,7 @@ public async Task DeleteAsync(string subscriptionId, string resourceGr } /// Delete a Dapr Component from a Managed Environment. - /// The ID of the target subscription. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Name of the Managed Environment. /// Name of the Dapr Component. @@ -475,7 +475,7 @@ internal HttpMessage CreateListSecretsRequest(string subscriptionId, string reso } /// List secrets for a dapr component. - /// The ID of the target subscription. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Name of the Managed Environment. /// Name of the Dapr Component. @@ -506,7 +506,7 @@ public async Task> ListSecretsAsync(string subsc } /// List secrets for a dapr component. - /// The ID of the target subscription. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Name of the Managed Environment. /// Name of the Dapr Component. @@ -560,7 +560,7 @@ internal HttpMessage CreateListNextPageRequest(string nextLink, string subscript /// Get the Dapr Components for a managed environment. /// The URL to the next page of results. - /// The ID of the target subscription. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Name of the Managed Environment. /// The cancellation token to use. @@ -591,7 +591,7 @@ public async Task> ListNextPageAsync(string n /// Get the Dapr Components for a managed environment. /// The URL to the next page of results. - /// The ID of the target subscription. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Name of the Managed Environment. /// The cancellation token to use. diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/RestOperations/DaprSubscriptionsRestOperations.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/RestOperations/DaprSubscriptionsRestOperations.cs new file mode 100644 index 000000000000..8e3e2b4e517f --- /dev/null +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/RestOperations/DaprSubscriptionsRestOperations.cs @@ -0,0 +1,523 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.AppContainers.Models; + +namespace Azure.ResourceManager.AppContainers +{ + internal partial class DaprSubscriptionsRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of DaprSubscriptionsRestOperations. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// The application id to use for user agent. + /// server parameter. + /// Api Version. + /// or is null. + public DaprSubscriptionsRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) + { + _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); + _endpoint = endpoint ?? new Uri("https://management.azure.com"); + _apiVersion = apiVersion ?? "2025-02-02-preview"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal RequestUriBuilder CreateListRequestUri(string subscriptionId, string resourceGroupName, string environmentName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.App/managedEnvironments/", false); + uri.AppendPath(environmentName, true); + uri.AppendPath("/daprSubscriptions", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateListRequest(string subscriptionId, string resourceGroupName, string environmentName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.App/managedEnvironments/", false); + uri.AppendPath(environmentName, true); + uri.AppendPath("/daprSubscriptions", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Get the Dapr subscriptions for a managed environment. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the Managed Environment. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> ListAsync(string subscriptionId, string resourceGroupName, string environmentName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(environmentName, nameof(environmentName)); + + using var message = CreateListRequest(subscriptionId, resourceGroupName, environmentName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + DaprSubscriptionsCollection value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = DaprSubscriptionsCollection.DeserializeDaprSubscriptionsCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Get the Dapr subscriptions for a managed environment. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the Managed Environment. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response List(string subscriptionId, string resourceGroupName, string environmentName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(environmentName, nameof(environmentName)); + + using var message = CreateListRequest(subscriptionId, resourceGroupName, environmentName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + DaprSubscriptionsCollection value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = DaprSubscriptionsCollection.DeserializeDaprSubscriptionsCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string environmentName, string name) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.App/managedEnvironments/", false); + uri.AppendPath(environmentName, true); + uri.AppendPath("/daprSubscriptions/", false); + uri.AppendPath(name, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string environmentName, string name) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.App/managedEnvironments/", false); + uri.AppendPath(environmentName, true); + uri.AppendPath("/daprSubscriptions/", false); + uri.AppendPath(name, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Get a dapr subscription. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the Managed Environment. + /// Name of the Dapr subscription. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task> GetAsync(string subscriptionId, string resourceGroupName, string environmentName, string name, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(environmentName, nameof(environmentName)); + Argument.AssertNotNullOrEmpty(name, nameof(name)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, environmentName, name); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + DaprSubscriptionData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = DaprSubscriptionData.DeserializeDaprSubscriptionData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((DaprSubscriptionData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + /// Get a dapr subscription. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the Managed Environment. + /// Name of the Dapr subscription. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response Get(string subscriptionId, string resourceGroupName, string environmentName, string name, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(environmentName, nameof(environmentName)); + Argument.AssertNotNullOrEmpty(name, nameof(name)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, environmentName, name); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + DaprSubscriptionData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = DaprSubscriptionData.DeserializeDaprSubscriptionData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((DaprSubscriptionData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateCreateOrUpdateRequestUri(string subscriptionId, string resourceGroupName, string environmentName, string name, DaprSubscriptionData data) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.App/managedEnvironments/", false); + uri.AppendPath(environmentName, true); + uri.AppendPath("/daprSubscriptions/", false); + uri.AppendPath(name, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateCreateOrUpdateRequest(string subscriptionId, string resourceGroupName, string environmentName, string name, DaprSubscriptionData data) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Put; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.App/managedEnvironments/", false); + uri.AppendPath(environmentName, true); + uri.AppendPath("/daprSubscriptions/", false); + uri.AppendPath(name, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(data, ModelSerializationExtensions.WireOptions); + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// Creates or updates a Dapr subscription in a Managed Environment. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the Managed Environment. + /// Name of the Dapr subscription. + /// Configuration details of the Dapr subscription. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task> CreateOrUpdateAsync(string subscriptionId, string resourceGroupName, string environmentName, string name, DaprSubscriptionData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(environmentName, nameof(environmentName)); + Argument.AssertNotNullOrEmpty(name, nameof(name)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, environmentName, name, data); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 201: + { + DaprSubscriptionData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = DaprSubscriptionData.DeserializeDaprSubscriptionData(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Creates or updates a Dapr subscription in a Managed Environment. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the Managed Environment. + /// Name of the Dapr subscription. + /// Configuration details of the Dapr subscription. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response CreateOrUpdate(string subscriptionId, string resourceGroupName, string environmentName, string name, DaprSubscriptionData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(environmentName, nameof(environmentName)); + Argument.AssertNotNullOrEmpty(name, nameof(name)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, environmentName, name, data); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 201: + { + DaprSubscriptionData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = DaprSubscriptionData.DeserializeDaprSubscriptionData(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string resourceGroupName, string environmentName, string name) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.App/managedEnvironments/", false); + uri.AppendPath(environmentName, true); + uri.AppendPath("/daprSubscriptions/", false); + uri.AppendPath(name, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string environmentName, string name) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Delete; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.App/managedEnvironments/", false); + uri.AppendPath(environmentName, true); + uri.AppendPath("/daprSubscriptions/", false); + uri.AppendPath(name, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Delete a Dapr subscription from a Managed Environment. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the Managed Environment. + /// Name of the Dapr subscription. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task DeleteAsync(string subscriptionId, string resourceGroupName, string environmentName, string name, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(environmentName, nameof(environmentName)); + Argument.AssertNotNullOrEmpty(name, nameof(name)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, environmentName, name); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Delete a Dapr subscription from a Managed Environment. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the Managed Environment. + /// Name of the Dapr subscription. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response Delete(string subscriptionId, string resourceGroupName, string environmentName, string name, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(environmentName, nameof(environmentName)); + Argument.AssertNotNullOrEmpty(name, nameof(name)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, environmentName, name); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName, string environmentName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + return uri; + } + + internal HttpMessage CreateListNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string environmentName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Get the Dapr subscriptions for a managed environment. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the Managed Environment. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> ListNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string environmentName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(environmentName, nameof(environmentName)); + + using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, environmentName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + DaprSubscriptionsCollection value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = DaprSubscriptionsCollection.DeserializeDaprSubscriptionsCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Get the Dapr subscriptions for a managed environment. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the Managed Environment. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response ListNextPage(string nextLink, string subscriptionId, string resourceGroupName, string environmentName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(environmentName, nameof(environmentName)); + + using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, environmentName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + DaprSubscriptionsCollection value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = DaprSubscriptionsCollection.DeserializeDaprSubscriptionsCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/RestOperations/DotNetComponentsRestOperations.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/RestOperations/DotNetComponentsRestOperations.cs new file mode 100644 index 000000000000..1dc29c6f727c --- /dev/null +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/RestOperations/DotNetComponentsRestOperations.cs @@ -0,0 +1,613 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.AppContainers.Models; + +namespace Azure.ResourceManager.AppContainers +{ + internal partial class DotNetComponentsRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of DotNetComponentsRestOperations. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// The application id to use for user agent. + /// server parameter. + /// Api Version. + /// or is null. + public DotNetComponentsRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) + { + _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); + _endpoint = endpoint ?? new Uri("https://management.azure.com"); + _apiVersion = apiVersion ?? "2025-02-02-preview"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal RequestUriBuilder CreateListRequestUri(string subscriptionId, string resourceGroupName, string environmentName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.App/managedEnvironments/", false); + uri.AppendPath(environmentName, true); + uri.AppendPath("/dotNetComponents", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateListRequest(string subscriptionId, string resourceGroupName, string environmentName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.App/managedEnvironments/", false); + uri.AppendPath(environmentName, true); + uri.AppendPath("/dotNetComponents", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Get the .NET Components for a managed environment. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the Managed Environment. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> ListAsync(string subscriptionId, string resourceGroupName, string environmentName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(environmentName, nameof(environmentName)); + + using var message = CreateListRequest(subscriptionId, resourceGroupName, environmentName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + DotNetComponentsCollection value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = DotNetComponentsCollection.DeserializeDotNetComponentsCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Get the .NET Components for a managed environment. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the Managed Environment. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response List(string subscriptionId, string resourceGroupName, string environmentName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(environmentName, nameof(environmentName)); + + using var message = CreateListRequest(subscriptionId, resourceGroupName, environmentName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + DotNetComponentsCollection value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = DotNetComponentsCollection.DeserializeDotNetComponentsCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string environmentName, string name) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.App/managedEnvironments/", false); + uri.AppendPath(environmentName, true); + uri.AppendPath("/dotNetComponents/", false); + uri.AppendPath(name, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string environmentName, string name) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.App/managedEnvironments/", false); + uri.AppendPath(environmentName, true); + uri.AppendPath("/dotNetComponents/", false); + uri.AppendPath(name, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Get a .NET Component. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the Managed Environment. + /// Name of the .NET Component. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task> GetAsync(string subscriptionId, string resourceGroupName, string environmentName, string name, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(environmentName, nameof(environmentName)); + Argument.AssertNotNullOrEmpty(name, nameof(name)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, environmentName, name); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + DotNetComponentData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = DotNetComponentData.DeserializeDotNetComponentData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((DotNetComponentData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + /// Get a .NET Component. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the Managed Environment. + /// Name of the .NET Component. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response Get(string subscriptionId, string resourceGroupName, string environmentName, string name, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(environmentName, nameof(environmentName)); + Argument.AssertNotNullOrEmpty(name, nameof(name)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, environmentName, name); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + DotNetComponentData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = DotNetComponentData.DeserializeDotNetComponentData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((DotNetComponentData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateCreateOrUpdateRequestUri(string subscriptionId, string resourceGroupName, string environmentName, string name, DotNetComponentData data) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.App/managedEnvironments/", false); + uri.AppendPath(environmentName, true); + uri.AppendPath("/dotNetComponents/", false); + uri.AppendPath(name, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateCreateOrUpdateRequest(string subscriptionId, string resourceGroupName, string environmentName, string name, DotNetComponentData data) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Put; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.App/managedEnvironments/", false); + uri.AppendPath(environmentName, true); + uri.AppendPath("/dotNetComponents/", false); + uri.AppendPath(name, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(data, ModelSerializationExtensions.WireOptions); + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// Creates or updates a .NET Component in a Managed Environment. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the Managed Environment. + /// Name of the .NET Component. + /// Configuration details of the .NET Component. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task CreateOrUpdateAsync(string subscriptionId, string resourceGroupName, string environmentName, string name, DotNetComponentData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(environmentName, nameof(environmentName)); + Argument.AssertNotNullOrEmpty(name, nameof(name)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, environmentName, name, data); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 201: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Creates or updates a .NET Component in a Managed Environment. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the Managed Environment. + /// Name of the .NET Component. + /// Configuration details of the .NET Component. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response CreateOrUpdate(string subscriptionId, string resourceGroupName, string environmentName, string name, DotNetComponentData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(environmentName, nameof(environmentName)); + Argument.AssertNotNullOrEmpty(name, nameof(name)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, environmentName, name, data); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 201: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateUpdateRequestUri(string subscriptionId, string resourceGroupName, string environmentName, string name, DotNetComponentData data) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.App/managedEnvironments/", false); + uri.AppendPath(environmentName, true); + uri.AppendPath("/dotNetComponents/", false); + uri.AppendPath(name, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceGroupName, string environmentName, string name, DotNetComponentData data) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Patch; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.App/managedEnvironments/", false); + uri.AppendPath(environmentName, true); + uri.AppendPath("/dotNetComponents/", false); + uri.AppendPath(name, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(data, ModelSerializationExtensions.WireOptions); + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// Patches a .NET Component using JSON Merge Patch. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the Managed Environment. + /// Name of the .NET Component. + /// Configuration details of the .NET Component. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task UpdateAsync(string subscriptionId, string resourceGroupName, string environmentName, string name, DotNetComponentData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(environmentName, nameof(environmentName)); + Argument.AssertNotNullOrEmpty(name, nameof(name)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, environmentName, name, data); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Patches a .NET Component using JSON Merge Patch. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the Managed Environment. + /// Name of the .NET Component. + /// Configuration details of the .NET Component. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response Update(string subscriptionId, string resourceGroupName, string environmentName, string name, DotNetComponentData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(environmentName, nameof(environmentName)); + Argument.AssertNotNullOrEmpty(name, nameof(name)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, environmentName, name, data); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string resourceGroupName, string environmentName, string name) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.App/managedEnvironments/", false); + uri.AppendPath(environmentName, true); + uri.AppendPath("/dotNetComponents/", false); + uri.AppendPath(name, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string environmentName, string name) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Delete; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.App/managedEnvironments/", false); + uri.AppendPath(environmentName, true); + uri.AppendPath("/dotNetComponents/", false); + uri.AppendPath(name, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Delete a .NET Component. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the Managed Environment. + /// Name of the .NET Component. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task DeleteAsync(string subscriptionId, string resourceGroupName, string environmentName, string name, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(environmentName, nameof(environmentName)); + Argument.AssertNotNullOrEmpty(name, nameof(name)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, environmentName, name); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Delete a .NET Component. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the Managed Environment. + /// Name of the .NET Component. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response Delete(string subscriptionId, string resourceGroupName, string environmentName, string name, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(environmentName, nameof(environmentName)); + Argument.AssertNotNullOrEmpty(name, nameof(name)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, environmentName, name); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName, string environmentName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + return uri; + } + + internal HttpMessage CreateListNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string environmentName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Get the .NET Components for a managed environment. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the Managed Environment. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> ListNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string environmentName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(environmentName, nameof(environmentName)); + + using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, environmentName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + DotNetComponentsCollection value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = DotNetComponentsCollection.DeserializeDotNetComponentsCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Get the .NET Components for a managed environment. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the Managed Environment. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response ListNextPage(string nextLink, string subscriptionId, string resourceGroupName, string environmentName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(environmentName, nameof(environmentName)); + + using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, environmentName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + DotNetComponentsCollection value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = DotNetComponentsCollection.DeserializeDotNetComponentsCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/RestOperations/FunctionsExtensionRestOperations.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/RestOperations/FunctionsExtensionRestOperations.cs new file mode 100644 index 000000000000..235b433affdc --- /dev/null +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/RestOperations/FunctionsExtensionRestOperations.cs @@ -0,0 +1,148 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.AppContainers +{ + internal partial class FunctionsExtensionRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of FunctionsExtensionRestOperations. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// The application id to use for user agent. + /// server parameter. + /// Api Version. + /// or is null. + public FunctionsExtensionRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) + { + _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); + _endpoint = endpoint ?? new Uri("https://management.azure.com"); + _apiVersion = apiVersion ?? "2025-02-02-preview"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal RequestUriBuilder CreateInvokeFunctionsHostRequestUri(string subscriptionId, string resourceGroupName, string containerAppName, string revisionName, string functionAppName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.App/containerApps/", false); + uri.AppendPath(containerAppName, true); + uri.AppendPath("/revisions/", false); + uri.AppendPath(revisionName, true); + uri.AppendPath("/providers/Microsoft.App/functions/", false); + uri.AppendPath(functionAppName, true); + uri.AppendPath("/invoke", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateInvokeFunctionsHostRequest(string subscriptionId, string resourceGroupName, string containerAppName, string revisionName, string functionAppName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.App/containerApps/", false); + uri.AppendPath(containerAppName, true); + uri.AppendPath("/revisions/", false); + uri.AppendPath(revisionName, true); + uri.AppendPath("/providers/Microsoft.App/functions/", false); + uri.AppendPath(functionAppName, true); + uri.AppendPath("/invoke", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Proxies a Functions host call to the function app backed by the container app. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the Container App. + /// Name of the Container App Revision, the parent resource. + /// Name of the Function App, the extension resource. + /// The cancellation token to use. + /// , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public async Task> InvokeFunctionsHostAsync(string subscriptionId, string resourceGroupName, string containerAppName, string revisionName, string functionAppName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(containerAppName, nameof(containerAppName)); + Argument.AssertNotNullOrEmpty(revisionName, nameof(revisionName)); + Argument.AssertNotNullOrEmpty(functionAppName, nameof(functionAppName)); + + using var message = CreateInvokeFunctionsHostRequest(subscriptionId, resourceGroupName, containerAppName, revisionName, functionAppName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + string value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = document.RootElement.GetString(); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Proxies a Functions host call to the function app backed by the container app. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the Container App. + /// Name of the Container App Revision, the parent resource. + /// Name of the Function App, the extension resource. + /// The cancellation token to use. + /// , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public Response InvokeFunctionsHost(string subscriptionId, string resourceGroupName, string containerAppName, string revisionName, string functionAppName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(containerAppName, nameof(containerAppName)); + Argument.AssertNotNullOrEmpty(revisionName, nameof(revisionName)); + Argument.AssertNotNullOrEmpty(functionAppName, nameof(functionAppName)); + + using var message = CreateInvokeFunctionsHostRequest(subscriptionId, resourceGroupName, containerAppName, revisionName, functionAppName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + string value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = document.RootElement.GetString(); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/RestOperations/HttpRouteConfigRestOperations.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/RestOperations/HttpRouteConfigRestOperations.cs new file mode 100644 index 000000000000..115e6efa2d37 --- /dev/null +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/RestOperations/HttpRouteConfigRestOperations.cs @@ -0,0 +1,631 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.AppContainers.Models; + +namespace Azure.ResourceManager.AppContainers +{ + internal partial class HttpRouteConfigRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of HttpRouteConfigRestOperations. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// The application id to use for user agent. + /// server parameter. + /// Api Version. + /// or is null. + public HttpRouteConfigRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) + { + _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); + _endpoint = endpoint ?? new Uri("https://management.azure.com"); + _apiVersion = apiVersion ?? "2025-02-02-preview"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string environmentName, string httpRouteName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.App/managedEnvironments/", false); + uri.AppendPath(environmentName, true); + uri.AppendPath("/httpRouteConfigs/", false); + uri.AppendPath(httpRouteName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string environmentName, string httpRouteName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.App/managedEnvironments/", false); + uri.AppendPath(environmentName, true); + uri.AppendPath("/httpRouteConfigs/", false); + uri.AppendPath(httpRouteName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Get the specified Managed Http Route Config. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the Managed Environment. + /// Name of the Http Route Config Resource. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task> GetAsync(string subscriptionId, string resourceGroupName, string environmentName, string httpRouteName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(environmentName, nameof(environmentName)); + Argument.AssertNotNullOrEmpty(httpRouteName, nameof(httpRouteName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, environmentName, httpRouteName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + HttpRouteConfigData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = HttpRouteConfigData.DeserializeHttpRouteConfigData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((HttpRouteConfigData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + /// Get the specified Managed Http Route Config. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the Managed Environment. + /// Name of the Http Route Config Resource. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response Get(string subscriptionId, string resourceGroupName, string environmentName, string httpRouteName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(environmentName, nameof(environmentName)); + Argument.AssertNotNullOrEmpty(httpRouteName, nameof(httpRouteName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, environmentName, httpRouteName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + HttpRouteConfigData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = HttpRouteConfigData.DeserializeHttpRouteConfigData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((HttpRouteConfigData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateCreateOrUpdateRequestUri(string subscriptionId, string resourceGroupName, string environmentName, string httpRouteName, HttpRouteConfigData data) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.App/managedEnvironments/", false); + uri.AppendPath(environmentName, true); + uri.AppendPath("/httpRouteConfigs/", false); + uri.AppendPath(httpRouteName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateCreateOrUpdateRequest(string subscriptionId, string resourceGroupName, string environmentName, string httpRouteName, HttpRouteConfigData data) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Put; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.App/managedEnvironments/", false); + uri.AppendPath(environmentName, true); + uri.AppendPath("/httpRouteConfigs/", false); + uri.AppendPath(httpRouteName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(data, ModelSerializationExtensions.WireOptions); + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// Create or Update a Http Route Config. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the Managed Environment. + /// Name of the Http Route Config Resource. + /// Http Route config to be created or updated. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task> CreateOrUpdateAsync(string subscriptionId, string resourceGroupName, string environmentName, string httpRouteName, HttpRouteConfigData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(environmentName, nameof(environmentName)); + Argument.AssertNotNullOrEmpty(httpRouteName, nameof(httpRouteName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, environmentName, httpRouteName, data); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 201: + { + HttpRouteConfigData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = HttpRouteConfigData.DeserializeHttpRouteConfigData(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Create or Update a Http Route Config. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the Managed Environment. + /// Name of the Http Route Config Resource. + /// Http Route config to be created or updated. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response CreateOrUpdate(string subscriptionId, string resourceGroupName, string environmentName, string httpRouteName, HttpRouteConfigData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(environmentName, nameof(environmentName)); + Argument.AssertNotNullOrEmpty(httpRouteName, nameof(httpRouteName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, environmentName, httpRouteName, data); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 201: + { + HttpRouteConfigData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = HttpRouteConfigData.DeserializeHttpRouteConfigData(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateUpdateRequestUri(string subscriptionId, string resourceGroupName, string environmentName, string httpRouteName, HttpRouteConfigData data) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.App/managedEnvironments/", false); + uri.AppendPath(environmentName, true); + uri.AppendPath("/httpRouteConfigs/", false); + uri.AppendPath(httpRouteName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceGroupName, string environmentName, string httpRouteName, HttpRouteConfigData data) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Patch; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.App/managedEnvironments/", false); + uri.AppendPath(environmentName, true); + uri.AppendPath("/httpRouteConfigs/", false); + uri.AppendPath(httpRouteName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(data, ModelSerializationExtensions.WireOptions); + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// Patches an http route config resource. Only patching of tags is supported. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the Managed Environment. + /// Name of the Http Route Config Resource. + /// Properties of http route config that need to be updated. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task> UpdateAsync(string subscriptionId, string resourceGroupName, string environmentName, string httpRouteName, HttpRouteConfigData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(environmentName, nameof(environmentName)); + Argument.AssertNotNullOrEmpty(httpRouteName, nameof(httpRouteName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, environmentName, httpRouteName, data); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + HttpRouteConfigData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = HttpRouteConfigData.DeserializeHttpRouteConfigData(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Patches an http route config resource. Only patching of tags is supported. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the Managed Environment. + /// Name of the Http Route Config Resource. + /// Properties of http route config that need to be updated. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response Update(string subscriptionId, string resourceGroupName, string environmentName, string httpRouteName, HttpRouteConfigData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(environmentName, nameof(environmentName)); + Argument.AssertNotNullOrEmpty(httpRouteName, nameof(httpRouteName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, environmentName, httpRouteName, data); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + HttpRouteConfigData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = HttpRouteConfigData.DeserializeHttpRouteConfigData(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string resourceGroupName, string environmentName, string httpRouteName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.App/managedEnvironments/", false); + uri.AppendPath(environmentName, true); + uri.AppendPath("/httpRouteConfigs/", false); + uri.AppendPath(httpRouteName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string environmentName, string httpRouteName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Delete; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.App/managedEnvironments/", false); + uri.AppendPath(environmentName, true); + uri.AppendPath("/httpRouteConfigs/", false); + uri.AppendPath(httpRouteName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Deletes the specified Managed Http Route. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the Managed Environment. + /// Name of the Http Route Config Resource. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task DeleteAsync(string subscriptionId, string resourceGroupName, string environmentName, string httpRouteName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(environmentName, nameof(environmentName)); + Argument.AssertNotNullOrEmpty(httpRouteName, nameof(httpRouteName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, environmentName, httpRouteName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Deletes the specified Managed Http Route. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the Managed Environment. + /// Name of the Http Route Config Resource. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response Delete(string subscriptionId, string resourceGroupName, string environmentName, string httpRouteName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(environmentName, nameof(environmentName)); + Argument.AssertNotNullOrEmpty(httpRouteName, nameof(httpRouteName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, environmentName, httpRouteName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListRequestUri(string subscriptionId, string resourceGroupName, string environmentName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.App/managedEnvironments/", false); + uri.AppendPath(environmentName, true); + uri.AppendPath("/httpRouteConfigs", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateListRequest(string subscriptionId, string resourceGroupName, string environmentName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.App/managedEnvironments/", false); + uri.AppendPath(environmentName, true); + uri.AppendPath("/httpRouteConfigs", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Get the Managed Http Routes in a given managed environment. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the Managed Environment. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> ListAsync(string subscriptionId, string resourceGroupName, string environmentName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(environmentName, nameof(environmentName)); + + using var message = CreateListRequest(subscriptionId, resourceGroupName, environmentName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + Models.HttpRouteConfigCollection value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = Models.HttpRouteConfigCollection.DeserializeHttpRouteConfigCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Get the Managed Http Routes in a given managed environment. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the Managed Environment. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response List(string subscriptionId, string resourceGroupName, string environmentName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(environmentName, nameof(environmentName)); + + using var message = CreateListRequest(subscriptionId, resourceGroupName, environmentName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + Models.HttpRouteConfigCollection value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = Models.HttpRouteConfigCollection.DeserializeHttpRouteConfigCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName, string environmentName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + return uri; + } + + internal HttpMessage CreateListNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string environmentName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Get the Managed Http Routes in a given managed environment. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the Managed Environment. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> ListNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string environmentName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(environmentName, nameof(environmentName)); + + using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, environmentName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + Models.HttpRouteConfigCollection value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = Models.HttpRouteConfigCollection.DeserializeHttpRouteConfigCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Get the Managed Http Routes in a given managed environment. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the Managed Environment. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response ListNextPage(string nextLink, string subscriptionId, string resourceGroupName, string environmentName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(environmentName, nameof(environmentName)); + + using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, environmentName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + Models.HttpRouteConfigCollection value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = Models.HttpRouteConfigCollection.DeserializeHttpRouteConfigCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/RestOperations/JavaComponentsRestOperations.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/RestOperations/JavaComponentsRestOperations.cs index 4a3c4ca3ee75..d6d58a312607 100644 --- a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/RestOperations/JavaComponentsRestOperations.cs +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/RestOperations/JavaComponentsRestOperations.cs @@ -32,7 +32,7 @@ public JavaComponentsRestOperations(HttpPipeline pipeline, string applicationId, { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2025-01-01"; + _apiVersion = apiVersion ?? "2025-02-02-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } @@ -73,7 +73,7 @@ internal HttpMessage CreateListRequest(string subscriptionId, string resourceGro } /// Get the Java Components for a managed environment. - /// The ID of the target subscription. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Name of the Managed Environment. /// The cancellation token to use. @@ -102,7 +102,7 @@ public async Task> ListAsync(string subscript } /// Get the Java Components for a managed environment. - /// The ID of the target subscription. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Name of the Managed Environment. /// The cancellation token to use. @@ -169,7 +169,7 @@ internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGrou } /// Get a Java Component. - /// The ID of the target subscription. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Name of the Managed Environment. /// Name of the Java Component. @@ -202,7 +202,7 @@ public async Task> GetAsync(string subscriptionId, s } /// Get a Java Component. - /// The ID of the target subscription. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Name of the Managed Environment. /// Name of the Java Component. @@ -277,7 +277,7 @@ internal HttpMessage CreateCreateOrUpdateRequest(string subscriptionId, string r } /// Creates or updates a Java Component in a Managed Environment. - /// The ID of the target subscription. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Name of the Managed Environment. /// Name of the Java Component. @@ -306,7 +306,7 @@ public async Task CreateOrUpdateAsync(string subscriptionId, string re } /// Creates or updates a Java Component in a Managed Environment. - /// The ID of the target subscription. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Name of the Managed Environment. /// Name of the Java Component. @@ -377,7 +377,7 @@ internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceG } /// Patches a Java Component using JSON Merge Patch. - /// The ID of the target subscription. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Name of the Managed Environment. /// Name of the Java Component. @@ -406,7 +406,7 @@ public async Task UpdateAsync(string subscriptionId, string resourceGr } /// Patches a Java Component using JSON Merge Patch. - /// The ID of the target subscription. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Name of the Managed Environment. /// Name of the Java Component. @@ -473,7 +473,7 @@ internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceG } /// Delete a Java Component. - /// The ID of the target subscription. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Name of the Managed Environment. /// Name of the Java Component. @@ -500,7 +500,7 @@ public async Task DeleteAsync(string subscriptionId, string resourceGr } /// Delete a Java Component. - /// The ID of the target subscription. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Name of the Managed Environment. /// Name of the Java Component. @@ -550,7 +550,7 @@ internal HttpMessage CreateListNextPageRequest(string nextLink, string subscript /// Get the Java Components for a managed environment. /// The URL to the next page of results. - /// The ID of the target subscription. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Name of the Managed Environment. /// The cancellation token to use. @@ -581,7 +581,7 @@ public async Task> ListNextPageAsync(string n /// Get the Java Components for a managed environment. /// The URL to the next page of results. - /// The ID of the target subscription. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Name of the Managed Environment. /// The cancellation token to use. diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/RestOperations/JobsExecutionsRestOperations.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/RestOperations/JobsExecutionsRestOperations.cs index 8f15af70ad28..35bd8a11bcf7 100644 --- a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/RestOperations/JobsExecutionsRestOperations.cs +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/RestOperations/JobsExecutionsRestOperations.cs @@ -32,7 +32,7 @@ public JobsExecutionsRestOperations(HttpPipeline pipeline, string applicationId, { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2025-01-01"; + _apiVersion = apiVersion ?? "2025-02-02-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } @@ -81,7 +81,7 @@ internal HttpMessage CreateListRequest(string subscriptionId, string resourceGro } /// Get a Container Apps Job's executions. - /// The ID of the target subscription. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Job Name. /// The filter to apply on the operation. @@ -111,7 +111,7 @@ public async Task> ListAsync(string subscrip } /// Get a Container Apps Job's executions. - /// The ID of the target subscription. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Job Name. /// The filter to apply on the operation. @@ -164,7 +164,7 @@ internal HttpMessage CreateListNextPageRequest(string nextLink, string subscript /// Get a Container Apps Job's executions. /// The URL to the next page of results. - /// The ID of the target subscription. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Job Name. /// The filter to apply on the operation. @@ -196,7 +196,7 @@ public async Task> ListNextPageAsync(string /// Get a Container Apps Job's executions. /// The URL to the next page of results. - /// The ID of the target subscription. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Job Name. /// The filter to apply on the operation. diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/RestOperations/JobsRestOperations.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/RestOperations/JobsRestOperations.cs index 10d5f8395029..cc3620ce326b 100644 --- a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/RestOperations/JobsRestOperations.cs +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/RestOperations/JobsRestOperations.cs @@ -32,7 +32,7 @@ public JobsRestOperations(HttpPipeline pipeline, string applicationId, Uri endpo { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2025-01-01"; + _apiVersion = apiVersion ?? "2025-02-02-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } @@ -73,7 +73,7 @@ internal HttpMessage CreateListDetectorsRequest(string subscriptionId, string re } /// Get the list of diagnostics for a Container App Job. - /// The ID of the target subscription. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Job Name. /// The cancellation token to use. @@ -102,7 +102,7 @@ public async Task> ListDetectorsAsync(string sub } /// Get the list of diagnostics for a Container App Job. - /// The ID of the target subscription. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Job Name. /// The cancellation token to use. @@ -169,7 +169,7 @@ internal HttpMessage CreateGetDetectorRequest(string subscriptionId, string reso } /// Get the diagnostics data for a Container App Job. - /// The ID of the target subscription. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Job Name. /// Name of the Container App Job detector. @@ -202,7 +202,7 @@ public async Task> GetDetectorAsync(string } /// Get the diagnostics data for a Container App Job. - /// The ID of the target subscription. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Job Name. /// Name of the Container App Job detector. @@ -273,7 +273,7 @@ internal HttpMessage CreateProxyGetRequest(string subscriptionId, string resourc } /// Get the properties of a Container App Job. - /// The ID of the target subscription. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Job Name. /// Proxy API Name for Container App Job. @@ -306,7 +306,7 @@ public async Task> ProxyGetAsync(string subscripti } /// Get the properties of a Container App Job. - /// The ID of the target subscription. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Job Name. /// Proxy API Name for Container App Job. @@ -367,7 +367,7 @@ internal HttpMessage CreateListBySubscriptionRequest(string subscriptionId) } /// Get the Container Apps Jobs in a given subscription. - /// The ID of the target subscription. + /// The ID of the target subscription. The value must be an UUID. /// The cancellation token to use. /// is null. /// is an empty string, and was expected to be non-empty. @@ -392,7 +392,7 @@ public async Task> ListBySubscriptionAsync( } /// Get the Container Apps Jobs in a given subscription. - /// The ID of the target subscription. + /// The ID of the target subscription. The value must be an UUID. /// The cancellation token to use. /// is null. /// is an empty string, and was expected to be non-empty. @@ -449,7 +449,7 @@ internal HttpMessage CreateListByResourceGroupRequest(string subscriptionId, str } /// Get the Container Apps Jobs in a given resource group. - /// The ID of the target subscription. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// The cancellation token to use. /// or is null. @@ -476,7 +476,7 @@ public async Task> ListByResourceGroupAsync } /// Get the Container Apps Jobs in a given resource group. - /// The ID of the target subscription. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// The cancellation token to use. /// or is null. @@ -537,7 +537,7 @@ internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGrou } /// Get the properties of a Container Apps Job. - /// The ID of the target subscription. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Job Name. /// The cancellation token to use. @@ -568,7 +568,7 @@ public async Task> GetAsync(string subscriptionId, } /// Get the properties of a Container Apps Job. - /// The ID of the target subscription. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Job Name. /// The cancellation token to use. @@ -637,7 +637,7 @@ internal HttpMessage CreateCreateOrUpdateRequest(string subscriptionId, string r } /// Create or Update a Container Apps Job. - /// The ID of the target subscription. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Job Name. /// Properties used to create a container apps job. @@ -664,7 +664,7 @@ public async Task CreateOrUpdateAsync(string subscriptionId, string re } /// Create or Update a Container Apps Job. - /// The ID of the target subscription. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Job Name. /// Properties used to create a container apps job. @@ -725,7 +725,7 @@ internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceG } /// Delete a Container Apps Job. - /// The ID of the target subscription. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Job Name. /// The cancellation token to use. @@ -751,7 +751,7 @@ public async Task DeleteAsync(string subscriptionId, string resourceGr } /// Delete a Container Apps Job. - /// The ID of the target subscription. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Job Name. /// The cancellation token to use. @@ -815,7 +815,7 @@ internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceG } /// Patches a Container Apps Job using JSON Merge Patch. - /// The ID of the target subscription. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Job Name. /// Properties used to create a container apps job. @@ -842,7 +842,7 @@ public async Task UpdateAsync(string subscriptionId, string resourceGr } /// Patches a Container Apps Job using JSON Merge Patch. - /// The ID of the target subscription. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Job Name. /// Properties used to create a container apps job. @@ -912,7 +912,7 @@ internal HttpMessage CreateStartRequest(string subscriptionId, string resourceGr } /// Start a Container Apps Job. - /// The ID of the target subscription. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Job Name. /// Properties used to start a job execution. @@ -938,7 +938,7 @@ public async Task StartAsync(string subscriptionId, string resourceGro } /// Start a Container Apps Job. - /// The ID of the target subscription. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Job Name. /// Properties used to start a job execution. @@ -1004,7 +1004,7 @@ internal HttpMessage CreateStopExecutionRequest(string subscriptionId, string re } /// Terminates execution of a running container apps job. - /// The ID of the target subscription. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Job Name. /// Job execution name. @@ -1031,7 +1031,7 @@ public async Task StopExecutionAsync(string subscriptionId, string res } /// Terminates execution of a running container apps job. - /// The ID of the target subscription. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Job Name. /// Job execution name. @@ -1094,7 +1094,7 @@ internal HttpMessage CreateStopMultipleExecutionsRequest(string subscriptionId, } /// Terminates execution of a running container apps job. - /// The ID of the target subscription. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Job Name. /// The cancellation token to use. @@ -1119,7 +1119,7 @@ public async Task StopMultipleExecutionsAsync(string subscriptionId, s } /// Terminates execution of a running container apps job. - /// The ID of the target subscription. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Job Name. /// The cancellation token to use. @@ -1180,7 +1180,7 @@ internal HttpMessage CreateListSecretsRequest(string subscriptionId, string reso } /// List secrets for a container apps job. - /// The ID of the target subscription. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Job Name. /// The cancellation token to use. @@ -1209,7 +1209,7 @@ public async Task> ListSecretsAsync(string subscr } /// List secrets for a container apps job. - /// The ID of the target subscription. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Job Name. /// The cancellation token to use. @@ -1237,6 +1237,178 @@ public Response ListSecrets(string subscriptionId, string } } + internal RequestUriBuilder CreateResumeRequestUri(string subscriptionId, string resourceGroupName, string jobName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.App/jobs/", false); + uri.AppendPath(jobName, true); + uri.AppendPath("/resume", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateResumeRequest(string subscriptionId, string resourceGroupName, string jobName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.App/jobs/", false); + uri.AppendPath(jobName, true); + uri.AppendPath("/resume", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Resumes a suspended job. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the Job. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task ResumeAsync(string subscriptionId, string resourceGroupName, string jobName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(jobName, nameof(jobName)); + + using var message = CreateResumeRequest(subscriptionId, resourceGroupName, jobName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Resumes a suspended job. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the Job. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response Resume(string subscriptionId, string resourceGroupName, string jobName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(jobName, nameof(jobName)); + + using var message = CreateResumeRequest(subscriptionId, resourceGroupName, jobName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateSuspendRequestUri(string subscriptionId, string resourceGroupName, string jobName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.App/jobs/", false); + uri.AppendPath(jobName, true); + uri.AppendPath("/suspend", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateSuspendRequest(string subscriptionId, string resourceGroupName, string jobName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.App/jobs/", false); + uri.AppendPath(jobName, true); + uri.AppendPath("/suspend", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Suspends a job. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the Job. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task SuspendAsync(string subscriptionId, string resourceGroupName, string jobName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(jobName, nameof(jobName)); + + using var message = CreateSuspendRequest(subscriptionId, resourceGroupName, jobName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Suspends a job. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the Job. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response Suspend(string subscriptionId, string resourceGroupName, string jobName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(jobName, nameof(jobName)); + + using var message = CreateSuspendRequest(subscriptionId, resourceGroupName, jobName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + internal RequestUriBuilder CreateListDetectorsNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName, string jobName) { var uri = new RawRequestUriBuilder(); @@ -1261,7 +1433,7 @@ internal HttpMessage CreateListDetectorsNextPageRequest(string nextLink, string /// Get the list of diagnostics for a Container App Job. /// The URL to the next page of results. - /// The ID of the target subscription. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Job Name. /// The cancellation token to use. @@ -1292,7 +1464,7 @@ public async Task> ListDetectorsNextPageAsync(st /// Get the list of diagnostics for a Container App Job. /// The URL to the next page of results. - /// The ID of the target subscription. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Job Name. /// The cancellation token to use. @@ -1345,7 +1517,7 @@ internal HttpMessage CreateListBySubscriptionNextPageRequest(string nextLink, st /// Get the Container Apps Jobs in a given subscription. /// The URL to the next page of results. - /// The ID of the target subscription. + /// The ID of the target subscription. The value must be an UUID. /// The cancellation token to use. /// or is null. /// is an empty string, and was expected to be non-empty. @@ -1372,7 +1544,7 @@ public async Task> ListBySubscriptionNextPa /// Get the Container Apps Jobs in a given subscription. /// The URL to the next page of results. - /// The ID of the target subscription. + /// The ID of the target subscription. The value must be an UUID. /// The cancellation token to use. /// or is null. /// is an empty string, and was expected to be non-empty. @@ -1421,7 +1593,7 @@ internal HttpMessage CreateListByResourceGroupNextPageRequest(string nextLink, s /// Get the Container Apps Jobs in a given resource group. /// The URL to the next page of results. - /// The ID of the target subscription. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// The cancellation token to use. /// , or is null. @@ -1450,7 +1622,7 @@ public async Task> ListByResourceGroupNextP /// Get the Container Apps Jobs in a given resource group. /// The URL to the next page of results. - /// The ID of the target subscription. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// The cancellation token to use. /// , or is null. diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/RestOperations/LogicAppsRestOperations.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/RestOperations/LogicAppsRestOperations.cs new file mode 100644 index 000000000000..28c187410d02 --- /dev/null +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/RestOperations/LogicAppsRestOperations.cs @@ -0,0 +1,958 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.AppContainers.Models; + +namespace Azure.ResourceManager.AppContainers +{ + internal partial class LogicAppsRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of LogicAppsRestOperations. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// The application id to use for user agent. + /// server parameter. + /// Api Version. + /// or is null. + public LogicAppsRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) + { + _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); + _endpoint = endpoint ?? new Uri("https://management.azure.com"); + _apiVersion = apiVersion ?? "2025-02-02-preview"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string containerAppName, string logicAppName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.App/containerApps/", false); + uri.AppendPath(containerAppName, true); + uri.AppendPath("/providers/Microsoft.App/logicApps/", false); + uri.AppendPath(logicAppName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string containerAppName, string logicAppName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.App/containerApps/", false); + uri.AppendPath(containerAppName, true); + uri.AppendPath("/providers/Microsoft.App/logicApps/", false); + uri.AppendPath(logicAppName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Gets a logic app extension resource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the Container App. + /// Name of the Logic App, the extension resource. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task> GetAsync(string subscriptionId, string resourceGroupName, string containerAppName, string logicAppName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(containerAppName, nameof(containerAppName)); + Argument.AssertNotNullOrEmpty(logicAppName, nameof(logicAppName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, containerAppName, logicAppName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + LogicAppData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = LogicAppData.DeserializeLogicAppData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((LogicAppData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + /// Gets a logic app extension resource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the Container App. + /// Name of the Logic App, the extension resource. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response Get(string subscriptionId, string resourceGroupName, string containerAppName, string logicAppName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(containerAppName, nameof(containerAppName)); + Argument.AssertNotNullOrEmpty(logicAppName, nameof(logicAppName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, containerAppName, logicAppName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + LogicAppData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = LogicAppData.DeserializeLogicAppData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((LogicAppData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateCreateOrUpdateRequestUri(string subscriptionId, string resourceGroupName, string containerAppName, string logicAppName, LogicAppData data) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.App/containerApps/", false); + uri.AppendPath(containerAppName, true); + uri.AppendPath("/providers/Microsoft.App/logicApps/", false); + uri.AppendPath(logicAppName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateCreateOrUpdateRequest(string subscriptionId, string resourceGroupName, string containerAppName, string logicAppName, LogicAppData data) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Put; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.App/containerApps/", false); + uri.AppendPath(containerAppName, true); + uri.AppendPath("/providers/Microsoft.App/logicApps/", false); + uri.AppendPath(logicAppName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(data, ModelSerializationExtensions.WireOptions); + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// Create or update a Logic App extension resource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the Container App. + /// Name of the Logic App, the extension resource. + /// Logic app resource properties. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task> CreateOrUpdateAsync(string subscriptionId, string resourceGroupName, string containerAppName, string logicAppName, LogicAppData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(containerAppName, nameof(containerAppName)); + Argument.AssertNotNullOrEmpty(logicAppName, nameof(logicAppName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, containerAppName, logicAppName, data); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 201: + { + LogicAppData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = LogicAppData.DeserializeLogicAppData(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Create or update a Logic App extension resource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the Container App. + /// Name of the Logic App, the extension resource. + /// Logic app resource properties. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response CreateOrUpdate(string subscriptionId, string resourceGroupName, string containerAppName, string logicAppName, LogicAppData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(containerAppName, nameof(containerAppName)); + Argument.AssertNotNullOrEmpty(logicAppName, nameof(logicAppName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, containerAppName, logicAppName, data); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 201: + { + LogicAppData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = LogicAppData.DeserializeLogicAppData(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string resourceGroupName, string containerAppName, string logicAppName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.App/containerApps/", false); + uri.AppendPath(containerAppName, true); + uri.AppendPath("/providers/Microsoft.App/logicApps/", false); + uri.AppendPath(logicAppName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string containerAppName, string logicAppName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Delete; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.App/containerApps/", false); + uri.AppendPath(containerAppName, true); + uri.AppendPath("/providers/Microsoft.App/logicApps/", false); + uri.AppendPath(logicAppName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Deletes a Logic App extension resource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the Container App. + /// Name of the Logic App, the extension resource. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task DeleteAsync(string subscriptionId, string resourceGroupName, string containerAppName, string logicAppName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(containerAppName, nameof(containerAppName)); + Argument.AssertNotNullOrEmpty(logicAppName, nameof(logicAppName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, containerAppName, logicAppName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Deletes a Logic App extension resource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the Container App. + /// Name of the Logic App, the extension resource. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response Delete(string subscriptionId, string resourceGroupName, string containerAppName, string logicAppName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(containerAppName, nameof(containerAppName)); + Argument.AssertNotNullOrEmpty(logicAppName, nameof(logicAppName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, containerAppName, logicAppName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListWorkflowsRequestUri(string subscriptionId, string resourceGroupName, string containerAppName, string logicAppName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.App/containerApps/", false); + uri.AppendPath(containerAppName, true); + uri.AppendPath("/providers/Microsoft.App/logicApps/", false); + uri.AppendPath(logicAppName, true); + uri.AppendPath("/workflows", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateListWorkflowsRequest(string subscriptionId, string resourceGroupName, string containerAppName, string logicAppName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.App/containerApps/", false); + uri.AppendPath(containerAppName, true); + uri.AppendPath("/providers/Microsoft.App/logicApps/", false); + uri.AppendPath(logicAppName, true); + uri.AppendPath("/workflows", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List the workflows for a logic app. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the Container App. + /// Name of the Logic App, the extension resource. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task> ListWorkflowsAsync(string subscriptionId, string resourceGroupName, string containerAppName, string logicAppName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(containerAppName, nameof(containerAppName)); + Argument.AssertNotNullOrEmpty(logicAppName, nameof(logicAppName)); + + using var message = CreateListWorkflowsRequest(subscriptionId, resourceGroupName, containerAppName, logicAppName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + Models.WorkflowEnvelopeCollection value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = Models.WorkflowEnvelopeCollection.DeserializeWorkflowEnvelopeCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List the workflows for a logic app. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the Container App. + /// Name of the Logic App, the extension resource. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response ListWorkflows(string subscriptionId, string resourceGroupName, string containerAppName, string logicAppName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(containerAppName, nameof(containerAppName)); + Argument.AssertNotNullOrEmpty(logicAppName, nameof(logicAppName)); + + using var message = CreateListWorkflowsRequest(subscriptionId, resourceGroupName, containerAppName, logicAppName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + Models.WorkflowEnvelopeCollection value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = Models.WorkflowEnvelopeCollection.DeserializeWorkflowEnvelopeCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateGetWorkflowRequestUri(string subscriptionId, string resourceGroupName, string containerAppName, string logicAppName, string workflowName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.App/containerApps/", false); + uri.AppendPath(containerAppName, true); + uri.AppendPath("/providers/Microsoft.App/logicApps/", false); + uri.AppendPath(logicAppName, true); + uri.AppendPath("/workflows/", false); + uri.AppendPath(workflowName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateGetWorkflowRequest(string subscriptionId, string resourceGroupName, string containerAppName, string logicAppName, string workflowName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.App/containerApps/", false); + uri.AppendPath(containerAppName, true); + uri.AppendPath("/providers/Microsoft.App/logicApps/", false); + uri.AppendPath(logicAppName, true); + uri.AppendPath("/workflows/", false); + uri.AppendPath(workflowName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Get workflow information by its name. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the Container App. + /// Name of the Logic App, the extension resource. + /// Workflow name. + /// The cancellation token to use. + /// , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public async Task> GetWorkflowAsync(string subscriptionId, string resourceGroupName, string containerAppName, string logicAppName, string workflowName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(containerAppName, nameof(containerAppName)); + Argument.AssertNotNullOrEmpty(logicAppName, nameof(logicAppName)); + Argument.AssertNotNullOrEmpty(workflowName, nameof(workflowName)); + + using var message = CreateGetWorkflowRequest(subscriptionId, resourceGroupName, containerAppName, logicAppName, workflowName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + WorkflowEnvelopeData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = WorkflowEnvelopeData.DeserializeWorkflowEnvelopeData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((WorkflowEnvelopeData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + /// Get workflow information by its name. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the Container App. + /// Name of the Logic App, the extension resource. + /// Workflow name. + /// The cancellation token to use. + /// , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public Response GetWorkflow(string subscriptionId, string resourceGroupName, string containerAppName, string logicAppName, string workflowName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(containerAppName, nameof(containerAppName)); + Argument.AssertNotNullOrEmpty(logicAppName, nameof(logicAppName)); + Argument.AssertNotNullOrEmpty(workflowName, nameof(workflowName)); + + using var message = CreateGetWorkflowRequest(subscriptionId, resourceGroupName, containerAppName, logicAppName, workflowName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + WorkflowEnvelopeData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = WorkflowEnvelopeData.DeserializeWorkflowEnvelopeData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((WorkflowEnvelopeData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateDeployWorkflowArtifactsRequestUri(string subscriptionId, string resourceGroupName, string containerAppName, string logicAppName, ContainerAppWorkflowArtifacts workflowArtifacts) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.App/containerApps/", false); + uri.AppendPath(containerAppName, true); + uri.AppendPath("/providers/Microsoft.App/logicApps/", false); + uri.AppendPath(logicAppName, true); + uri.AppendPath("/deployWorkflowArtifacts", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateDeployWorkflowArtifactsRequest(string subscriptionId, string resourceGroupName, string containerAppName, string logicAppName, ContainerAppWorkflowArtifacts workflowArtifacts) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.App/containerApps/", false); + uri.AppendPath(containerAppName, true); + uri.AppendPath("/providers/Microsoft.App/logicApps/", false); + uri.AppendPath(logicAppName, true); + uri.AppendPath("/deployWorkflowArtifacts", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + if (workflowArtifacts != null) + { + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(workflowArtifacts, ModelSerializationExtensions.WireOptions); + request.Content = content; + } + _userAgent.Apply(message); + return message; + } + + /// Creates or updates the artifacts for the logic app. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the Container App. + /// Name of the Logic App, the extension resource. + /// Application settings and files of the workflow. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task DeployWorkflowArtifactsAsync(string subscriptionId, string resourceGroupName, string containerAppName, string logicAppName, ContainerAppWorkflowArtifacts workflowArtifacts = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(containerAppName, nameof(containerAppName)); + Argument.AssertNotNullOrEmpty(logicAppName, nameof(logicAppName)); + + using var message = CreateDeployWorkflowArtifactsRequest(subscriptionId, resourceGroupName, containerAppName, logicAppName, workflowArtifacts); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Creates or updates the artifacts for the logic app. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the Container App. + /// Name of the Logic App, the extension resource. + /// Application settings and files of the workflow. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response DeployWorkflowArtifacts(string subscriptionId, string resourceGroupName, string containerAppName, string logicAppName, ContainerAppWorkflowArtifacts workflowArtifacts = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(containerAppName, nameof(containerAppName)); + Argument.AssertNotNullOrEmpty(logicAppName, nameof(logicAppName)); + + using var message = CreateDeployWorkflowArtifactsRequest(subscriptionId, resourceGroupName, containerAppName, logicAppName, workflowArtifacts); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListWorkflowsConnectionsRequestUri(string subscriptionId, string resourceGroupName, string containerAppName, string logicAppName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.App/containerApps/", false); + uri.AppendPath(containerAppName, true); + uri.AppendPath("/providers/Microsoft.App/logicApps/", false); + uri.AppendPath(logicAppName, true); + uri.AppendPath("/listWorkflowsConnections", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateListWorkflowsConnectionsRequest(string subscriptionId, string resourceGroupName, string containerAppName, string logicAppName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.App/containerApps/", false); + uri.AppendPath(containerAppName, true); + uri.AppendPath("/providers/Microsoft.App/logicApps/", false); + uri.AppendPath(logicAppName, true); + uri.AppendPath("/listWorkflowsConnections", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Gets logic app's connections. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the Container App. + /// Name of the Logic App, the extension resource. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task> ListWorkflowsConnectionsAsync(string subscriptionId, string resourceGroupName, string containerAppName, string logicAppName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(containerAppName, nameof(containerAppName)); + Argument.AssertNotNullOrEmpty(logicAppName, nameof(logicAppName)); + + using var message = CreateListWorkflowsConnectionsRequest(subscriptionId, resourceGroupName, containerAppName, logicAppName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + WorkflowEnvelopeData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = WorkflowEnvelopeData.DeserializeWorkflowEnvelopeData(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Gets logic app's connections. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the Container App. + /// Name of the Logic App, the extension resource. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response ListWorkflowsConnections(string subscriptionId, string resourceGroupName, string containerAppName, string logicAppName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(containerAppName, nameof(containerAppName)); + Argument.AssertNotNullOrEmpty(logicAppName, nameof(logicAppName)); + + using var message = CreateListWorkflowsConnectionsRequest(subscriptionId, resourceGroupName, containerAppName, logicAppName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + WorkflowEnvelopeData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = WorkflowEnvelopeData.DeserializeWorkflowEnvelopeData(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateInvokeRequestUri(string subscriptionId, string resourceGroupName, string containerAppName, string logicAppName, string xMsLogicAppsProxyPath, LogicAppsProxyMethod xMsLogicAppsProxyMethod) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.App/containerApps/", false); + uri.AppendPath(containerAppName, true); + uri.AppendPath("/providers/Microsoft.App/logicApps/", false); + uri.AppendPath(logicAppName, true); + uri.AppendPath("/invoke", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateInvokeRequest(string subscriptionId, string resourceGroupName, string containerAppName, string logicAppName, string xMsLogicAppsProxyPath, LogicAppsProxyMethod xMsLogicAppsProxyMethod) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.App/containerApps/", false); + uri.AppendPath(containerAppName, true); + uri.AppendPath("/providers/Microsoft.App/logicApps/", false); + uri.AppendPath(logicAppName, true); + uri.AppendPath("/invoke", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("x-ms-logicApps-proxy-path", xMsLogicAppsProxyPath); + request.Headers.Add("x-ms-logicApps-proxy-method", xMsLogicAppsProxyMethod.ToString()); + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Proxies a the API call to the logic app backed by the container app. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the Container App. + /// Name of the LogicApp App, the extension resource. + /// The proxy path for the API call. + /// The proxy method for the API call. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task> InvokeAsync(string subscriptionId, string resourceGroupName, string containerAppName, string logicAppName, string xMsLogicAppsProxyPath, LogicAppsProxyMethod xMsLogicAppsProxyMethod, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(containerAppName, nameof(containerAppName)); + Argument.AssertNotNullOrEmpty(logicAppName, nameof(logicAppName)); + Argument.AssertNotNull(xMsLogicAppsProxyPath, nameof(xMsLogicAppsProxyPath)); + + using var message = CreateInvokeRequest(subscriptionId, resourceGroupName, containerAppName, logicAppName, xMsLogicAppsProxyPath, xMsLogicAppsProxyMethod); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + BinaryData value = default; + value = await BinaryData.FromStreamAsync(message.Response.ContentStream).ConfigureAwait(false); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Proxies a the API call to the logic app backed by the container app. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the Container App. + /// Name of the LogicApp App, the extension resource. + /// The proxy path for the API call. + /// The proxy method for the API call. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response Invoke(string subscriptionId, string resourceGroupName, string containerAppName, string logicAppName, string xMsLogicAppsProxyPath, LogicAppsProxyMethod xMsLogicAppsProxyMethod, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(containerAppName, nameof(containerAppName)); + Argument.AssertNotNullOrEmpty(logicAppName, nameof(logicAppName)); + Argument.AssertNotNull(xMsLogicAppsProxyPath, nameof(xMsLogicAppsProxyPath)); + + using var message = CreateInvokeRequest(subscriptionId, resourceGroupName, containerAppName, logicAppName, xMsLogicAppsProxyPath, xMsLogicAppsProxyMethod); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + BinaryData value = default; + value = BinaryData.FromStream(message.Response.ContentStream); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListWorkflowsNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName, string containerAppName, string logicAppName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + return uri; + } + + internal HttpMessage CreateListWorkflowsNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string containerAppName, string logicAppName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List the workflows for a logic app. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the Container App. + /// Name of the Logic App, the extension resource. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task> ListWorkflowsNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string containerAppName, string logicAppName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(containerAppName, nameof(containerAppName)); + Argument.AssertNotNullOrEmpty(logicAppName, nameof(logicAppName)); + + using var message = CreateListWorkflowsNextPageRequest(nextLink, subscriptionId, resourceGroupName, containerAppName, logicAppName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + Models.WorkflowEnvelopeCollection value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = Models.WorkflowEnvelopeCollection.DeserializeWorkflowEnvelopeCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List the workflows for a logic app. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the Container App. + /// Name of the Logic App, the extension resource. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response ListWorkflowsNextPage(string nextLink, string subscriptionId, string resourceGroupName, string containerAppName, string logicAppName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(containerAppName, nameof(containerAppName)); + Argument.AssertNotNullOrEmpty(logicAppName, nameof(logicAppName)); + + using var message = CreateListWorkflowsNextPageRequest(nextLink, subscriptionId, resourceGroupName, containerAppName, logicAppName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + Models.WorkflowEnvelopeCollection value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = Models.WorkflowEnvelopeCollection.DeserializeWorkflowEnvelopeCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/RestOperations/MaintenanceConfigurationsRestOperations.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/RestOperations/MaintenanceConfigurationsRestOperations.cs new file mode 100644 index 000000000000..203d4f7b34fe --- /dev/null +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/RestOperations/MaintenanceConfigurationsRestOperations.cs @@ -0,0 +1,523 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.AppContainers.Models; + +namespace Azure.ResourceManager.AppContainers +{ + internal partial class MaintenanceConfigurationsRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of MaintenanceConfigurationsRestOperations. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// The application id to use for user agent. + /// server parameter. + /// Api Version. + /// or is null. + public MaintenanceConfigurationsRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) + { + _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); + _endpoint = endpoint ?? new Uri("https://management.azure.com"); + _apiVersion = apiVersion ?? "2025-02-02-preview"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal RequestUriBuilder CreateListRequestUri(string subscriptionId, string resourceGroupName, string environmentName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.App/managedEnvironments/", false); + uri.AppendPath(environmentName, true); + uri.AppendPath("/maintenanceConfigurations", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateListRequest(string subscriptionId, string resourceGroupName, string environmentName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.App/managedEnvironments/", false); + uri.AppendPath(environmentName, true); + uri.AppendPath("/maintenanceConfigurations", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Gets all maintenance configurations in the specified Managed Environment. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the Managed Environment. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> ListAsync(string subscriptionId, string resourceGroupName, string environmentName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(environmentName, nameof(environmentName)); + + using var message = CreateListRequest(subscriptionId, resourceGroupName, environmentName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + MaintenanceConfigurationCollection value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = MaintenanceConfigurationCollection.DeserializeMaintenanceConfigurationCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Gets all maintenance configurations in the specified Managed Environment. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the Managed Environment. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response List(string subscriptionId, string resourceGroupName, string environmentName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(environmentName, nameof(environmentName)); + + using var message = CreateListRequest(subscriptionId, resourceGroupName, environmentName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + MaintenanceConfigurationCollection value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = MaintenanceConfigurationCollection.DeserializeMaintenanceConfigurationCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateCreateOrUpdateRequestUri(string subscriptionId, string resourceGroupName, string environmentName, string configName, MaintenanceConfigurationResourceData data) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.App/managedEnvironments/", false); + uri.AppendPath(environmentName, true); + uri.AppendPath("/maintenanceConfigurations/", false); + uri.AppendPath(configName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateCreateOrUpdateRequest(string subscriptionId, string resourceGroupName, string environmentName, string configName, MaintenanceConfigurationResourceData data) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Put; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.App/managedEnvironments/", false); + uri.AppendPath(environmentName, true); + uri.AppendPath("/maintenanceConfigurations/", false); + uri.AppendPath(configName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(data, ModelSerializationExtensions.WireOptions); + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// Create or update the maintenance configuration for Managed Environment. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the Managed Environment. + /// The name of the maintenance configuration. + /// Parameters to set the maintenance configuration for ManagedEnvironment . + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task> CreateOrUpdateAsync(string subscriptionId, string resourceGroupName, string environmentName, string configName, MaintenanceConfigurationResourceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(environmentName, nameof(environmentName)); + Argument.AssertNotNullOrEmpty(configName, nameof(configName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, environmentName, configName, data); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 201: + { + MaintenanceConfigurationResourceData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = MaintenanceConfigurationResourceData.DeserializeMaintenanceConfigurationResourceData(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Create or update the maintenance configuration for Managed Environment. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the Managed Environment. + /// The name of the maintenance configuration. + /// Parameters to set the maintenance configuration for ManagedEnvironment . + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response CreateOrUpdate(string subscriptionId, string resourceGroupName, string environmentName, string configName, MaintenanceConfigurationResourceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(environmentName, nameof(environmentName)); + Argument.AssertNotNullOrEmpty(configName, nameof(configName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, environmentName, configName, data); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 201: + { + MaintenanceConfigurationResourceData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = MaintenanceConfigurationResourceData.DeserializeMaintenanceConfigurationResourceData(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string resourceGroupName, string environmentName, string configName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.App/managedEnvironments/", false); + uri.AppendPath(environmentName, true); + uri.AppendPath("/maintenanceConfigurations/", false); + uri.AppendPath(configName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string environmentName, string configName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Delete; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.App/managedEnvironments/", false); + uri.AppendPath(environmentName, true); + uri.AppendPath("/maintenanceConfigurations/", false); + uri.AppendPath(configName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Deletes the maintenance configuration of a ManagedEnvironment . + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the Managed Environment. + /// The name of the maintenance configuration. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task DeleteAsync(string subscriptionId, string resourceGroupName, string environmentName, string configName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(environmentName, nameof(environmentName)); + Argument.AssertNotNullOrEmpty(configName, nameof(configName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, environmentName, configName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Deletes the maintenance configuration of a ManagedEnvironment . + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the Managed Environment. + /// The name of the maintenance configuration. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response Delete(string subscriptionId, string resourceGroupName, string environmentName, string configName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(environmentName, nameof(environmentName)); + Argument.AssertNotNullOrEmpty(configName, nameof(configName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, environmentName, configName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string environmentName, string configName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.App/managedEnvironments/", false); + uri.AppendPath(environmentName, true); + uri.AppendPath("/maintenanceConfigurations/", false); + uri.AppendPath(configName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string environmentName, string configName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.App/managedEnvironments/", false); + uri.AppendPath(environmentName, true); + uri.AppendPath("/maintenanceConfigurations/", false); + uri.AppendPath(configName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Gets the maintenance configuration of a ManagedEnvironment . + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the Managed Environment. + /// The name of the maintenance configuration. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task> GetAsync(string subscriptionId, string resourceGroupName, string environmentName, string configName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(environmentName, nameof(environmentName)); + Argument.AssertNotNullOrEmpty(configName, nameof(configName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, environmentName, configName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + MaintenanceConfigurationResourceData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = MaintenanceConfigurationResourceData.DeserializeMaintenanceConfigurationResourceData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((MaintenanceConfigurationResourceData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + /// Gets the maintenance configuration of a ManagedEnvironment . + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the Managed Environment. + /// The name of the maintenance configuration. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response Get(string subscriptionId, string resourceGroupName, string environmentName, string configName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(environmentName, nameof(environmentName)); + Argument.AssertNotNullOrEmpty(configName, nameof(configName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, environmentName, configName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + MaintenanceConfigurationResourceData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = MaintenanceConfigurationResourceData.DeserializeMaintenanceConfigurationResourceData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((MaintenanceConfigurationResourceData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName, string environmentName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + return uri; + } + + internal HttpMessage CreateListNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string environmentName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Gets all maintenance configurations in the specified Managed Environment. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the Managed Environment. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> ListNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string environmentName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(environmentName, nameof(environmentName)); + + using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, environmentName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + MaintenanceConfigurationCollection value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = MaintenanceConfigurationCollection.DeserializeMaintenanceConfigurationCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Gets all maintenance configurations in the specified Managed Environment. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the Managed Environment. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response ListNextPage(string nextLink, string subscriptionId, string resourceGroupName, string environmentName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(environmentName, nameof(environmentName)); + + using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, environmentName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + MaintenanceConfigurationCollection value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = MaintenanceConfigurationCollection.DeserializeMaintenanceConfigurationCollection(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/RestOperations/ManagedCertificatesRestOperations.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/RestOperations/ManagedCertificatesRestOperations.cs index 09923fabb48d..9c2b153c9471 100644 --- a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/RestOperations/ManagedCertificatesRestOperations.cs +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/RestOperations/ManagedCertificatesRestOperations.cs @@ -32,7 +32,7 @@ public ManagedCertificatesRestOperations(HttpPipeline pipeline, string applicati { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2025-01-01"; + _apiVersion = apiVersion ?? "2025-02-02-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } @@ -75,7 +75,7 @@ internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGrou } /// Get the specified Managed Certificate. - /// The ID of the target subscription. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Name of the Managed Environment. /// Name of the Managed Certificate. @@ -108,7 +108,7 @@ public async Task> GetAsync(string } /// Get the specified Managed Certificate. - /// The ID of the target subscription. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Name of the Managed Environment. /// Name of the Managed Certificate. @@ -183,7 +183,7 @@ internal HttpMessage CreateCreateOrUpdateRequest(string subscriptionId, string r } /// Create or Update a Managed Certificate. - /// The ID of the target subscription. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Name of the Managed Environment. /// Name of the Managed Certificate. @@ -212,7 +212,7 @@ public async Task CreateOrUpdateAsync(string subscriptionId, string re } /// Create or Update a Managed Certificate. - /// The ID of the target subscription. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Name of the Managed Environment. /// Name of the Managed Certificate. @@ -279,7 +279,7 @@ internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceG } /// Deletes the specified Managed Certificate. - /// The ID of the target subscription. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Name of the Managed Environment. /// Name of the Managed Certificate. @@ -306,7 +306,7 @@ public async Task DeleteAsync(string subscriptionId, string resourceGr } /// Deletes the specified Managed Certificate. - /// The ID of the target subscription. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Name of the Managed Environment. /// Name of the Managed Certificate. @@ -375,7 +375,7 @@ internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceG } /// Patches a managed certificate. Oly patching of tags is supported. - /// The ID of the target subscription. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Name of the Managed Environment. /// Name of the Managed Certificate. @@ -408,7 +408,7 @@ public async Task> UpdateAsync(stri } /// Patches a managed certificate. Oly patching of tags is supported. - /// The ID of the target subscription. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Name of the Managed Environment. /// Name of the Managed Certificate. @@ -477,7 +477,7 @@ internal HttpMessage CreateListRequest(string subscriptionId, string resourceGro } /// Get the Managed Certificates in a given managed environment. - /// The ID of the target subscription. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Name of the Managed Environment. /// The cancellation token to use. @@ -506,7 +506,7 @@ public async Task> ListAsync(string subsc } /// Get the Managed Certificates in a given managed environment. - /// The ID of the target subscription. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Name of the Managed Environment. /// The cancellation token to use. @@ -558,7 +558,7 @@ internal HttpMessage CreateListNextPageRequest(string nextLink, string subscript /// Get the Managed Certificates in a given managed environment. /// The URL to the next page of results. - /// The ID of the target subscription. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Name of the Managed Environment. /// The cancellation token to use. @@ -589,7 +589,7 @@ public async Task> ListNextPageAsync(stri /// Get the Managed Certificates in a given managed environment. /// The URL to the next page of results. - /// The ID of the target subscription. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Name of the Managed Environment. /// The cancellation token to use. diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/RestOperations/ManagedEnvironmentDiagnosticsRestOperations.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/RestOperations/ManagedEnvironmentDiagnosticsRestOperations.cs index b48f4d59d1c1..a6ec63327913 100644 --- a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/RestOperations/ManagedEnvironmentDiagnosticsRestOperations.cs +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/RestOperations/ManagedEnvironmentDiagnosticsRestOperations.cs @@ -32,7 +32,7 @@ public ManagedEnvironmentDiagnosticsRestOperations(HttpPipeline pipeline, string { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2025-01-01"; + _apiVersion = apiVersion ?? "2025-02-02-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } @@ -73,7 +73,7 @@ internal HttpMessage CreateListDetectorsRequest(string subscriptionId, string re } /// Get the list of diagnostics for a Managed Environment used to host container apps. - /// The ID of the target subscription. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Name of the Environment. /// The cancellation token to use. @@ -102,7 +102,7 @@ public async Task> ListDetectorsAsync(string sub } /// Get the list of diagnostics for a Managed Environment used to host container apps. - /// The ID of the target subscription. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Name of the Environment. /// The cancellation token to use. @@ -169,7 +169,7 @@ internal HttpMessage CreateGetDetectorRequest(string subscriptionId, string reso } /// Get the diagnostics data for a Managed Environment used to host container apps. - /// The ID of the target subscription. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Name of the Environment. /// Name of the Managed Environment detector. @@ -202,7 +202,7 @@ public async Task> GetDetectorAsync(string } /// Get the diagnostics data for a Managed Environment used to host container apps. - /// The ID of the target subscription. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Name of the Environment. /// Name of the Managed Environment detector. diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/RestOperations/ManagedEnvironmentPrivateEndpointConnectionsRestOperations.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/RestOperations/ManagedEnvironmentPrivateEndpointConnectionsRestOperations.cs new file mode 100644 index 000000000000..59a1ec24b5cb --- /dev/null +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/RestOperations/ManagedEnvironmentPrivateEndpointConnectionsRestOperations.cs @@ -0,0 +1,513 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.AppContainers.Models; + +namespace Azure.ResourceManager.AppContainers +{ + internal partial class ManagedEnvironmentPrivateEndpointConnectionsRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of ManagedEnvironmentPrivateEndpointConnectionsRestOperations. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// The application id to use for user agent. + /// server parameter. + /// Api Version. + /// or is null. + public ManagedEnvironmentPrivateEndpointConnectionsRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) + { + _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); + _endpoint = endpoint ?? new Uri("https://management.azure.com"); + _apiVersion = apiVersion ?? "2025-02-02-preview"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal RequestUriBuilder CreateListRequestUri(string subscriptionId, string resourceGroupName, string environmentName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.App/managedEnvironments/", false); + uri.AppendPath(environmentName, true); + uri.AppendPath("/privateEndpointConnections", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateListRequest(string subscriptionId, string resourceGroupName, string environmentName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.App/managedEnvironments/", false); + uri.AppendPath(environmentName, true); + uri.AppendPath("/privateEndpointConnections", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List private endpoint connections for a given managed environment. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the Managed Environment. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> ListAsync(string subscriptionId, string resourceGroupName, string environmentName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(environmentName, nameof(environmentName)); + + using var message = CreateListRequest(subscriptionId, resourceGroupName, environmentName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + AppContainersPrivateEndpointConnectionListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = AppContainersPrivateEndpointConnectionListResult.DeserializeAppContainersPrivateEndpointConnectionListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List private endpoint connections for a given managed environment. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the Managed Environment. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response List(string subscriptionId, string resourceGroupName, string environmentName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(environmentName, nameof(environmentName)); + + using var message = CreateListRequest(subscriptionId, resourceGroupName, environmentName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + AppContainersPrivateEndpointConnectionListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = AppContainersPrivateEndpointConnectionListResult.DeserializeAppContainersPrivateEndpointConnectionListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string environmentName, string privateEndpointConnectionName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.App/managedEnvironments/", false); + uri.AppendPath(environmentName, true); + uri.AppendPath("/privateEndpointConnections/", false); + uri.AppendPath(privateEndpointConnectionName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string environmentName, string privateEndpointConnectionName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.App/managedEnvironments/", false); + uri.AppendPath(environmentName, true); + uri.AppendPath("/privateEndpointConnections/", false); + uri.AppendPath(privateEndpointConnectionName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Get a private endpoint connection for a given managed environment. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the Managed Environment. + /// The name of the private endpoint connection associated with the Azure resource. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task> GetAsync(string subscriptionId, string resourceGroupName, string environmentName, string privateEndpointConnectionName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(environmentName, nameof(environmentName)); + Argument.AssertNotNullOrEmpty(privateEndpointConnectionName, nameof(privateEndpointConnectionName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, environmentName, privateEndpointConnectionName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + AppContainersPrivateEndpointConnectionData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = AppContainersPrivateEndpointConnectionData.DeserializeAppContainersPrivateEndpointConnectionData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((AppContainersPrivateEndpointConnectionData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + /// Get a private endpoint connection for a given managed environment. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the Managed Environment. + /// The name of the private endpoint connection associated with the Azure resource. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response Get(string subscriptionId, string resourceGroupName, string environmentName, string privateEndpointConnectionName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(environmentName, nameof(environmentName)); + Argument.AssertNotNullOrEmpty(privateEndpointConnectionName, nameof(privateEndpointConnectionName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, environmentName, privateEndpointConnectionName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + AppContainersPrivateEndpointConnectionData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = AppContainersPrivateEndpointConnectionData.DeserializeAppContainersPrivateEndpointConnectionData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((AppContainersPrivateEndpointConnectionData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateCreateOrUpdateRequestUri(string subscriptionId, string resourceGroupName, string environmentName, string privateEndpointConnectionName, AppContainersPrivateEndpointConnectionData data) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.App/managedEnvironments/", false); + uri.AppendPath(environmentName, true); + uri.AppendPath("/privateEndpointConnections/", false); + uri.AppendPath(privateEndpointConnectionName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateCreateOrUpdateRequest(string subscriptionId, string resourceGroupName, string environmentName, string privateEndpointConnectionName, AppContainersPrivateEndpointConnectionData data) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Put; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.App/managedEnvironments/", false); + uri.AppendPath(environmentName, true); + uri.AppendPath("/privateEndpointConnections/", false); + uri.AppendPath(privateEndpointConnectionName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(data, ModelSerializationExtensions.WireOptions); + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// Update the state of a private endpoint connection for a given managed environment. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the Managed Environment. + /// The name of the private endpoint connection associated with the Azure resource. + /// The resource of private endpoint and its properties. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task CreateOrUpdateAsync(string subscriptionId, string resourceGroupName, string environmentName, string privateEndpointConnectionName, AppContainersPrivateEndpointConnectionData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(environmentName, nameof(environmentName)); + Argument.AssertNotNullOrEmpty(privateEndpointConnectionName, nameof(privateEndpointConnectionName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, environmentName, privateEndpointConnectionName, data); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 201: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Update the state of a private endpoint connection for a given managed environment. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the Managed Environment. + /// The name of the private endpoint connection associated with the Azure resource. + /// The resource of private endpoint and its properties. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response CreateOrUpdate(string subscriptionId, string resourceGroupName, string environmentName, string privateEndpointConnectionName, AppContainersPrivateEndpointConnectionData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(environmentName, nameof(environmentName)); + Argument.AssertNotNullOrEmpty(privateEndpointConnectionName, nameof(privateEndpointConnectionName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, environmentName, privateEndpointConnectionName, data); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 201: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string resourceGroupName, string environmentName, string privateEndpointConnectionName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.App/managedEnvironments/", false); + uri.AppendPath(environmentName, true); + uri.AppendPath("/privateEndpointConnections/", false); + uri.AppendPath(privateEndpointConnectionName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string environmentName, string privateEndpointConnectionName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Delete; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.App/managedEnvironments/", false); + uri.AppendPath(environmentName, true); + uri.AppendPath("/privateEndpointConnections/", false); + uri.AppendPath(privateEndpointConnectionName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Delete a private endpoint connection for a given managed environment. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the Managed Environment. + /// The name of the private endpoint connection associated with the Azure resource. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task DeleteAsync(string subscriptionId, string resourceGroupName, string environmentName, string privateEndpointConnectionName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(environmentName, nameof(environmentName)); + Argument.AssertNotNullOrEmpty(privateEndpointConnectionName, nameof(privateEndpointConnectionName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, environmentName, privateEndpointConnectionName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Delete a private endpoint connection for a given managed environment. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the Managed Environment. + /// The name of the private endpoint connection associated with the Azure resource. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response Delete(string subscriptionId, string resourceGroupName, string environmentName, string privateEndpointConnectionName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(environmentName, nameof(environmentName)); + Argument.AssertNotNullOrEmpty(privateEndpointConnectionName, nameof(privateEndpointConnectionName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, environmentName, privateEndpointConnectionName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName, string environmentName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + return uri; + } + + internal HttpMessage CreateListNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string environmentName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List private endpoint connections for a given managed environment. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the Managed Environment. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> ListNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string environmentName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(environmentName, nameof(environmentName)); + + using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, environmentName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + AppContainersPrivateEndpointConnectionListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = AppContainersPrivateEndpointConnectionListResult.DeserializeAppContainersPrivateEndpointConnectionListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List private endpoint connections for a given managed environment. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the Managed Environment. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response ListNextPage(string nextLink, string subscriptionId, string resourceGroupName, string environmentName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(environmentName, nameof(environmentName)); + + using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, environmentName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + AppContainersPrivateEndpointConnectionListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = AppContainersPrivateEndpointConnectionListResult.DeserializeAppContainersPrivateEndpointConnectionListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/RestOperations/ManagedEnvironmentPrivateLinkResourcesRestOperations.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/RestOperations/ManagedEnvironmentPrivateLinkResourcesRestOperations.cs new file mode 100644 index 000000000000..37c7e257bff4 --- /dev/null +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/RestOperations/ManagedEnvironmentPrivateLinkResourcesRestOperations.cs @@ -0,0 +1,217 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.AppContainers.Models; + +namespace Azure.ResourceManager.AppContainers +{ + internal partial class ManagedEnvironmentPrivateLinkResourcesRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of ManagedEnvironmentPrivateLinkResourcesRestOperations. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// The application id to use for user agent. + /// server parameter. + /// Api Version. + /// or is null. + public ManagedEnvironmentPrivateLinkResourcesRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) + { + _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); + _endpoint = endpoint ?? new Uri("https://management.azure.com"); + _apiVersion = apiVersion ?? "2025-02-02-preview"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal RequestUriBuilder CreateListRequestUri(string subscriptionId, string resourceGroupName, string environmentName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.App/managedEnvironments/", false); + uri.AppendPath(environmentName, true); + uri.AppendPath("/privateLinkResources", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateListRequest(string subscriptionId, string resourceGroupName, string environmentName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.App/managedEnvironments/", false); + uri.AppendPath(environmentName, true); + uri.AppendPath("/privateLinkResources", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List private link resources for a given managed environment. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the Managed Environment. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> ListAsync(string subscriptionId, string resourceGroupName, string environmentName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(environmentName, nameof(environmentName)); + + using var message = CreateListRequest(subscriptionId, resourceGroupName, environmentName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + AppContainersPrivateLinkResourceListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = AppContainersPrivateLinkResourceListResult.DeserializeAppContainersPrivateLinkResourceListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List private link resources for a given managed environment. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the Managed Environment. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response List(string subscriptionId, string resourceGroupName, string environmentName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(environmentName, nameof(environmentName)); + + using var message = CreateListRequest(subscriptionId, resourceGroupName, environmentName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + AppContainersPrivateLinkResourceListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = AppContainersPrivateLinkResourceListResult.DeserializeAppContainersPrivateLinkResourceListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName, string environmentName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + return uri; + } + + internal HttpMessage CreateListNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string environmentName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List private link resources for a given managed environment. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the Managed Environment. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> ListNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string environmentName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(environmentName, nameof(environmentName)); + + using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, environmentName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + AppContainersPrivateLinkResourceListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = AppContainersPrivateLinkResourceListResult.DeserializeAppContainersPrivateLinkResourceListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List private link resources for a given managed environment. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the Managed Environment. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response ListNextPage(string nextLink, string subscriptionId, string resourceGroupName, string environmentName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(environmentName, nameof(environmentName)); + + using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, environmentName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + AppContainersPrivateLinkResourceListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = AppContainersPrivateLinkResourceListResult.DeserializeAppContainersPrivateLinkResourceListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/RestOperations/ManagedEnvironmentUsagesRestOperations.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/RestOperations/ManagedEnvironmentUsagesRestOperations.cs index 1f14e2ce109a..0373afc83ba1 100644 --- a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/RestOperations/ManagedEnvironmentUsagesRestOperations.cs +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/RestOperations/ManagedEnvironmentUsagesRestOperations.cs @@ -32,7 +32,7 @@ public ManagedEnvironmentUsagesRestOperations(HttpPipeline pipeline, string appl { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2025-01-01"; + _apiVersion = apiVersion ?? "2025-02-02-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } @@ -73,7 +73,7 @@ internal HttpMessage CreateListRequest(string subscriptionId, string resourceGro } /// Gets the current usage information as well as the limits for environment. - /// The ID of the target subscription. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Name of the Environment. /// The cancellation token to use. @@ -102,7 +102,7 @@ public async Task> ListAsync(string subscriptionId, s } /// Gets the current usage information as well as the limits for environment. - /// The ID of the target subscription. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Name of the Environment. /// The cancellation token to use. @@ -154,7 +154,7 @@ internal HttpMessage CreateListNextPageRequest(string nextLink, string subscript /// Gets the current usage information as well as the limits for environment. /// The URL to the next page of results. - /// The ID of the target subscription. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Name of the Environment. /// The cancellation token to use. @@ -185,7 +185,7 @@ public async Task> ListNextPageAsync(string nextLink, /// Gets the current usage information as well as the limits for environment. /// The URL to the next page of results. - /// The ID of the target subscription. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Name of the Environment. /// The cancellation token to use. diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/RestOperations/ManagedEnvironmentsDiagnosticsRestOperations.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/RestOperations/ManagedEnvironmentsDiagnosticsRestOperations.cs index 3e03186ac4d4..72883af49deb 100644 --- a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/RestOperations/ManagedEnvironmentsDiagnosticsRestOperations.cs +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/RestOperations/ManagedEnvironmentsDiagnosticsRestOperations.cs @@ -31,7 +31,7 @@ public ManagedEnvironmentsDiagnosticsRestOperations(HttpPipeline pipeline, strin { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2025-01-01"; + _apiVersion = apiVersion ?? "2025-02-02-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } @@ -72,7 +72,7 @@ internal HttpMessage CreateGetRootRequest(string subscriptionId, string resource } /// Get the properties of a Managed Environment used to host container apps. - /// The ID of the target subscription. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Name of the Environment. /// The cancellation token to use. @@ -103,7 +103,7 @@ public async Task> GetRootAsync(str } /// Get the properties of a Managed Environment used to host container apps. - /// The ID of the target subscription. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Name of the Environment. /// The cancellation token to use. diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/RestOperations/ManagedEnvironmentsRestOperations.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/RestOperations/ManagedEnvironmentsRestOperations.cs index ba4a17dfbf2b..1cbcf31a57b4 100644 --- a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/RestOperations/ManagedEnvironmentsRestOperations.cs +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/RestOperations/ManagedEnvironmentsRestOperations.cs @@ -32,7 +32,7 @@ public ManagedEnvironmentsRestOperations(HttpPipeline pipeline, string applicati { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2025-01-01"; + _apiVersion = apiVersion ?? "2025-02-02-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } @@ -65,7 +65,7 @@ internal HttpMessage CreateListBySubscriptionRequest(string subscriptionId) } /// Get all Managed Environments for a subscription. - /// The ID of the target subscription. + /// The ID of the target subscription. The value must be an UUID. /// The cancellation token to use. /// is null. /// is an empty string, and was expected to be non-empty. @@ -90,7 +90,7 @@ public async Task> ListBySubscriptionAsy } /// Get all Managed Environments for a subscription. - /// The ID of the target subscription. + /// The ID of the target subscription. The value must be an UUID. /// The cancellation token to use. /// is null. /// is an empty string, and was expected to be non-empty. @@ -147,7 +147,7 @@ internal HttpMessage CreateListByResourceGroupRequest(string subscriptionId, str } /// Get all the Managed Environments in a resource group. - /// The ID of the target subscription. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// The cancellation token to use. /// or is null. @@ -174,7 +174,7 @@ public async Task> ListByResourceGroupAs } /// Get all the Managed Environments in a resource group. - /// The ID of the target subscription. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// The cancellation token to use. /// or is null. @@ -235,7 +235,7 @@ internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGrou } /// Get the properties of a Managed Environment used to host container apps. - /// The ID of the target subscription. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Name of the Environment. /// The cancellation token to use. @@ -266,7 +266,7 @@ public async Task> GetAsync(string } /// Get the properties of a Managed Environment used to host container apps. - /// The ID of the target subscription. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Name of the Environment. /// The cancellation token to use. @@ -335,7 +335,7 @@ internal HttpMessage CreateCreateOrUpdateRequest(string subscriptionId, string r } /// Creates or updates a Managed Environment used to host container apps. - /// The ID of the target subscription. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Name of the Environment. /// Configuration details of the Environment. @@ -362,7 +362,7 @@ public async Task CreateOrUpdateAsync(string subscriptionId, string re } /// Creates or updates a Managed Environment used to host container apps. - /// The ID of the target subscription. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Name of the Environment. /// Configuration details of the Environment. @@ -423,7 +423,7 @@ internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceG } /// Delete a Managed Environment if it does not have any container apps. - /// The ID of the target subscription. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Name of the Environment. /// The cancellation token to use. @@ -449,7 +449,7 @@ public async Task DeleteAsync(string subscriptionId, string resourceGr } /// Delete a Managed Environment if it does not have any container apps. - /// The ID of the target subscription. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Name of the Environment. /// The cancellation token to use. @@ -513,7 +513,7 @@ internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceG } /// Patches a Managed Environment using JSON Merge Patch. - /// The ID of the target subscription. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Name of the Environment. /// Configuration details of the Environment. @@ -540,7 +540,7 @@ public async Task UpdateAsync(string subscriptionId, string resourceGr } /// Patches a Managed Environment using JSON Merge Patch. - /// The ID of the target subscription. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Name of the Environment. /// Configuration details of the Environment. @@ -603,7 +603,7 @@ internal HttpMessage CreateGetAuthTokenRequest(string subscriptionId, string res } /// Checks if resource name is available. - /// The ID of the target subscription. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Name of the Managed Environment. /// The cancellation token to use. @@ -632,7 +632,7 @@ public async Task> GetAuthTokenAsync( } /// Checks if resource name is available. - /// The ID of the target subscription. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Name of the Managed Environment. /// The cancellation token to use. @@ -697,7 +697,7 @@ internal HttpMessage CreateListWorkloadProfileStatesRequest(string subscriptionI } /// Get all workload Profile States for a Managed Environment. - /// The ID of the target subscription. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Name of the Managed Environment. /// The cancellation token to use. @@ -726,7 +726,7 @@ public async Task> ListWorkloadProfile } /// Get all workload Profile States for a Managed Environment. - /// The ID of the target subscription. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Name of the Managed Environment. /// The cancellation token to use. @@ -778,7 +778,7 @@ internal HttpMessage CreateListBySubscriptionNextPageRequest(string nextLink, st /// Get all Managed Environments for a subscription. /// The URL to the next page of results. - /// The ID of the target subscription. + /// The ID of the target subscription. The value must be an UUID. /// The cancellation token to use. /// or is null. /// is an empty string, and was expected to be non-empty. @@ -805,7 +805,7 @@ public async Task> ListBySubscriptionNex /// Get all Managed Environments for a subscription. /// The URL to the next page of results. - /// The ID of the target subscription. + /// The ID of the target subscription. The value must be an UUID. /// The cancellation token to use. /// or is null. /// is an empty string, and was expected to be non-empty. @@ -854,7 +854,7 @@ internal HttpMessage CreateListByResourceGroupNextPageRequest(string nextLink, s /// Get all the Managed Environments in a resource group. /// The URL to the next page of results. - /// The ID of the target subscription. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// The cancellation token to use. /// , or is null. @@ -883,7 +883,7 @@ public async Task> ListByResourceGroupNe /// Get all the Managed Environments in a resource group. /// The URL to the next page of results. - /// The ID of the target subscription. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// The cancellation token to use. /// , or is null. @@ -934,7 +934,7 @@ internal HttpMessage CreateListWorkloadProfileStatesNextPageRequest(string nextL /// Get all workload Profile States for a Managed Environment. /// The URL to the next page of results. - /// The ID of the target subscription. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Name of the Managed Environment. /// The cancellation token to use. @@ -965,7 +965,7 @@ public async Task> ListWorkloadProfile /// Get all workload Profile States for a Managed Environment. /// The URL to the next page of results. - /// The ID of the target subscription. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Name of the Managed Environment. /// The cancellation token to use. diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/RestOperations/ManagedEnvironmentsStoragesRestOperations.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/RestOperations/ManagedEnvironmentsStoragesRestOperations.cs index 1f4fe0bae6b0..c8fd44bfa68c 100644 --- a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/RestOperations/ManagedEnvironmentsStoragesRestOperations.cs +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/RestOperations/ManagedEnvironmentsStoragesRestOperations.cs @@ -32,7 +32,7 @@ public ManagedEnvironmentsStoragesRestOperations(HttpPipeline pipeline, string a { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2025-01-01"; + _apiVersion = apiVersion ?? "2025-02-02-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } @@ -73,7 +73,7 @@ internal HttpMessage CreateListRequest(string subscriptionId, string resourceGro } /// Get all storages for a managedEnvironment. - /// The ID of the target subscription. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Name of the Environment. /// The cancellation token to use. @@ -102,7 +102,7 @@ public async Task> ListAsync(stri } /// Get all storages for a managedEnvironment. - /// The ID of the target subscription. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Name of the Environment. /// The cancellation token to use. @@ -169,7 +169,7 @@ internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGrou } /// Get storage for a managedEnvironment. - /// The ID of the target subscription. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Name of the Environment. /// Name of the storage. @@ -202,7 +202,7 @@ public async Task> GetAsync( } /// Get storage for a managedEnvironment. - /// The ID of the target subscription. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Name of the Environment. /// Name of the storage. @@ -277,7 +277,7 @@ internal HttpMessage CreateCreateOrUpdateRequest(string subscriptionId, string r } /// Create or update storage for a managedEnvironment. - /// The ID of the target subscription. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Name of the Environment. /// Name of the storage. @@ -298,6 +298,7 @@ public async Task> CreateOrU switch (message.Response.Status) { case 200: + case 201: { ContainerAppManagedEnvironmentStorageData value = default; using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); @@ -310,7 +311,7 @@ public async Task> CreateOrU } /// Create or update storage for a managedEnvironment. - /// The ID of the target subscription. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Name of the Environment. /// Name of the storage. @@ -331,6 +332,7 @@ public Response CreateOrUpdate(string switch (message.Response.Status) { case 200: + case 201: { ContainerAppManagedEnvironmentStorageData value = default; using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); @@ -381,7 +383,7 @@ internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceG } /// Delete storage for a managedEnvironment. - /// The ID of the target subscription. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Name of the Environment. /// Name of the storage. @@ -408,7 +410,7 @@ public async Task DeleteAsync(string subscriptionId, string resourceGr } /// Delete storage for a managedEnvironment. - /// The ID of the target subscription. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Name of the Environment. /// Name of the storage. diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/RestOperations/NamespacesRestOperations.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/RestOperations/NamespacesRestOperations.cs index cfd7b74f1d50..d66370a69428 100644 --- a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/RestOperations/NamespacesRestOperations.cs +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/RestOperations/NamespacesRestOperations.cs @@ -32,7 +32,7 @@ public NamespacesRestOperations(HttpPipeline pipeline, string applicationId, Uri { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2025-01-01"; + _apiVersion = apiVersion ?? "2025-02-02-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } @@ -77,7 +77,7 @@ internal HttpMessage CreateCheckNameAvailabilityRequest(string subscriptionId, s } /// Checks if resource name is available. - /// The ID of the target subscription. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Name of the Managed Environment. /// The check name availability request. @@ -108,7 +108,7 @@ public async Task> CheckNameAvailab } /// Checks if resource name is available. - /// The ID of the target subscription. + /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// Name of the Managed Environment. /// The check name availability request. diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/RestOperations/UsagesRestOperations.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/RestOperations/UsagesRestOperations.cs index 14bbd7a6cd15..8e2c8f227529 100644 --- a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/RestOperations/UsagesRestOperations.cs +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/RestOperations/UsagesRestOperations.cs @@ -32,7 +32,7 @@ public UsagesRestOperations(HttpPipeline pipeline, string applicationId, Uri end { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2025-01-01"; + _apiVersion = apiVersion ?? "2025-02-02-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } @@ -69,7 +69,7 @@ internal HttpMessage CreateListRequest(string subscriptionId, AzureLocation loca } /// Gets, for the specified location, the current resource usage information as well as the limits under the subscription. - /// The ID of the target subscription. + /// The ID of the target subscription. The value must be an UUID. /// The location for which resource usage is queried. /// The cancellation token to use. /// is null. @@ -95,7 +95,7 @@ public async Task> ListAsync(string subscriptionId, A } /// Gets, for the specified location, the current resource usage information as well as the limits under the subscription. - /// The ID of the target subscription. + /// The ID of the target subscription. The value must be an UUID. /// The location for which resource usage is queried. /// The cancellation token to use. /// is null. @@ -144,7 +144,7 @@ internal HttpMessage CreateListNextPageRequest(string nextLink, string subscript /// Gets, for the specified location, the current resource usage information as well as the limits under the subscription. /// The URL to the next page of results. - /// The ID of the target subscription. + /// The ID of the target subscription. The value must be an UUID. /// The location for which resource usage is queried. /// The cancellation token to use. /// or is null. @@ -172,7 +172,7 @@ public async Task> ListNextPageAsync(string nextLink, /// Gets, for the specified location, the current resource usage information as well as the limits under the subscription. /// The URL to the next page of results. - /// The ID of the target subscription. + /// The ID of the target subscription. The value must be an UUID. /// The location for which resource usage is queried. /// The cancellation token to use. /// or is null. diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/SessionPoolCollection.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/SessionPoolCollection.cs index e8cd13909073..d7f95c13df06 100644 --- a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/SessionPoolCollection.cs +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/SessionPoolCollection.cs @@ -65,7 +65,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -114,7 +114,7 @@ public virtual async Task> CreateOrUpdateAsync /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -163,7 +163,7 @@ public virtual ArmOperation CreateOrUpdate(WaitUntil waitUn /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -208,7 +208,7 @@ public virtual async Task> GetAsync(string session /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -253,7 +253,7 @@ public virtual Response Get(string sessionPoolName, Cancell /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -283,7 +283,7 @@ public virtual AsyncPageable GetAllAsync(CancellationToken /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -313,7 +313,7 @@ public virtual Pageable GetAll(CancellationToken cancellati /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -356,7 +356,7 @@ public virtual async Task> ExistsAsync(string sessionPoolName, Ca /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -399,7 +399,7 @@ public virtual Response Exists(string sessionPoolName, CancellationToken c /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -444,7 +444,7 @@ public virtual async Task> GetIfExistsAsyn /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/SessionPoolResource.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/SessionPoolResource.cs index 2e4769782ed9..2c1089f13df5 100644 --- a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/SessionPoolResource.cs +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/SessionPoolResource.cs @@ -103,7 +103,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -143,7 +143,7 @@ public virtual async Task> GetAsync(CancellationTo /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -183,7 +183,7 @@ public virtual Response Get(CancellationToken cancellationT /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -225,7 +225,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -267,7 +267,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -313,7 +313,7 @@ public virtual async Task> UpdateAsync(WaitUnt /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -359,7 +359,7 @@ public virtual ArmOperation Update(WaitUntil waitUntil, Ses /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -421,7 +421,7 @@ public virtual async Task> AddTagAsync(string key, /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -483,7 +483,7 @@ public virtual Response AddTag(string key, string value, Ca /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -540,7 +540,7 @@ public virtual async Task> SetTagsAsync(IDictionar /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -597,7 +597,7 @@ public virtual Response SetTags(IDictionary /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource @@ -657,7 +657,7 @@ public virtual async Task> RemoveTagAsync(string k /// /// /// Default Api Version - /// 2025-01-01 + /// 2025-02-02-preview /// /// /// Resource diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/WorkflowEnvelopeCollection.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/WorkflowEnvelopeCollection.cs new file mode 100644 index 000000000000..cf9efd8e0a37 --- /dev/null +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/WorkflowEnvelopeCollection.cs @@ -0,0 +1,395 @@ +// 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 Autorest.CSharp.Core; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.AppContainers +{ + /// + /// 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 GetWorkflowEnvelopes method from an instance of . + /// + public partial class WorkflowEnvelopeCollection : ArmCollection, IEnumerable, IAsyncEnumerable + { + private readonly ClientDiagnostics _workflowEnvelopeLogicAppsClientDiagnostics; + private readonly LogicAppsRestOperations _workflowEnvelopeLogicAppsRestClient; + + /// Initializes a new instance of the class for mocking. + protected WorkflowEnvelopeCollection() + { + } + + /// 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 WorkflowEnvelopeCollection(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _workflowEnvelopeLogicAppsClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.AppContainers", WorkflowEnvelopeResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(WorkflowEnvelopeResource.ResourceType, out string workflowEnvelopeLogicAppsApiVersion); + _workflowEnvelopeLogicAppsRestClient = new LogicAppsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, workflowEnvelopeLogicAppsApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != LogicAppResource.ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, LogicAppResource.ResourceType), nameof(id)); + } + + /// + /// Get workflow information by its name + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/providers/Microsoft.App/logicApps/{logicAppName}/workflows/{workflowName} + /// + /// + /// Operation Id + /// LogicApps_GetWorkflow + /// + /// + /// Default Api Version + /// 2025-02-02-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Workflow name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetAsync(string workflowName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(workflowName, nameof(workflowName)); + + using var scope = _workflowEnvelopeLogicAppsClientDiagnostics.CreateScope("WorkflowEnvelopeCollection.Get"); + scope.Start(); + try + { + var response = await _workflowEnvelopeLogicAppsRestClient.GetWorkflowAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, workflowName, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new WorkflowEnvelopeResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get workflow information by its name + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/providers/Microsoft.App/logicApps/{logicAppName}/workflows/{workflowName} + /// + /// + /// Operation Id + /// LogicApps_GetWorkflow + /// + /// + /// Default Api Version + /// 2025-02-02-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Workflow name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Get(string workflowName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(workflowName, nameof(workflowName)); + + using var scope = _workflowEnvelopeLogicAppsClientDiagnostics.CreateScope("WorkflowEnvelopeCollection.Get"); + scope.Start(); + try + { + var response = _workflowEnvelopeLogicAppsRestClient.GetWorkflow(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, workflowName, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new WorkflowEnvelopeResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// List the workflows for a logic app. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/providers/Microsoft.App/logicApps/{logicAppName}/workflows + /// + /// + /// Operation Id + /// LogicApps_ListWorkflows + /// + /// + /// Default Api Version + /// 2025-02-02-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// 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) => _workflowEnvelopeLogicAppsRestClient.CreateListWorkflowsRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _workflowEnvelopeLogicAppsRestClient.CreateListWorkflowsNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new WorkflowEnvelopeResource(Client, WorkflowEnvelopeData.DeserializeWorkflowEnvelopeData(e)), _workflowEnvelopeLogicAppsClientDiagnostics, Pipeline, "WorkflowEnvelopeCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// List the workflows for a logic app. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/providers/Microsoft.App/logicApps/{logicAppName}/workflows + /// + /// + /// Operation Id + /// LogicApps_ListWorkflows + /// + /// + /// Default Api Version + /// 2025-02-02-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// 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) => _workflowEnvelopeLogicAppsRestClient.CreateListWorkflowsRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _workflowEnvelopeLogicAppsRestClient.CreateListWorkflowsNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new WorkflowEnvelopeResource(Client, WorkflowEnvelopeData.DeserializeWorkflowEnvelopeData(e)), _workflowEnvelopeLogicAppsClientDiagnostics, Pipeline, "WorkflowEnvelopeCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/providers/Microsoft.App/logicApps/{logicAppName}/workflows/{workflowName} + /// + /// + /// Operation Id + /// LogicApps_GetWorkflow + /// + /// + /// Default Api Version + /// 2025-02-02-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Workflow name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> ExistsAsync(string workflowName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(workflowName, nameof(workflowName)); + + using var scope = _workflowEnvelopeLogicAppsClientDiagnostics.CreateScope("WorkflowEnvelopeCollection.Exists"); + scope.Start(); + try + { + var response = await _workflowEnvelopeLogicAppsRestClient.GetWorkflowAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, workflowName, 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.App/containerApps/{containerAppName}/providers/Microsoft.App/logicApps/{logicAppName}/workflows/{workflowName} + /// + /// + /// Operation Id + /// LogicApps_GetWorkflow + /// + /// + /// Default Api Version + /// 2025-02-02-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Workflow name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Exists(string workflowName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(workflowName, nameof(workflowName)); + + using var scope = _workflowEnvelopeLogicAppsClientDiagnostics.CreateScope("WorkflowEnvelopeCollection.Exists"); + scope.Start(); + try + { + var response = _workflowEnvelopeLogicAppsRestClient.GetWorkflow(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, workflowName, cancellationToken: cancellationToken); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/providers/Microsoft.App/logicApps/{logicAppName}/workflows/{workflowName} + /// + /// + /// Operation Id + /// LogicApps_GetWorkflow + /// + /// + /// Default Api Version + /// 2025-02-02-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Workflow name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetIfExistsAsync(string workflowName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(workflowName, nameof(workflowName)); + + using var scope = _workflowEnvelopeLogicAppsClientDiagnostics.CreateScope("WorkflowEnvelopeCollection.GetIfExists"); + scope.Start(); + try + { + var response = await _workflowEnvelopeLogicAppsRestClient.GetWorkflowAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, workflowName, cancellationToken: cancellationToken).ConfigureAwait(false); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new WorkflowEnvelopeResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/providers/Microsoft.App/logicApps/{logicAppName}/workflows/{workflowName} + /// + /// + /// Operation Id + /// LogicApps_GetWorkflow + /// + /// + /// Default Api Version + /// 2025-02-02-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Workflow name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual NullableResponse GetIfExists(string workflowName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(workflowName, nameof(workflowName)); + + using var scope = _workflowEnvelopeLogicAppsClientDiagnostics.CreateScope("WorkflowEnvelopeCollection.GetIfExists"); + scope.Start(); + try + { + var response = _workflowEnvelopeLogicAppsRestClient.GetWorkflow(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, workflowName, cancellationToken: cancellationToken); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new WorkflowEnvelopeResource(Client, response.Value), 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/containerapps/Azure.ResourceManager.AppContainers/src/Generated/WorkflowEnvelopeData.Serialization.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/WorkflowEnvelopeData.Serialization.cs new file mode 100644 index 000000000000..82a086ac7fa6 --- /dev/null +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/WorkflowEnvelopeData.Serialization.cs @@ -0,0 +1,307 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text; +using System.Text.Json; +using Azure.Core; +using Azure.ResourceManager.AppContainers.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.AppContainers +{ + public partial class WorkflowEnvelopeData : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(WorkflowEnvelopeData)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + if (Optional.IsDefined(Kind)) + { + writer.WritePropertyName("kind"u8); + writer.WriteStringValue(Kind); + } + if (Optional.IsDefined(Location)) + { + writer.WritePropertyName("location"u8); + writer.WriteStringValue(Location.Value); + } + if (Optional.IsDefined(Properties)) + { + writer.WritePropertyName("properties"u8); + writer.WriteObjectValue(Properties, options); + } + } + + WorkflowEnvelopeData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(WorkflowEnvelopeData)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeWorkflowEnvelopeData(document.RootElement, options); + } + + internal static WorkflowEnvelopeData DeserializeWorkflowEnvelopeData(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string kind = default; + AzureLocation? location = default; + ContainerAppWorkflowEnvelopeProperties properties = default; + ResourceIdentifier id = default; + string name = default; + ResourceType type = default; + SystemData systemData = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("kind"u8)) + { + kind = property.Value.GetString(); + continue; + } + if (property.NameEquals("location"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + location = new AzureLocation(property.Value.GetString()); + continue; + } + if (property.NameEquals("properties"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + properties = ContainerAppWorkflowEnvelopeProperties.DeserializeContainerAppWorkflowEnvelopeProperties(property.Value, options); + 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.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + systemData = JsonSerializer.Deserialize(property.Value.GetRawText()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new WorkflowEnvelopeData( + id, + name, + type, + systemData, + kind, + location, + properties, + serializedAdditionalRawData); + } + + private BinaryData SerializeBicep(ModelReaderWriterOptions options) + { + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Name), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" name: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Name)) + { + builder.Append(" name: "); + if (Name.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{Name}'''"); + } + else + { + builder.AppendLine($"'{Name}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Location), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" location: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Location)) + { + builder.Append(" location: "); + builder.AppendLine($"'{Location.Value.ToString()}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Kind), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" kind: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Kind)) + { + builder.Append(" kind: "); + if (Kind.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{Kind}'''"); + } + else + { + builder.AppendLine($"'{Kind}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Properties), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" properties: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Properties)) + { + builder.Append(" properties: "); + BicepSerializationHelpers.AppendChildObject(builder, Properties, options, 2, false, " properties: "); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Id), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" id: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Id)) + { + builder.Append(" id: "); + builder.AppendLine($"'{Id.ToString()}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(SystemData), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" systemData: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(SystemData)) + { + builder.Append(" systemData: "); + builder.AppendLine($"'{SystemData.ToString()}'"); + } + } + + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerAppContainersContext.Default); + case "bicep": + return SerializeBicep(options); + default: + throw new FormatException($"The model {nameof(WorkflowEnvelopeData)} does not support writing '{options.Format}' format."); + } + } + + WorkflowEnvelopeData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeWorkflowEnvelopeData(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(WorkflowEnvelopeData)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/WorkflowEnvelopeData.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/WorkflowEnvelopeData.cs new file mode 100644 index 000000000000..f59486f8de66 --- /dev/null +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/WorkflowEnvelopeData.cs @@ -0,0 +1,86 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; +using Azure.ResourceManager.AppContainers.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.AppContainers +{ + /// + /// A class representing the WorkflowEnvelope data model. + /// Workflow properties definition. + /// + public partial class WorkflowEnvelopeData : ResourceData + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + internal WorkflowEnvelopeData() + { + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The resource kind. + /// The resource location. + /// Additional workflow properties. + /// Keeps track of any properties unknown to the library. + internal WorkflowEnvelopeData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, string kind, AzureLocation? location, ContainerAppWorkflowEnvelopeProperties properties, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) + { + Kind = kind; + Location = location; + Properties = properties; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The resource kind. + [WirePath("kind")] + public string Kind { get; } + /// The resource location. + [WirePath("location")] + public AzureLocation? Location { get; } + /// Additional workflow properties. + [WirePath("properties")] + public ContainerAppWorkflowEnvelopeProperties Properties { get; } + } +} diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/WorkflowEnvelopeResource.Serialization.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/WorkflowEnvelopeResource.Serialization.cs new file mode 100644 index 000000000000..7700c37c422d --- /dev/null +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/WorkflowEnvelopeResource.Serialization.cs @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; + +namespace Azure.ResourceManager.AppContainers +{ + public partial class WorkflowEnvelopeResource : IJsonModel + { + private static WorkflowEnvelopeData s_dataDeserializationInstance; + private static WorkflowEnvelopeData DataDeserializationInstance => s_dataDeserializationInstance ??= new(); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); + + WorkflowEnvelopeData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)DataDeserializationInstance).Create(ref reader, options); + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options, AzureResourceManagerAppContainersContext.Default); + + WorkflowEnvelopeData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options, AzureResourceManagerAppContainersContext.Default); + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)DataDeserializationInstance).GetFormatFromOptions(options); + } +} diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/WorkflowEnvelopeResource.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/WorkflowEnvelopeResource.cs new file mode 100644 index 000000000000..3ce9e33184ed --- /dev/null +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/Generated/WorkflowEnvelopeResource.cs @@ -0,0 +1,172 @@ +// 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.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.AppContainers +{ + /// + /// A Class representing a WorkflowEnvelope 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 GetWorkflowEnvelopeResource method. + /// Otherwise you can get one from its parent resource using the GetWorkflowEnvelope method. + /// + public partial class WorkflowEnvelopeResource : ArmResource + { + /// Generate the resource identifier of a instance. + /// The subscriptionId. + /// The resourceGroupName. + /// The containerAppName. + /// The logicAppName. + /// The workflowName. + public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string containerAppName, string logicAppName, string workflowName) + { + var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/providers/Microsoft.App/logicApps/{logicAppName}/workflows/{workflowName}"; + return new ResourceIdentifier(resourceId); + } + + private readonly ClientDiagnostics _workflowEnvelopeLogicAppsClientDiagnostics; + private readonly LogicAppsRestOperations _workflowEnvelopeLogicAppsRestClient; + private readonly WorkflowEnvelopeData _data; + + /// Gets the resource type for the operations. + public static readonly ResourceType ResourceType = "Microsoft.App/logicApps/workflows"; + + /// Initializes a new instance of the class for mocking. + protected WorkflowEnvelopeResource() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The resource that is the target of operations. + internal WorkflowEnvelopeResource(ArmClient client, WorkflowEnvelopeData 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 WorkflowEnvelopeResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _workflowEnvelopeLogicAppsClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.AppContainers", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string workflowEnvelopeLogicAppsApiVersion); + _workflowEnvelopeLogicAppsRestClient = new LogicAppsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, workflowEnvelopeLogicAppsApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + /// 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 WorkflowEnvelopeData 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 workflow information by its name + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/providers/Microsoft.App/logicApps/{logicAppName}/workflows/{workflowName} + /// + /// + /// Operation Id + /// LogicApps_GetWorkflow + /// + /// + /// Default Api Version + /// 2025-02-02-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + { + using var scope = _workflowEnvelopeLogicAppsClientDiagnostics.CreateScope("WorkflowEnvelopeResource.Get"); + scope.Start(); + try + { + var response = await _workflowEnvelopeLogicAppsRestClient.GetWorkflowAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new WorkflowEnvelopeResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get workflow information by its name + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/providers/Microsoft.App/logicApps/{logicAppName}/workflows/{workflowName} + /// + /// + /// Operation Id + /// LogicApps_GetWorkflow + /// + /// + /// Default Api Version + /// 2025-02-02-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual Response Get(CancellationToken cancellationToken = default) + { + using var scope = _workflowEnvelopeLogicAppsClientDiagnostics.CreateScope("WorkflowEnvelopeResource.Get"); + scope.Start(); + try + { + var response = _workflowEnvelopeLogicAppsRestClient.GetWorkflow(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new WorkflowEnvelopeResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/autorest.md b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/autorest.md index 7f979eda6acb..260e7747a46c 100644 --- a/sdk/containerapps/Azure.ResourceManager.AppContainers/src/autorest.md +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/src/autorest.md @@ -7,8 +7,8 @@ azure-arm: true csharp: true library-name: AppContainers namespace: Azure.ResourceManager.AppContainers -require: https://github.com/Azure/azure-rest-api-specs/blob/24b224b17e698746d3c34e32f84dab7de5e4f2a8/specification/app/resource-manager/readme.md -#tag: package-2025-01-01 +require: https://github.com/Azure/azure-rest-api-specs/blob/be87218d7b0ae98a05d8dfaff1e40b9c68977f18/specification/app/resource-manager/readme.md +tag: package-preview-2025-02-02-preview output-folder: $(this-folder)/Generated clear-output-folder: true sample-gen: @@ -20,8 +20,8 @@ modelerfour: use-model-reader-writer: true enable-bicep-serialization: true -#mgmt-debug: -# show-serialized-names: true +# mgmt-debug: +# show-serialized-names: true format-by-name-rules: 'tenantId': 'uuid' @@ -246,10 +246,35 @@ rename-mapping: IdentitySettingsLifeCycle: ContainerAppIdentitySettingsLifeCycle IdentitySettings: ContainerAppIdentitySettings CertificateKeyVaultProperties: ContainerAppCertificateKeyVaultProperties + BlobStorageTokenStore: ContainerAppBlobStorageTokenStore + BuildConfiguration: ContainerAppBuildConfiguration + BuilderProvisioningState: ContainerAppBuilderProvisioningState + BuilderResourceUpdate: ContainerAppBuilderResourcePatch + BuildProvisioningState: ContainerAppBuildProvisioningState + BuildStatus: ContainerAppBuildStatus + BuildToken: ContainerAppBuildToken + CertificateType: ContainerAppCertificateType + ContainerRegistry: ContainerAppContainerRegistry + EnvironmentVariable: ContainerAppSimpleEnvironmentVariable + JobRunningState: ContainerAppJobRunningState + ResourceTags: ContainerAppResourceTags + Runtime: ContainerAppRuntime + RuntimeJava: ContainerAppRuntimeJava + RuntimeJavaAgent: ContainerAppRuntimeJavaAgent + Status: LabelHistoryRecordItemStatus + TimeoutPolicy: ContainerAppTimeoutPolicy + WeekDay: ContainerAppWeekDay + WorkflowArtifacts: ContainerAppWorkflowArtifacts + WorkflowEnvelopeProperties: ContainerAppWorkflowEnvelopeProperties + WorkflowHealth: ContainerAppWorkflowHealth + WorkflowHealthState: ContainerAppWorkflowHealthState + WorkflowState: ContainerAppWorkflowState + # Build: ContainerAppBuild + # Builder: ContainerAppBuilder request-path-to-resource-name: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/connectedEnvironments/{connectedEnvironmentName}/certificates/{certificateName}: ContainerAppConnectedEnvironmentCertificate - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/connectedEnvironments/{connectedEnvironmentName}/daprComponents/{componentName}: ContainerAppConnectedEnvironmentDaprComponent + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/connectedEnvironments/{connectedEnvironmentName}/daprComponents/{componentName}: ConnectedEnvironmentDaprComponent /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/certificates/{certificateName}: ContainerAppManagedEnvironmentCertificate /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}: ContainerAppManagedEnvironment /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/daprComponents/{componentName}: ContainerAppManagedEnvironmentDaprComponent diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/tests/Generated/Samples/Sample_AppContainersPrivateEndpointConnectionCollection.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/tests/Generated/Samples/Sample_AppContainersPrivateEndpointConnectionCollection.cs new file mode 100644 index 000000000000..13e87d047e52 --- /dev/null +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/tests/Generated/Samples/Sample_AppContainersPrivateEndpointConnectionCollection.cs @@ -0,0 +1,204 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.AppContainers.Models; +using NUnit.Framework; + +namespace Azure.ResourceManager.AppContainers.Samples +{ + public partial class Sample_AppContainersPrivateEndpointConnectionCollection + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task CreateOrUpdate_UpdateAPrivateEndpointConnectionByManagedEnvironment() + { + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/ManagedEnvironmentPrivateEndpointConnections_CreateOrUpdate.json + // this example is just showing the usage of "ManagedEnvironmentPrivateEndpointConnections_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ContainerAppManagedEnvironmentResource created on azure + // for more information of creating ContainerAppManagedEnvironmentResource, please refer to the document of ContainerAppManagedEnvironmentResource + string subscriptionId = "8efdecc5-919e-44eb-b179-915dca89ebf9"; + string resourceGroupName = "examplerg"; + string environmentName = "managedEnv"; + ResourceIdentifier containerAppManagedEnvironmentResourceId = ContainerAppManagedEnvironmentResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, environmentName); + ContainerAppManagedEnvironmentResource containerAppManagedEnvironment = client.GetContainerAppManagedEnvironmentResource(containerAppManagedEnvironmentResourceId); + + // get the collection of this AppContainersPrivateEndpointConnectionResource + AppContainersPrivateEndpointConnectionCollection collection = containerAppManagedEnvironment.GetAppContainersPrivateEndpointConnections(); + + // invoke the operation + string privateEndpointConnectionName = "jlaw-demo1"; + AppContainersPrivateEndpointConnectionData data = new AppContainersPrivateEndpointConnectionData + { + ConnectionState = new AppContainersPrivateLinkServiceConnectionState + { + Status = AppContainersPrivateEndpointServiceConnectionStatus.Approved, + ActionsRequired = "None", + }, + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, privateEndpointConnectionName, data); + AppContainersPrivateEndpointConnectionResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + AppContainersPrivateEndpointConnectionData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_GetAPrivateEndpointConnectionByManagedEnvironment() + { + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/ManagedEnvironmentPrivateEndpointConnections_Get.json + // this example is just showing the usage of "ManagedEnvironmentPrivateEndpointConnections_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ContainerAppManagedEnvironmentResource created on azure + // for more information of creating ContainerAppManagedEnvironmentResource, please refer to the document of ContainerAppManagedEnvironmentResource + string subscriptionId = "8efdecc5-919e-44eb-b179-915dca89ebf9"; + string resourceGroupName = "examplerg"; + string environmentName = "managedEnv"; + ResourceIdentifier containerAppManagedEnvironmentResourceId = ContainerAppManagedEnvironmentResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, environmentName); + ContainerAppManagedEnvironmentResource containerAppManagedEnvironment = client.GetContainerAppManagedEnvironmentResource(containerAppManagedEnvironmentResourceId); + + // get the collection of this AppContainersPrivateEndpointConnectionResource + AppContainersPrivateEndpointConnectionCollection collection = containerAppManagedEnvironment.GetAppContainersPrivateEndpointConnections(); + + // invoke the operation + string privateEndpointConnectionName = "jlaw-demo1"; + AppContainersPrivateEndpointConnectionResource result = await collection.GetAsync(privateEndpointConnectionName); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + AppContainersPrivateEndpointConnectionData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetAll_ListPrivateEndpointConnectionsByManagedEnvironment() + { + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/ManagedEnvironmentPrivateEndpointConnections_List.json + // this example is just showing the usage of "ManagedEnvironmentPrivateEndpointConnections_List" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ContainerAppManagedEnvironmentResource created on azure + // for more information of creating ContainerAppManagedEnvironmentResource, please refer to the document of ContainerAppManagedEnvironmentResource + string subscriptionId = "8efdecc5-919e-44eb-b179-915dca89ebf9"; + string resourceGroupName = "examplerg"; + string environmentName = "managedEnv"; + ResourceIdentifier containerAppManagedEnvironmentResourceId = ContainerAppManagedEnvironmentResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, environmentName); + ContainerAppManagedEnvironmentResource containerAppManagedEnvironment = client.GetContainerAppManagedEnvironmentResource(containerAppManagedEnvironmentResourceId); + + // get the collection of this AppContainersPrivateEndpointConnectionResource + AppContainersPrivateEndpointConnectionCollection collection = containerAppManagedEnvironment.GetAppContainersPrivateEndpointConnections(); + + // invoke the operation and iterate over the result + await foreach (AppContainersPrivateEndpointConnectionResource item in collection.GetAllAsync()) + { + // the variable item is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + AppContainersPrivateEndpointConnectionData resourceData = item.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Exists_GetAPrivateEndpointConnectionByManagedEnvironment() + { + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/ManagedEnvironmentPrivateEndpointConnections_Get.json + // this example is just showing the usage of "ManagedEnvironmentPrivateEndpointConnections_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ContainerAppManagedEnvironmentResource created on azure + // for more information of creating ContainerAppManagedEnvironmentResource, please refer to the document of ContainerAppManagedEnvironmentResource + string subscriptionId = "8efdecc5-919e-44eb-b179-915dca89ebf9"; + string resourceGroupName = "examplerg"; + string environmentName = "managedEnv"; + ResourceIdentifier containerAppManagedEnvironmentResourceId = ContainerAppManagedEnvironmentResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, environmentName); + ContainerAppManagedEnvironmentResource containerAppManagedEnvironment = client.GetContainerAppManagedEnvironmentResource(containerAppManagedEnvironmentResourceId); + + // get the collection of this AppContainersPrivateEndpointConnectionResource + AppContainersPrivateEndpointConnectionCollection collection = containerAppManagedEnvironment.GetAppContainersPrivateEndpointConnections(); + + // invoke the operation + string privateEndpointConnectionName = "jlaw-demo1"; + bool result = await collection.ExistsAsync(privateEndpointConnectionName); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetIfExists_GetAPrivateEndpointConnectionByManagedEnvironment() + { + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/ManagedEnvironmentPrivateEndpointConnections_Get.json + // this example is just showing the usage of "ManagedEnvironmentPrivateEndpointConnections_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ContainerAppManagedEnvironmentResource created on azure + // for more information of creating ContainerAppManagedEnvironmentResource, please refer to the document of ContainerAppManagedEnvironmentResource + string subscriptionId = "8efdecc5-919e-44eb-b179-915dca89ebf9"; + string resourceGroupName = "examplerg"; + string environmentName = "managedEnv"; + ResourceIdentifier containerAppManagedEnvironmentResourceId = ContainerAppManagedEnvironmentResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, environmentName); + ContainerAppManagedEnvironmentResource containerAppManagedEnvironment = client.GetContainerAppManagedEnvironmentResource(containerAppManagedEnvironmentResourceId); + + // get the collection of this AppContainersPrivateEndpointConnectionResource + AppContainersPrivateEndpointConnectionCollection collection = containerAppManagedEnvironment.GetAppContainersPrivateEndpointConnections(); + + // invoke the operation + string privateEndpointConnectionName = "jlaw-demo1"; + NullableResponse response = await collection.GetIfExistsAsync(privateEndpointConnectionName); + AppContainersPrivateEndpointConnectionResource result = response.HasValue ? response.Value : null; + + if (result == null) + { + Console.WriteLine("Succeeded with null as result"); + } + else + { + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + AppContainersPrivateEndpointConnectionData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + } +} diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/tests/Generated/Samples/Sample_AppContainersPrivateEndpointConnectionResource.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/tests/Generated/Samples/Sample_AppContainersPrivateEndpointConnectionResource.cs new file mode 100644 index 000000000000..c6c8c69deb73 --- /dev/null +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/tests/Generated/Samples/Sample_AppContainersPrivateEndpointConnectionResource.cs @@ -0,0 +1,117 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.AppContainers.Models; +using NUnit.Framework; + +namespace Azure.ResourceManager.AppContainers.Samples +{ + public partial class Sample_AppContainersPrivateEndpointConnectionResource + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_GetAPrivateEndpointConnectionByManagedEnvironment() + { + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/ManagedEnvironmentPrivateEndpointConnections_Get.json + // this example is just showing the usage of "ManagedEnvironmentPrivateEndpointConnections_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this AppContainersPrivateEndpointConnectionResource created on azure + // for more information of creating AppContainersPrivateEndpointConnectionResource, please refer to the document of AppContainersPrivateEndpointConnectionResource + string subscriptionId = "8efdecc5-919e-44eb-b179-915dca89ebf9"; + string resourceGroupName = "examplerg"; + string environmentName = "managedEnv"; + string privateEndpointConnectionName = "jlaw-demo1"; + ResourceIdentifier appContainersPrivateEndpointConnectionResourceId = AppContainersPrivateEndpointConnectionResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, environmentName, privateEndpointConnectionName); + AppContainersPrivateEndpointConnectionResource appContainersPrivateEndpointConnection = client.GetAppContainersPrivateEndpointConnectionResource(appContainersPrivateEndpointConnectionResourceId); + + // invoke the operation + AppContainersPrivateEndpointConnectionResource result = await appContainersPrivateEndpointConnection.GetAsync(); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + AppContainersPrivateEndpointConnectionData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Delete_DeleteAPrivateEndpointConnectionByManagedEnvironment() + { + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/ManagedEnvironmentPrivateEndpointConnections_Delete.json + // this example is just showing the usage of "ManagedEnvironmentPrivateEndpointConnections_Delete" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this AppContainersPrivateEndpointConnectionResource created on azure + // for more information of creating AppContainersPrivateEndpointConnectionResource, please refer to the document of AppContainersPrivateEndpointConnectionResource + string subscriptionId = "8efdecc5-919e-44eb-b179-915dca89ebf9"; + string resourceGroupName = "examplerg"; + string environmentName = "managedEnv"; + string privateEndpointConnectionName = "jlaw-demo1"; + ResourceIdentifier appContainersPrivateEndpointConnectionResourceId = AppContainersPrivateEndpointConnectionResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, environmentName, privateEndpointConnectionName); + AppContainersPrivateEndpointConnectionResource appContainersPrivateEndpointConnection = client.GetAppContainersPrivateEndpointConnectionResource(appContainersPrivateEndpointConnectionResourceId); + + // invoke the operation + await appContainersPrivateEndpointConnection.DeleteAsync(WaitUntil.Completed); + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Update_UpdateAPrivateEndpointConnectionByManagedEnvironment() + { + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/ManagedEnvironmentPrivateEndpointConnections_CreateOrUpdate.json + // this example is just showing the usage of "ManagedEnvironmentPrivateEndpointConnections_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this AppContainersPrivateEndpointConnectionResource created on azure + // for more information of creating AppContainersPrivateEndpointConnectionResource, please refer to the document of AppContainersPrivateEndpointConnectionResource + string subscriptionId = "8efdecc5-919e-44eb-b179-915dca89ebf9"; + string resourceGroupName = "examplerg"; + string environmentName = "managedEnv"; + string privateEndpointConnectionName = "jlaw-demo1"; + ResourceIdentifier appContainersPrivateEndpointConnectionResourceId = AppContainersPrivateEndpointConnectionResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, environmentName, privateEndpointConnectionName); + AppContainersPrivateEndpointConnectionResource appContainersPrivateEndpointConnection = client.GetAppContainersPrivateEndpointConnectionResource(appContainersPrivateEndpointConnectionResourceId); + + // invoke the operation + AppContainersPrivateEndpointConnectionData data = new AppContainersPrivateEndpointConnectionData + { + ConnectionState = new AppContainersPrivateLinkServiceConnectionState + { + Status = AppContainersPrivateEndpointServiceConnectionStatus.Approved, + ActionsRequired = "None", + }, + }; + ArmOperation lro = await appContainersPrivateEndpointConnection.UpdateAsync(WaitUntil.Completed, data); + AppContainersPrivateEndpointConnectionResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + AppContainersPrivateEndpointConnectionData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } +} diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/tests/Generated/Samples/Sample_AppResiliencyCollection.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/tests/Generated/Samples/Sample_AppResiliencyCollection.cs new file mode 100644 index 000000000000..b314ca2b8251 --- /dev/null +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/tests/Generated/Samples/Sample_AppResiliencyCollection.cs @@ -0,0 +1,230 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.AppContainers.Models; +using NUnit.Framework; + +namespace Azure.ResourceManager.AppContainers.Samples +{ + public partial class Sample_AppResiliencyCollection + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task CreateOrUpdate_CreateOrUpdateAppResiliency() + { + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/AppResiliency_CreateOrUpdate.json + // this example is just showing the usage of "AppResiliency_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ContainerAppResource created on azure + // for more information of creating ContainerAppResource, please refer to the document of ContainerAppResource + string subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; + string resourceGroupName = "rg"; + string appName = "testcontainerApp0"; + ResourceIdentifier containerAppResourceId = ContainerAppResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, appName); + ContainerAppResource containerApp = client.GetContainerAppResource(containerAppResourceId); + + // get the collection of this AppResiliencyResource + AppResiliencyCollection collection = containerApp.GetAppResiliencies(); + + // invoke the operation + string name = "resiliency-policy-1"; + AppResiliencyData data = new AppResiliencyData + { + TimeoutPolicy = new ContainerAppTimeoutPolicy + { + ResponseTimeoutInSeconds = 15, + ConnectionTimeoutInSeconds = 5, + }, + HttpRetryPolicy = new HttpRetryPolicy + { + MaxRetries = 5, + Headers = {new HeaderMatch +{ +Header = "X-Content-Type", +PrefixMatch = "GOATS", +}}, + HttpStatusCodes = { 502, 503 }, + Errors = { "5xx", "connect-failure", "reset", "retriable-headers", "retriable-status-codes" }, + InitialDelayInMilliseconds = 1000L, + MaxIntervalInMilliseconds = 10000L, + }, + TcpRetryMaxConnectAttempts = 3, + CircuitBreakerPolicy = new CircuitBreakerPolicy + { + ConsecutiveErrors = 5, + IntervalInSeconds = 10, + MaxEjectionPercent = 50, + }, + HttpConnectionPool = new HttpConnectionPool + { + Http1MaxPendingRequests = 1024, + Http2MaxRequests = 1024, + }, + MaxConnections = 100, + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, name, data); + AppResiliencyResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + AppResiliencyData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_GetAppResiliency() + { + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/AppResiliency_Get.json + // this example is just showing the usage of "AppResiliency_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ContainerAppResource created on azure + // for more information of creating ContainerAppResource, please refer to the document of ContainerAppResource + string subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; + string resourceGroupName = "rg"; + string appName = "testcontainerApp0"; + ResourceIdentifier containerAppResourceId = ContainerAppResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, appName); + ContainerAppResource containerApp = client.GetContainerAppResource(containerAppResourceId); + + // get the collection of this AppResiliencyResource + AppResiliencyCollection collection = containerApp.GetAppResiliencies(); + + // invoke the operation + string name = "resiliency-policy-1"; + AppResiliencyResource result = await collection.GetAsync(name); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + AppResiliencyData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetAll_ListAppResiliency() + { + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/AppResiliency_List.json + // this example is just showing the usage of "AppResiliency_List" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ContainerAppResource created on azure + // for more information of creating ContainerAppResource, please refer to the document of ContainerAppResource + string subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; + string resourceGroupName = "rg"; + string appName = "testcontainerApp0"; + ResourceIdentifier containerAppResourceId = ContainerAppResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, appName); + ContainerAppResource containerApp = client.GetContainerAppResource(containerAppResourceId); + + // get the collection of this AppResiliencyResource + AppResiliencyCollection collection = containerApp.GetAppResiliencies(); + + // invoke the operation and iterate over the result + await foreach (AppResiliencyResource item in collection.GetAllAsync()) + { + // the variable item is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + AppResiliencyData resourceData = item.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Exists_GetAppResiliency() + { + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/AppResiliency_Get.json + // this example is just showing the usage of "AppResiliency_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ContainerAppResource created on azure + // for more information of creating ContainerAppResource, please refer to the document of ContainerAppResource + string subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; + string resourceGroupName = "rg"; + string appName = "testcontainerApp0"; + ResourceIdentifier containerAppResourceId = ContainerAppResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, appName); + ContainerAppResource containerApp = client.GetContainerAppResource(containerAppResourceId); + + // get the collection of this AppResiliencyResource + AppResiliencyCollection collection = containerApp.GetAppResiliencies(); + + // invoke the operation + string name = "resiliency-policy-1"; + bool result = await collection.ExistsAsync(name); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetIfExists_GetAppResiliency() + { + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/AppResiliency_Get.json + // this example is just showing the usage of "AppResiliency_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ContainerAppResource created on azure + // for more information of creating ContainerAppResource, please refer to the document of ContainerAppResource + string subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; + string resourceGroupName = "rg"; + string appName = "testcontainerApp0"; + ResourceIdentifier containerAppResourceId = ContainerAppResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, appName); + ContainerAppResource containerApp = client.GetContainerAppResource(containerAppResourceId); + + // get the collection of this AppResiliencyResource + AppResiliencyCollection collection = containerApp.GetAppResiliencies(); + + // invoke the operation + string name = "resiliency-policy-1"; + NullableResponse response = await collection.GetIfExistsAsync(name); + AppResiliencyResource result = response.HasValue ? response.Value : null; + + if (result == null) + { + Console.WriteLine("Succeeded with null as result"); + } + else + { + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + AppResiliencyData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + } +} diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/tests/Generated/Samples/Sample_AppResiliencyResource.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/tests/Generated/Samples/Sample_AppResiliencyResource.cs new file mode 100644 index 000000000000..2000cb6e19fc --- /dev/null +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/tests/Generated/Samples/Sample_AppResiliencyResource.cs @@ -0,0 +1,116 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.AppContainers.Models; +using NUnit.Framework; + +namespace Azure.ResourceManager.AppContainers.Samples +{ + public partial class Sample_AppResiliencyResource + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_GetAppResiliency() + { + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/AppResiliency_Get.json + // this example is just showing the usage of "AppResiliency_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this AppResiliencyResource created on azure + // for more information of creating AppResiliencyResource, please refer to the document of AppResiliencyResource + string subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; + string resourceGroupName = "rg"; + string appName = "testcontainerApp0"; + string name = "resiliency-policy-1"; + ResourceIdentifier appResiliencyResourceId = AppResiliencyResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, appName, name); + AppResiliencyResource appResiliency = client.GetAppResiliencyResource(appResiliencyResourceId); + + // invoke the operation + AppResiliencyResource result = await appResiliency.GetAsync(); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + AppResiliencyData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Delete_DeleteAppResiliency() + { + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/AppResiliency_Delete.json + // this example is just showing the usage of "AppResiliency_Delete" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this AppResiliencyResource created on azure + // for more information of creating AppResiliencyResource, please refer to the document of AppResiliencyResource + string subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; + string resourceGroupName = "rg"; + string appName = "testcontainerApp0"; + string name = "resiliency-policy-1"; + ResourceIdentifier appResiliencyResourceId = AppResiliencyResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, appName, name); + AppResiliencyResource appResiliency = client.GetAppResiliencyResource(appResiliencyResourceId); + + // invoke the operation + await appResiliency.DeleteAsync(WaitUntil.Completed); + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Update_UpdateAppResiliency() + { + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/AppResiliency_Patch.json + // this example is just showing the usage of "AppResiliency_Update" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this AppResiliencyResource created on azure + // for more information of creating AppResiliencyResource, please refer to the document of AppResiliencyResource + string subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; + string resourceGroupName = "rg"; + string appName = "testcontainerApp0"; + string name = "resiliency-policy-1"; + ResourceIdentifier appResiliencyResourceId = AppResiliencyResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, appName, name); + AppResiliencyResource appResiliency = client.GetAppResiliencyResource(appResiliencyResourceId); + + // invoke the operation + AppResiliencyData data = new AppResiliencyData + { + TimeoutPolicy = new ContainerAppTimeoutPolicy + { + ResponseTimeoutInSeconds = 30, + ConnectionTimeoutInSeconds = 40, + }, + }; + AppResiliencyResource result = await appResiliency.UpdateAsync(data); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + AppResiliencyData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } +} diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/tests/Generated/Samples/Sample_BuildResource.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/tests/Generated/Samples/Sample_BuildResource.cs new file mode 100644 index 000000000000..6eb20ca49760 --- /dev/null +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/tests/Generated/Samples/Sample_BuildResource.cs @@ -0,0 +1,202 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.AppContainers.Models; +using NUnit.Framework; + +namespace Azure.ResourceManager.AppContainers.Samples +{ + public partial class Sample_BuildResource + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_BuildsGet0() + { + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/Builds_Get.json + // this example is just showing the usage of "Builds_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this BuildResource created on azure + // for more information of creating BuildResource, please refer to the document of BuildResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "rg"; + string builderName = "testBuilder"; + string buildName = "testBuild"; + ResourceIdentifier buildResourceId = BuildResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, builderName, buildName); + BuildResource buildResource = client.GetBuildResource(buildResourceId); + + // invoke the operation + BuildResource result = await buildResource.GetAsync(); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + BuildResourceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Delete_BuildsDelete0() + { + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/Builds_Delete.json + // this example is just showing the usage of "Builds_Delete" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this BuildResource created on azure + // for more information of creating BuildResource, please refer to the document of BuildResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "rg"; + string builderName = "testBuilder"; + string buildName = "testBuild"; + ResourceIdentifier buildResourceId = BuildResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, builderName, buildName); + BuildResource buildResource = client.GetBuildResource(buildResourceId); + + // invoke the operation + await buildResource.DeleteAsync(WaitUntil.Completed); + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Update_BuildsCreateOrUpdateNoConfig() + { + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/Builds_CreateOrUpdate_NoConfig.json + // this example is just showing the usage of "Builds_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this BuildResource created on azure + // for more information of creating BuildResource, please refer to the document of BuildResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "rg"; + string builderName = "testBuilder"; + string buildName = "testBuild"; + ResourceIdentifier buildResourceId = BuildResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, builderName, buildName); + BuildResource buildResource = client.GetBuildResource(buildResourceId); + + // invoke the operation + BuildResourceData data = new BuildResourceData(); + ArmOperation lro = await buildResource.UpdateAsync(WaitUntil.Completed, data); + BuildResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + BuildResourceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Update_BuildsCreateOrUpdateWithConfig() + { + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/Builds_CreateOrUpdate.json + // this example is just showing the usage of "Builds_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this BuildResource created on azure + // for more information of creating BuildResource, please refer to the document of BuildResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "rg"; + string builderName = "testBuilder"; + string buildName = "testBuild-123456789az"; + ResourceIdentifier buildResourceId = BuildResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, builderName, buildName); + BuildResource buildResource = client.GetBuildResource(buildResourceId); + + // invoke the operation + BuildResourceData data = new BuildResourceData + { + DestinationContainerRegistry = new ContainerRegistryWithCustomImage("test.azurecr.io") + { + Image = "test.azurecr.io/repo:tag", + }, + Configuration = new ContainerAppBuildConfiguration + { + BaseOS = "DebianBullseye", + Platform = "dotnetcore", + PlatformVersion = "7.0", + EnvironmentVariables = { new ContainerAppSimpleEnvironmentVariable("foo1", "bar1"), new ContainerAppSimpleEnvironmentVariable("foo2", "bar2") }, + PreBuildSteps = {new PreBuildStep +{ +Description = "First pre build step.", +Scripts = {"echo 'hello'", "echo 'world'"}, +HttpGet = new HttpGet(new Uri("https://microsoft.com")) +{ +FileName = "output.txt", +Headers = {"foo", "bar"}, +}, +}, new PreBuildStep +{ +Description = "Second pre build step.", +Scripts = {"echo 'hello'", "echo 'again'"}, +HttpGet = new HttpGet(new Uri("https://microsoft.com")) +{ +FileName = "output.txt", +Headers = {"foo"}, +}, +}}, + }, + }; + ArmOperation lro = await buildResource.UpdateAsync(WaitUntil.Completed, data); + BuildResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + BuildResourceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetBuildAuthToken_GetBuildAuthToken() + { + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/Builds_ListAuthToken.json + // this example is just showing the usage of "BuildAuthToken_List" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this BuildResource created on azure + // for more information of creating BuildResource, please refer to the document of BuildResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "rg"; + string builderName = "testBuilder"; + string buildName = "testBuild"; + ResourceIdentifier buildResourceId = BuildResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, builderName, buildName); + BuildResource buildResource = client.GetBuildResource(buildResourceId); + + // invoke the operation + ContainerAppBuildToken result = await buildResource.GetBuildAuthTokenAsync(); + + Console.WriteLine($"Succeeded: {result}"); + } + } +} diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/tests/Generated/Samples/Sample_BuildResourceCollection.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/tests/Generated/Samples/Sample_BuildResourceCollection.cs new file mode 100644 index 000000000000..b67b024744fd --- /dev/null +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/tests/Generated/Samples/Sample_BuildResourceCollection.cs @@ -0,0 +1,265 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.AppContainers.Models; +using NUnit.Framework; + +namespace Azure.ResourceManager.AppContainers.Samples +{ + public partial class Sample_BuildResourceCollection + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task CreateOrUpdate_BuildsCreateOrUpdateNoConfig() + { + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/Builds_CreateOrUpdate_NoConfig.json + // this example is just showing the usage of "Builds_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this BuilderResource created on azure + // for more information of creating BuilderResource, please refer to the document of BuilderResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "rg"; + string builderName = "testBuilder"; + ResourceIdentifier builderResourceId = BuilderResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, builderName); + BuilderResource builderResource = client.GetBuilderResource(builderResourceId); + + // get the collection of this BuildResource + BuildResourceCollection collection = builderResource.GetBuildResources(); + + // invoke the operation + string buildName = "testBuild"; + BuildResourceData data = new BuildResourceData(); + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, buildName, data); + BuildResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + BuildResourceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task CreateOrUpdate_BuildsCreateOrUpdateWithConfig() + { + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/Builds_CreateOrUpdate.json + // this example is just showing the usage of "Builds_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this BuilderResource created on azure + // for more information of creating BuilderResource, please refer to the document of BuilderResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "rg"; + string builderName = "testBuilder"; + ResourceIdentifier builderResourceId = BuilderResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, builderName); + BuilderResource builderResource = client.GetBuilderResource(builderResourceId); + + // get the collection of this BuildResource + BuildResourceCollection collection = builderResource.GetBuildResources(); + + // invoke the operation + string buildName = "testBuild-123456789az"; + BuildResourceData data = new BuildResourceData + { + DestinationContainerRegistry = new ContainerRegistryWithCustomImage("test.azurecr.io") + { + Image = "test.azurecr.io/repo:tag", + }, + Configuration = new ContainerAppBuildConfiguration + { + BaseOS = "DebianBullseye", + Platform = "dotnetcore", + PlatformVersion = "7.0", + EnvironmentVariables = { new ContainerAppSimpleEnvironmentVariable("foo1", "bar1"), new ContainerAppSimpleEnvironmentVariable("foo2", "bar2") }, + PreBuildSteps = {new PreBuildStep +{ +Description = "First pre build step.", +Scripts = {"echo 'hello'", "echo 'world'"}, +HttpGet = new HttpGet(new Uri("https://microsoft.com")) +{ +FileName = "output.txt", +Headers = {"foo", "bar"}, +}, +}, new PreBuildStep +{ +Description = "Second pre build step.", +Scripts = {"echo 'hello'", "echo 'again'"}, +HttpGet = new HttpGet(new Uri("https://microsoft.com")) +{ +FileName = "output.txt", +Headers = {"foo"}, +}, +}}, + }, + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, buildName, data); + BuildResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + BuildResourceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_BuildsGet0() + { + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/Builds_Get.json + // this example is just showing the usage of "Builds_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this BuilderResource created on azure + // for more information of creating BuilderResource, please refer to the document of BuilderResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "rg"; + string builderName = "testBuilder"; + ResourceIdentifier builderResourceId = BuilderResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, builderName); + BuilderResource builderResource = client.GetBuilderResource(builderResourceId); + + // get the collection of this BuildResource + BuildResourceCollection collection = builderResource.GetBuildResources(); + + // invoke the operation + string buildName = "testBuild"; + BuildResource result = await collection.GetAsync(buildName); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + BuildResourceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetAll_BuildsListByBuilderResource0() + { + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/Builds_ListByBuilderResource.json + // this example is just showing the usage of "BuildsByBuilderResource_List" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this BuilderResource created on azure + // for more information of creating BuilderResource, please refer to the document of BuilderResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "rg"; + string builderName = "testBuilder"; + ResourceIdentifier builderResourceId = BuilderResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, builderName); + BuilderResource builderResource = client.GetBuilderResource(builderResourceId); + + // get the collection of this BuildResource + BuildResourceCollection collection = builderResource.GetBuildResources(); + + // invoke the operation and iterate over the result + await foreach (BuildResource item in collection.GetAllAsync()) + { + // the variable item is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + BuildResourceData resourceData = item.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Exists_BuildsGet0() + { + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/Builds_Get.json + // this example is just showing the usage of "Builds_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this BuilderResource created on azure + // for more information of creating BuilderResource, please refer to the document of BuilderResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "rg"; + string builderName = "testBuilder"; + ResourceIdentifier builderResourceId = BuilderResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, builderName); + BuilderResource builderResource = client.GetBuilderResource(builderResourceId); + + // get the collection of this BuildResource + BuildResourceCollection collection = builderResource.GetBuildResources(); + + // invoke the operation + string buildName = "testBuild"; + bool result = await collection.ExistsAsync(buildName); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetIfExists_BuildsGet0() + { + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/Builds_Get.json + // this example is just showing the usage of "Builds_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this BuilderResource created on azure + // for more information of creating BuilderResource, please refer to the document of BuilderResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "rg"; + string builderName = "testBuilder"; + ResourceIdentifier builderResourceId = BuilderResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, builderName); + BuilderResource builderResource = client.GetBuilderResource(builderResourceId); + + // get the collection of this BuildResource + BuildResourceCollection collection = builderResource.GetBuildResources(); + + // invoke the operation + string buildName = "testBuild"; + NullableResponse response = await collection.GetIfExistsAsync(buildName); + BuildResource result = response.HasValue ? response.Value : null; + + if (result == null) + { + Console.WriteLine("Succeeded with null as result"); + } + else + { + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + BuildResourceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + } +} diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/tests/Generated/Samples/Sample_BuilderResource.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/tests/Generated/Samples/Sample_BuilderResource.cs new file mode 100644 index 000000000000..a078e039a4e7 --- /dev/null +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/tests/Generated/Samples/Sample_BuilderResource.cs @@ -0,0 +1,113 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.AppContainers.Models; +using NUnit.Framework; + +namespace Azure.ResourceManager.AppContainers.Samples +{ + public partial class Sample_BuilderResource + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_BuildersGet0() + { + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/Builders_Get.json + // this example is just showing the usage of "Builders_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this BuilderResource created on azure + // for more information of creating BuilderResource, please refer to the document of BuilderResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "rg"; + string builderName = "testBuilder"; + ResourceIdentifier builderResourceId = BuilderResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, builderName); + BuilderResource builderResource = client.GetBuilderResource(builderResourceId); + + // invoke the operation + BuilderResource result = await builderResource.GetAsync(); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + BuilderResourceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Delete_BuildersDelete0() + { + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/Builders_Delete.json + // this example is just showing the usage of "Builders_Delete" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this BuilderResource created on azure + // for more information of creating BuilderResource, please refer to the document of BuilderResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "rg"; + string builderName = "testBuilder"; + ResourceIdentifier builderResourceId = BuilderResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, builderName); + BuilderResource builderResource = client.GetBuilderResource(builderResourceId); + + // invoke the operation + await builderResource.DeleteAsync(WaitUntil.Completed); + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Update_BuildersUpdate0() + { + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/Builders_Update.json + // this example is just showing the usage of "Builders_Update" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this BuilderResource created on azure + // for more information of creating BuilderResource, please refer to the document of BuilderResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "rg"; + string builderName = "testBuilder"; + ResourceIdentifier builderResourceId = BuilderResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, builderName); + BuilderResource builderResource = client.GetBuilderResource(builderResourceId); + + // invoke the operation + BuilderResourcePatch patch = new BuilderResourcePatch + { + Tags = +{ +["mytag1"] = "myvalue1" +}, + }; + ArmOperation lro = await builderResource.UpdateAsync(WaitUntil.Completed, patch); + BuilderResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + BuilderResourceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } +} diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/tests/Generated/Samples/Sample_BuilderResourceCollection.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/tests/Generated/Samples/Sample_BuilderResourceCollection.cs new file mode 100644 index 000000000000..241fc2096933 --- /dev/null +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/tests/Generated/Samples/Sample_BuilderResourceCollection.cs @@ -0,0 +1,209 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.AppContainers.Models; +using Azure.ResourceManager.Models; +using Azure.ResourceManager.Resources; +using NUnit.Framework; + +namespace Azure.ResourceManager.AppContainers.Samples +{ + public partial class Sample_BuilderResourceCollection + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task CreateOrUpdate_BuildersCreateOrUpdate0() + { + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/Builders_CreateOrUpdate.json + // this example is just showing the usage of "Builders_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "rg"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this BuilderResource + BuilderResourceCollection collection = resourceGroupResource.GetBuilderResources(); + + // invoke the operation + string builderName = "testBuilder"; + BuilderResourceData data = new BuilderResourceData(new AzureLocation("eastus")) + { + Identity = new ManagedServiceIdentity("SystemAssigned,UserAssigned") + { + UserAssignedIdentities = +{ +[new ResourceIdentifier("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity1")] = new UserAssignedIdentity() +}, + }, + EnvironmentId = new ResourceIdentifier("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg/providers/Microsoft.App/managedEnvironments/testEnv"), + ContainerRegistries = { new ContainerAppContainerRegistry("test.azurecr.io", new ResourceIdentifier("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity1")), new ContainerAppContainerRegistry("test2.azurecr.io", new ResourceIdentifier("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity1")) }, + Tags = +{ +["company"] = "Microsoft" +}, + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, builderName, data); + BuilderResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + BuilderResourceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_BuildersGet0() + { + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/Builders_Get.json + // this example is just showing the usage of "Builders_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "rg"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this BuilderResource + BuilderResourceCollection collection = resourceGroupResource.GetBuilderResources(); + + // invoke the operation + string builderName = "testBuilder"; + BuilderResource result = await collection.GetAsync(builderName); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + BuilderResourceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetAll_BuildersListByResourceGroup0() + { + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/Builders_ListByResourceGroup.json + // this example is just showing the usage of "Builders_ListByResourceGroup" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "rg"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this BuilderResource + BuilderResourceCollection collection = resourceGroupResource.GetBuilderResources(); + + // invoke the operation and iterate over the result + await foreach (BuilderResource item in collection.GetAllAsync()) + { + // the variable item is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + BuilderResourceData resourceData = item.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Exists_BuildersGet0() + { + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/Builders_Get.json + // this example is just showing the usage of "Builders_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "rg"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this BuilderResource + BuilderResourceCollection collection = resourceGroupResource.GetBuilderResources(); + + // invoke the operation + string builderName = "testBuilder"; + bool result = await collection.ExistsAsync(builderName); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetIfExists_BuildersGet0() + { + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/Builders_Get.json + // this example is just showing the usage of "Builders_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "rg"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this BuilderResource + BuilderResourceCollection collection = resourceGroupResource.GetBuilderResources(); + + // invoke the operation + string builderName = "testBuilder"; + NullableResponse response = await collection.GetIfExistsAsync(builderName); + BuilderResource result = response.HasValue ? response.Value : null; + + if (result == null) + { + Console.WriteLine("Succeeded with null as result"); + } + else + { + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + BuilderResourceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + } +} diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/tests/Generated/Samples/Sample_ConnectedEnvironmentDaprComponentCollection.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/tests/Generated/Samples/Sample_ConnectedEnvironmentDaprComponentCollection.cs new file mode 100644 index 000000000000..fc69459615d7 --- /dev/null +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/tests/Generated/Samples/Sample_ConnectedEnvironmentDaprComponentCollection.cs @@ -0,0 +1,236 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.AppContainers.Models; +using NUnit.Framework; + +namespace Azure.ResourceManager.AppContainers.Samples +{ + public partial class Sample_ConnectedEnvironmentDaprComponentCollection + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task CreateOrUpdate_CreateOrUpdateDaprComponent() + { + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/ConnectedEnvironmentsDaprComponents_CreateOrUpdate.json + // this example is just showing the usage of "ConnectedEnvironmentsDaprComponents_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ContainerAppConnectedEnvironmentResource created on azure + // for more information of creating ContainerAppConnectedEnvironmentResource, please refer to the document of ContainerAppConnectedEnvironmentResource + string subscriptionId = "8efdecc5-919e-44eb-b179-915dca89ebf9"; + string resourceGroupName = "examplerg"; + string connectedEnvironmentName = "myenvironment"; + ResourceIdentifier containerAppConnectedEnvironmentResourceId = ContainerAppConnectedEnvironmentResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, connectedEnvironmentName); + ContainerAppConnectedEnvironmentResource containerAppConnectedEnvironment = client.GetContainerAppConnectedEnvironmentResource(containerAppConnectedEnvironmentResourceId); + + // get the collection of this ConnectedEnvironmentDaprComponentResource + ConnectedEnvironmentDaprComponentCollection collection = containerAppConnectedEnvironment.GetConnectedEnvironmentDaprComponents(); + + // invoke the operation + string componentName = "reddog"; + ConnectedEnvironmentDaprComponentData data = new ConnectedEnvironmentDaprComponentData + { + ComponentType = "state.azure.cosmosdb", + Version = "v1", + IgnoreErrors = false, + InitTimeout = "50s", + Secrets = {new ContainerAppWritableSecret +{ +Name = "masterkey", +Value = "keyvalue", +}}, + Metadata = {new ContainerAppDaprMetadata +{ +Name = "url", +Value = "", +}, new ContainerAppDaprMetadata +{ +Name = "database", +Value = "itemsDB", +}, new ContainerAppDaprMetadata +{ +Name = "collection", +Value = "items", +}, new ContainerAppDaprMetadata +{ +Name = "masterkey", +SecretRef = "masterkey", +}}, + Scopes = { "container-app-1", "container-app-2" }, + ServiceComponentBind = {new DaprComponentServiceBinding +{ +Name = "statestore", +ServiceId = "/subscriptions/9f7371f1-b593-4c3c-84e2-9167806ad358/resourceGroups/ca-syn2-group/providers/Microsoft.App/containerapps/cappredis", +Metadata = new DaprServiceBindMetadata +{ +Name = "daprcomponentBind", +Value = "redis-bind", +}, +}}, + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, componentName, data); + ConnectedEnvironmentDaprComponentResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + ConnectedEnvironmentDaprComponentData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_GetDaprComponent() + { + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/ConnectedEnvironmentsDaprComponents_Get.json + // this example is just showing the usage of "ConnectedEnvironmentsDaprComponents_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ContainerAppConnectedEnvironmentResource created on azure + // for more information of creating ContainerAppConnectedEnvironmentResource, please refer to the document of ContainerAppConnectedEnvironmentResource + string subscriptionId = "8efdecc5-919e-44eb-b179-915dca89ebf9"; + string resourceGroupName = "examplerg"; + string connectedEnvironmentName = "myenvironment"; + ResourceIdentifier containerAppConnectedEnvironmentResourceId = ContainerAppConnectedEnvironmentResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, connectedEnvironmentName); + ContainerAppConnectedEnvironmentResource containerAppConnectedEnvironment = client.GetContainerAppConnectedEnvironmentResource(containerAppConnectedEnvironmentResourceId); + + // get the collection of this ConnectedEnvironmentDaprComponentResource + ConnectedEnvironmentDaprComponentCollection collection = containerAppConnectedEnvironment.GetConnectedEnvironmentDaprComponents(); + + // invoke the operation + string componentName = "reddog"; + ConnectedEnvironmentDaprComponentResource result = await collection.GetAsync(componentName); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + ConnectedEnvironmentDaprComponentData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetAll_ListDaprComponents() + { + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/ConnectedEnvironmentsDaprComponents_List.json + // this example is just showing the usage of "ConnectedEnvironmentsDaprComponents_List" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ContainerAppConnectedEnvironmentResource created on azure + // for more information of creating ContainerAppConnectedEnvironmentResource, please refer to the document of ContainerAppConnectedEnvironmentResource + string subscriptionId = "8efdecc5-919e-44eb-b179-915dca89ebf9"; + string resourceGroupName = "examplerg"; + string connectedEnvironmentName = "myenvironment"; + ResourceIdentifier containerAppConnectedEnvironmentResourceId = ContainerAppConnectedEnvironmentResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, connectedEnvironmentName); + ContainerAppConnectedEnvironmentResource containerAppConnectedEnvironment = client.GetContainerAppConnectedEnvironmentResource(containerAppConnectedEnvironmentResourceId); + + // get the collection of this ConnectedEnvironmentDaprComponentResource + ConnectedEnvironmentDaprComponentCollection collection = containerAppConnectedEnvironment.GetConnectedEnvironmentDaprComponents(); + + // invoke the operation and iterate over the result + await foreach (ConnectedEnvironmentDaprComponentResource item in collection.GetAllAsync()) + { + // the variable item is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + ConnectedEnvironmentDaprComponentData resourceData = item.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Exists_GetDaprComponent() + { + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/ConnectedEnvironmentsDaprComponents_Get.json + // this example is just showing the usage of "ConnectedEnvironmentsDaprComponents_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ContainerAppConnectedEnvironmentResource created on azure + // for more information of creating ContainerAppConnectedEnvironmentResource, please refer to the document of ContainerAppConnectedEnvironmentResource + string subscriptionId = "8efdecc5-919e-44eb-b179-915dca89ebf9"; + string resourceGroupName = "examplerg"; + string connectedEnvironmentName = "myenvironment"; + ResourceIdentifier containerAppConnectedEnvironmentResourceId = ContainerAppConnectedEnvironmentResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, connectedEnvironmentName); + ContainerAppConnectedEnvironmentResource containerAppConnectedEnvironment = client.GetContainerAppConnectedEnvironmentResource(containerAppConnectedEnvironmentResourceId); + + // get the collection of this ConnectedEnvironmentDaprComponentResource + ConnectedEnvironmentDaprComponentCollection collection = containerAppConnectedEnvironment.GetConnectedEnvironmentDaprComponents(); + + // invoke the operation + string componentName = "reddog"; + bool result = await collection.ExistsAsync(componentName); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetIfExists_GetDaprComponent() + { + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/ConnectedEnvironmentsDaprComponents_Get.json + // this example is just showing the usage of "ConnectedEnvironmentsDaprComponents_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ContainerAppConnectedEnvironmentResource created on azure + // for more information of creating ContainerAppConnectedEnvironmentResource, please refer to the document of ContainerAppConnectedEnvironmentResource + string subscriptionId = "8efdecc5-919e-44eb-b179-915dca89ebf9"; + string resourceGroupName = "examplerg"; + string connectedEnvironmentName = "myenvironment"; + ResourceIdentifier containerAppConnectedEnvironmentResourceId = ContainerAppConnectedEnvironmentResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, connectedEnvironmentName); + ContainerAppConnectedEnvironmentResource containerAppConnectedEnvironment = client.GetContainerAppConnectedEnvironmentResource(containerAppConnectedEnvironmentResourceId); + + // get the collection of this ConnectedEnvironmentDaprComponentResource + ConnectedEnvironmentDaprComponentCollection collection = containerAppConnectedEnvironment.GetConnectedEnvironmentDaprComponents(); + + // invoke the operation + string componentName = "reddog"; + NullableResponse response = await collection.GetIfExistsAsync(componentName); + ConnectedEnvironmentDaprComponentResource result = response.HasValue ? response.Value : null; + + if (result == null) + { + Console.WriteLine("Succeeded with null as result"); + } + else + { + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + ConnectedEnvironmentDaprComponentData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + } +} diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/tests/Generated/Samples/Sample_ConnectedEnvironmentDaprComponentResource.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/tests/Generated/Samples/Sample_ConnectedEnvironmentDaprComponentResource.cs new file mode 100644 index 000000000000..bdd857997976 --- /dev/null +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/tests/Generated/Samples/Sample_ConnectedEnvironmentDaprComponentResource.cs @@ -0,0 +1,179 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.AppContainers.Models; +using NUnit.Framework; + +namespace Azure.ResourceManager.AppContainers.Samples +{ + public partial class Sample_ConnectedEnvironmentDaprComponentResource + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_GetDaprComponent() + { + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/ConnectedEnvironmentsDaprComponents_Get.json + // this example is just showing the usage of "ConnectedEnvironmentsDaprComponents_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ConnectedEnvironmentDaprComponentResource created on azure + // for more information of creating ConnectedEnvironmentDaprComponentResource, please refer to the document of ConnectedEnvironmentDaprComponentResource + string subscriptionId = "8efdecc5-919e-44eb-b179-915dca89ebf9"; + string resourceGroupName = "examplerg"; + string connectedEnvironmentName = "myenvironment"; + string componentName = "reddog"; + ResourceIdentifier connectedEnvironmentDaprComponentResourceId = ConnectedEnvironmentDaprComponentResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, connectedEnvironmentName, componentName); + ConnectedEnvironmentDaprComponentResource connectedEnvironmentDaprComponent = client.GetConnectedEnvironmentDaprComponentResource(connectedEnvironmentDaprComponentResourceId); + + // invoke the operation + ConnectedEnvironmentDaprComponentResource result = await connectedEnvironmentDaprComponent.GetAsync(); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + ConnectedEnvironmentDaprComponentData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Delete_DeleteDaprComponent() + { + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/ConnectedEnvironmentsDaprComponents_Delete.json + // this example is just showing the usage of "ConnectedEnvironmentsDaprComponents_Delete" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ConnectedEnvironmentDaprComponentResource created on azure + // for more information of creating ConnectedEnvironmentDaprComponentResource, please refer to the document of ConnectedEnvironmentDaprComponentResource + string subscriptionId = "8efdecc5-919e-44eb-b179-915dca89ebf9"; + string resourceGroupName = "examplerg"; + string connectedEnvironmentName = "myenvironment"; + string componentName = "reddog"; + ResourceIdentifier connectedEnvironmentDaprComponentResourceId = ConnectedEnvironmentDaprComponentResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, connectedEnvironmentName, componentName); + ConnectedEnvironmentDaprComponentResource connectedEnvironmentDaprComponent = client.GetConnectedEnvironmentDaprComponentResource(connectedEnvironmentDaprComponentResourceId); + + // invoke the operation + await connectedEnvironmentDaprComponent.DeleteAsync(WaitUntil.Completed); + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Update_CreateOrUpdateDaprComponent() + { + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/ConnectedEnvironmentsDaprComponents_CreateOrUpdate.json + // this example is just showing the usage of "ConnectedEnvironmentsDaprComponents_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ConnectedEnvironmentDaprComponentResource created on azure + // for more information of creating ConnectedEnvironmentDaprComponentResource, please refer to the document of ConnectedEnvironmentDaprComponentResource + string subscriptionId = "8efdecc5-919e-44eb-b179-915dca89ebf9"; + string resourceGroupName = "examplerg"; + string connectedEnvironmentName = "myenvironment"; + string componentName = "reddog"; + ResourceIdentifier connectedEnvironmentDaprComponentResourceId = ConnectedEnvironmentDaprComponentResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, connectedEnvironmentName, componentName); + ConnectedEnvironmentDaprComponentResource connectedEnvironmentDaprComponent = client.GetConnectedEnvironmentDaprComponentResource(connectedEnvironmentDaprComponentResourceId); + + // invoke the operation + ConnectedEnvironmentDaprComponentData data = new ConnectedEnvironmentDaprComponentData + { + ComponentType = "state.azure.cosmosdb", + Version = "v1", + IgnoreErrors = false, + InitTimeout = "50s", + Secrets = {new ContainerAppWritableSecret +{ +Name = "masterkey", +Value = "keyvalue", +}}, + Metadata = {new ContainerAppDaprMetadata +{ +Name = "url", +Value = "", +}, new ContainerAppDaprMetadata +{ +Name = "database", +Value = "itemsDB", +}, new ContainerAppDaprMetadata +{ +Name = "collection", +Value = "items", +}, new ContainerAppDaprMetadata +{ +Name = "masterkey", +SecretRef = "masterkey", +}}, + Scopes = { "container-app-1", "container-app-2" }, + ServiceComponentBind = {new DaprComponentServiceBinding +{ +Name = "statestore", +ServiceId = "/subscriptions/9f7371f1-b593-4c3c-84e2-9167806ad358/resourceGroups/ca-syn2-group/providers/Microsoft.App/containerapps/cappredis", +Metadata = new DaprServiceBindMetadata +{ +Name = "daprcomponentBind", +Value = "redis-bind", +}, +}}, + }; + ArmOperation lro = await connectedEnvironmentDaprComponent.UpdateAsync(WaitUntil.Completed, data); + ConnectedEnvironmentDaprComponentResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + ConnectedEnvironmentDaprComponentData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetSecrets_ListContainerAppsSecrets() + { + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/ConnectedEnvironmentsDaprComponents_ListSecrets.json + // this example is just showing the usage of "ConnectedEnvironmentsDaprComponents_ListSecrets" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ConnectedEnvironmentDaprComponentResource created on azure + // for more information of creating ConnectedEnvironmentDaprComponentResource, please refer to the document of ConnectedEnvironmentDaprComponentResource + string subscriptionId = "8efdecc5-919e-44eb-b179-915dca89ebf9"; + string resourceGroupName = "examplerg"; + string connectedEnvironmentName = "myenvironment"; + string componentName = "reddog"; + ResourceIdentifier connectedEnvironmentDaprComponentResourceId = ConnectedEnvironmentDaprComponentResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, connectedEnvironmentName, componentName); + ConnectedEnvironmentDaprComponentResource connectedEnvironmentDaprComponent = client.GetConnectedEnvironmentDaprComponentResource(connectedEnvironmentDaprComponentResourceId); + + // invoke the operation and iterate over the result + await foreach (ContainerAppDaprSecret item in connectedEnvironmentDaprComponent.GetSecretsAsync()) + { + Console.WriteLine($"Succeeded: {item}"); + } + + Console.WriteLine("Succeeded"); + } + } +} diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/tests/Generated/Samples/Sample_ContainerAppAuthConfigCollection.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/tests/Generated/Samples/Sample_ContainerAppAuthConfigCollection.cs index 781ef69fcc5a..108505063691 100644 --- a/sdk/containerapps/Azure.ResourceManager.AppContainers/tests/Generated/Samples/Sample_ContainerAppAuthConfigCollection.cs +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/tests/Generated/Samples/Sample_ContainerAppAuthConfigCollection.cs @@ -20,7 +20,7 @@ public partial class Sample_ContainerAppAuthConfigCollection [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_CreateOrUpdateContainerAppAuthConfig() { - // Generated from example definition: specification/app/resource-manager/Microsoft.App/stable/2025-01-01/examples/AuthConfigs_CreateOrUpdate.json + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/AuthConfigs_CreateOrUpdate.json // this example is just showing the usage of "ContainerAppsAuthConfigs_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -78,11 +78,157 @@ public async Task CreateOrUpdate_CreateOrUpdateContainerAppAuthConfig() Console.WriteLine($"Succeeded on id: {resourceData.Id}"); } + [Test] + [Ignore("Only validating compilation of examples")] + public async Task CreateOrUpdate_CreateOrUpdateContainerAppAuthConfigWithMsiClientIDBlobStorageTokenStore() + { + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/AuthConfigs_BlobStorageTokenStore_ClientId_CreateOrUpdate.json + // this example is just showing the usage of "ContainerAppsAuthConfigs_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ContainerAppResource created on azure + // for more information of creating ContainerAppResource, please refer to the document of ContainerAppResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "rg1"; + string containerAppName = "myapp"; + ResourceIdentifier containerAppResourceId = ContainerAppResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, containerAppName); + ContainerAppResource containerApp = client.GetContainerAppResource(containerAppResourceId); + + // get the collection of this ContainerAppAuthConfigResource + ContainerAppAuthConfigCollection collection = containerApp.GetContainerAppAuthConfigs(); + + // invoke the operation + string authConfigName = "current"; + ContainerAppAuthConfigData data = new ContainerAppAuthConfigData + { + Platform = new ContainerAppAuthPlatform + { + IsEnabled = true, + }, + GlobalValidation = new ContainerAppGlobalValidation + { + UnauthenticatedClientAction = ContainerAppUnauthenticatedClientActionV2.AllowAnonymous, + }, + IdentityProviders = new ContainerAppIdentityProvidersConfiguration + { + Facebook = new ContainerAppFacebookConfiguration + { + Registration = new ContainerAppRegistration + { + AppId = "123", + AppSecretSettingName = "facebook-secret", + }, + }, + }, + Login = new ContainerAppLogin + { + TokenStore = new ContainerAppTokenStore + { + AzureBlobStorage = new ContainerAppBlobStorageTokenStore + { + BlobContainerUri = new Uri("https://test.blob.core.windows.net/container1"), + ClientId = "00000000-0000-0000-0000-000000000000", + }, + }, + }, + EncryptionSettings = new EncryptionSettings + { + ContainerAppAuthEncryptionSecretName = "testEncryptionSecretName", + ContainerAppAuthSigningSecretName = "testSigningSecretName", + }, + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, authConfigName, data); + ContainerAppAuthConfigResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + ContainerAppAuthConfigData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task CreateOrUpdate_CreateOrUpdateContainerAppAuthConfigWithMsiManagedIdentityResourceIdBlobStorageTokenStore() + { + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/AuthConfigs_BlobStorageTokenStore_CreateOrUpdate.json + // this example is just showing the usage of "ContainerAppsAuthConfigs_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ContainerAppResource created on azure + // for more information of creating ContainerAppResource, please refer to the document of ContainerAppResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "rg1"; + string containerAppName = "myapp"; + ResourceIdentifier containerAppResourceId = ContainerAppResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, containerAppName); + ContainerAppResource containerApp = client.GetContainerAppResource(containerAppResourceId); + + // get the collection of this ContainerAppAuthConfigResource + ContainerAppAuthConfigCollection collection = containerApp.GetContainerAppAuthConfigs(); + + // invoke the operation + string authConfigName = "current"; + ContainerAppAuthConfigData data = new ContainerAppAuthConfigData + { + Platform = new ContainerAppAuthPlatform + { + IsEnabled = true, + }, + GlobalValidation = new ContainerAppGlobalValidation + { + UnauthenticatedClientAction = ContainerAppUnauthenticatedClientActionV2.AllowAnonymous, + }, + IdentityProviders = new ContainerAppIdentityProvidersConfiguration + { + Facebook = new ContainerAppFacebookConfiguration + { + Registration = new ContainerAppRegistration + { + AppId = "123", + AppSecretSettingName = "facebook-secret", + }, + }, + }, + Login = new ContainerAppLogin + { + TokenStore = new ContainerAppTokenStore + { + AzureBlobStorage = new ContainerAppBlobStorageTokenStore + { + BlobContainerUri = new Uri("https://test.blob.core.windows.net/container1"), + ManagedIdentityResourceId = "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity1", + }, + }, + }, + EncryptionSettings = new EncryptionSettings + { + ContainerAppAuthEncryptionSecretName = "testEncryptionSecretName", + ContainerAppAuthSigningSecretName = "testSigningSecretName", + }, + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, authConfigName, data); + ContainerAppAuthConfigResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + ContainerAppAuthConfigData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + [Test] [Ignore("Only validating compilation of examples")] public async Task Get_GetContainerAppSAuthConfig() { - // Generated from example definition: specification/app/resource-manager/Microsoft.App/stable/2025-01-01/examples/AuthConfigs_Get.json + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/AuthConfigs_Get.json // this example is just showing the usage of "ContainerAppsAuthConfigs_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -116,7 +262,7 @@ public async Task Get_GetContainerAppSAuthConfig() [Ignore("Only validating compilation of examples")] public async Task GetAll_ListAuthConfigsByContainerApps() { - // Generated from example definition: specification/app/resource-manager/Microsoft.App/stable/2025-01-01/examples/AuthConfigs_ListByContainer.json + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/AuthConfigs_ListByContainer.json // this example is just showing the usage of "ContainerAppsAuthConfigs_ListByContainerApp" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -152,7 +298,7 @@ public async Task GetAll_ListAuthConfigsByContainerApps() [Ignore("Only validating compilation of examples")] public async Task Exists_GetContainerAppSAuthConfig() { - // Generated from example definition: specification/app/resource-manager/Microsoft.App/stable/2025-01-01/examples/AuthConfigs_Get.json + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/AuthConfigs_Get.json // this example is just showing the usage of "ContainerAppsAuthConfigs_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -182,7 +328,7 @@ public async Task Exists_GetContainerAppSAuthConfig() [Ignore("Only validating compilation of examples")] public async Task GetIfExists_GetContainerAppSAuthConfig() { - // Generated from example definition: specification/app/resource-manager/Microsoft.App/stable/2025-01-01/examples/AuthConfigs_Get.json + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/AuthConfigs_Get.json // this example is just showing the usage of "ContainerAppsAuthConfigs_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/tests/Generated/Samples/Sample_ContainerAppAuthConfigResource.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/tests/Generated/Samples/Sample_ContainerAppAuthConfigResource.cs index 99644eaf1bd9..019e62e2ec86 100644 --- a/sdk/containerapps/Azure.ResourceManager.AppContainers/tests/Generated/Samples/Sample_ContainerAppAuthConfigResource.cs +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/tests/Generated/Samples/Sample_ContainerAppAuthConfigResource.cs @@ -20,7 +20,7 @@ public partial class Sample_ContainerAppAuthConfigResource [Ignore("Only validating compilation of examples")] public async Task Get_GetContainerAppSAuthConfig() { - // Generated from example definition: specification/app/resource-manager/Microsoft.App/stable/2025-01-01/examples/AuthConfigs_Get.json + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/AuthConfigs_Get.json // this example is just showing the usage of "ContainerAppsAuthConfigs_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -51,7 +51,7 @@ public async Task Get_GetContainerAppSAuthConfig() [Ignore("Only validating compilation of examples")] public async Task Delete_DeleteContainerAppAuthConfig() { - // Generated from example definition: specification/app/resource-manager/Microsoft.App/stable/2025-01-01/examples/AuthConfigs_Delete.json + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/AuthConfigs_Delete.json // this example is just showing the usage of "ContainerAppsAuthConfigs_Delete" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -78,7 +78,7 @@ public async Task Delete_DeleteContainerAppAuthConfig() [Ignore("Only validating compilation of examples")] public async Task Update_CreateOrUpdateContainerAppAuthConfig() { - // Generated from example definition: specification/app/resource-manager/Microsoft.App/stable/2025-01-01/examples/AuthConfigs_CreateOrUpdate.json + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/AuthConfigs_CreateOrUpdate.json // this example is just showing the usage of "ContainerAppsAuthConfigs_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -132,5 +132,145 @@ public async Task Update_CreateOrUpdateContainerAppAuthConfig() // for demo we just print out the id Console.WriteLine($"Succeeded on id: {resourceData.Id}"); } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Update_CreateOrUpdateContainerAppAuthConfigWithMsiClientIDBlobStorageTokenStore() + { + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/AuthConfigs_BlobStorageTokenStore_ClientId_CreateOrUpdate.json + // this example is just showing the usage of "ContainerAppsAuthConfigs_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ContainerAppAuthConfigResource created on azure + // for more information of creating ContainerAppAuthConfigResource, please refer to the document of ContainerAppAuthConfigResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "rg1"; + string containerAppName = "myapp"; + string authConfigName = "current"; + ResourceIdentifier containerAppAuthConfigResourceId = ContainerAppAuthConfigResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, containerAppName, authConfigName); + ContainerAppAuthConfigResource containerAppAuthConfig = client.GetContainerAppAuthConfigResource(containerAppAuthConfigResourceId); + + // invoke the operation + ContainerAppAuthConfigData data = new ContainerAppAuthConfigData + { + Platform = new ContainerAppAuthPlatform + { + IsEnabled = true, + }, + GlobalValidation = new ContainerAppGlobalValidation + { + UnauthenticatedClientAction = ContainerAppUnauthenticatedClientActionV2.AllowAnonymous, + }, + IdentityProviders = new ContainerAppIdentityProvidersConfiguration + { + Facebook = new ContainerAppFacebookConfiguration + { + Registration = new ContainerAppRegistration + { + AppId = "123", + AppSecretSettingName = "facebook-secret", + }, + }, + }, + Login = new ContainerAppLogin + { + TokenStore = new ContainerAppTokenStore + { + AzureBlobStorage = new ContainerAppBlobStorageTokenStore + { + BlobContainerUri = new Uri("https://test.blob.core.windows.net/container1"), + ClientId = "00000000-0000-0000-0000-000000000000", + }, + }, + }, + EncryptionSettings = new EncryptionSettings + { + ContainerAppAuthEncryptionSecretName = "testEncryptionSecretName", + ContainerAppAuthSigningSecretName = "testSigningSecretName", + }, + }; + ArmOperation lro = await containerAppAuthConfig.UpdateAsync(WaitUntil.Completed, data); + ContainerAppAuthConfigResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + ContainerAppAuthConfigData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Update_CreateOrUpdateContainerAppAuthConfigWithMsiManagedIdentityResourceIdBlobStorageTokenStore() + { + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/AuthConfigs_BlobStorageTokenStore_CreateOrUpdate.json + // this example is just showing the usage of "ContainerAppsAuthConfigs_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ContainerAppAuthConfigResource created on azure + // for more information of creating ContainerAppAuthConfigResource, please refer to the document of ContainerAppAuthConfigResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "rg1"; + string containerAppName = "myapp"; + string authConfigName = "current"; + ResourceIdentifier containerAppAuthConfigResourceId = ContainerAppAuthConfigResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, containerAppName, authConfigName); + ContainerAppAuthConfigResource containerAppAuthConfig = client.GetContainerAppAuthConfigResource(containerAppAuthConfigResourceId); + + // invoke the operation + ContainerAppAuthConfigData data = new ContainerAppAuthConfigData + { + Platform = new ContainerAppAuthPlatform + { + IsEnabled = true, + }, + GlobalValidation = new ContainerAppGlobalValidation + { + UnauthenticatedClientAction = ContainerAppUnauthenticatedClientActionV2.AllowAnonymous, + }, + IdentityProviders = new ContainerAppIdentityProvidersConfiguration + { + Facebook = new ContainerAppFacebookConfiguration + { + Registration = new ContainerAppRegistration + { + AppId = "123", + AppSecretSettingName = "facebook-secret", + }, + }, + }, + Login = new ContainerAppLogin + { + TokenStore = new ContainerAppTokenStore + { + AzureBlobStorage = new ContainerAppBlobStorageTokenStore + { + BlobContainerUri = new Uri("https://test.blob.core.windows.net/container1"), + ManagedIdentityResourceId = "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity1", + }, + }, + }, + EncryptionSettings = new EncryptionSettings + { + ContainerAppAuthEncryptionSecretName = "testEncryptionSecretName", + ContainerAppAuthSigningSecretName = "testSigningSecretName", + }, + }; + ArmOperation lro = await containerAppAuthConfig.UpdateAsync(WaitUntil.Completed, data); + ContainerAppAuthConfigResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + ContainerAppAuthConfigData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } } } diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/tests/Generated/Samples/Sample_ContainerAppCollection.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/tests/Generated/Samples/Sample_ContainerAppCollection.cs index 38f5fc8980b5..2e1a965e623e 100644 --- a/sdk/containerapps/Azure.ResourceManager.AppContainers/tests/Generated/Samples/Sample_ContainerAppCollection.cs +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/tests/Generated/Samples/Sample_ContainerAppCollection.cs @@ -18,11 +18,243 @@ namespace Azure.ResourceManager.AppContainers.Samples { public partial class Sample_ContainerAppCollection { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task CreateOrUpdate_CreateOrUpdateAppKind() + { + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/ContainerApps_Kind_CreateOrUpdate.json + // this example is just showing the usage of "ContainerApps_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "rg"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this ContainerAppResource + ContainerAppCollection collection = resourceGroupResource.GetContainerApps(); + + // invoke the operation + string containerAppName = "testcontainerAppKind"; + ContainerAppData data = new ContainerAppData(new AzureLocation("East Us")) + { + ManagedBy = "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg/providers/Microsoft.Web/sites/testcontainerAppKind", + Kind = AppContainersKind.Workflowapp, + ManagedEnvironmentId = new ResourceIdentifier("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg/providers/Microsoft.App/managedEnvironments/testmanagedenv3"), + Configuration = new ContainerAppConfiguration + { + ActiveRevisionsMode = ContainerAppActiveRevisionsMode.Single, + Ingress = new ContainerAppIngressConfiguration + { + External = true, + TargetPort = 80, + AllowInsecure = true, + }, + }, + Template = new ContainerAppTemplate + { + Containers = {new ContainerAppContainer +{ +Image = "default/logicapps-base:latest", +Name = "logicapps-container", +Resources = new AppContainerResources +{ +Cpu = 1, +Memory = "2.0Gi", +}, +}}, + Scale = new ContainerAppScale + { + MinReplicas = 1, + MaxReplicas = 30, + CooldownPeriod = 350, + PollingInterval = 35, + }, + }, + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, containerAppName, data); + ContainerAppResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + ContainerAppData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task CreateOrUpdate_CreateOrUpdateAppOnAConnectedEnvironment() + { + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/ContainerApps_CreateOrUpdate_ConnectedEnvironment.json + // this example is just showing the usage of "ContainerApps_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; + string resourceGroupName = "rg"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this ContainerAppResource + ContainerAppCollection collection = resourceGroupResource.GetContainerApps(); + + // invoke the operation + string containerAppName = "testcontainerApp0"; + ContainerAppData data = new ContainerAppData(new AzureLocation("East US")) + { + ExtendedLocation = new ContainerAppExtendedLocation + { + Name = "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.ExtendedLocation/customLocations/testcustomlocation", + ExtendedLocationType = ContainerAppExtendedLocationType.CustomLocation, + }, + EnvironmentId = new ResourceIdentifier("/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/connectedEnvironments/demokube"), + Configuration = new ContainerAppConfiguration + { + Ingress = new ContainerAppIngressConfiguration + { + External = true, + TargetPort = 3000, + Traffic = {new ContainerAppRevisionTrafficWeight +{ +RevisionName = "testcontainerApp0-ab1234", +Weight = 100, +Label = "production", +}}, + CustomDomains = {new ContainerAppCustomDomain("www.my-name.com") +{ +BindingType = ContainerAppCustomDomainBindingType.SniEnabled, +CertificateId = new ResourceIdentifier("/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/connectedEnvironments/demokube/certificates/my-certificate-for-my-name-dot-com"), +}, new ContainerAppCustomDomain("www.my-other-name.com") +{ +BindingType = ContainerAppCustomDomainBindingType.SniEnabled, +CertificateId = new ResourceIdentifier("/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/connectedEnvironments/demokube/certificates/my-certificate-for-my-other-name-dot-com"), +}}, + IPSecurityRestrictions = {new ContainerAppIPSecurityRestrictionRule("Allow work IP A subnet", "192.168.1.1/32", ContainerAppIPRuleAction.Allow) +{ +Description = "Allowing all IP's within the subnet below to access containerapp", +}, new ContainerAppIPSecurityRestrictionRule("Allow work IP B subnet", "192.168.1.1/8", ContainerAppIPRuleAction.Allow) +{ +Description = "Allowing all IP's within the subnet below to access containerapp", +}}, + StickySessionsAffinity = Affinity.Sticky, + ClientCertificateMode = ContainerAppIngressClientCertificateMode.Accept, + CorsPolicy = new ContainerAppCorsPolicy(new string[] { "https://a.test.com", "https://b.test.com" }) + { + AllowedMethods = { "GET", "POST" }, + AllowedHeaders = { "HEADER1", "HEADER2" }, + ExposeHeaders = { "HEADER3", "HEADER4" }, + MaxAge = 1234, + AllowCredentials = true, + }, + AdditionalPortMappings = {new IngressPortMapping(true, 1234), new IngressPortMapping(false, 2345) +{ +ExposedPort = 3456, +}}, + }, + Dapr = new ContainerAppDaprConfiguration + { + IsEnabled = true, + AppProtocol = ContainerAppProtocol.Http, + AppPort = 3000, + HttpReadBufferSize = 30, + HttpMaxRequestSize = 10, + LogLevel = ContainerAppDaprLogLevel.Debug, + IsApiLoggingEnabled = true, + }, + Runtime = new ContainerAppRuntime + { + Java = new ContainerAppRuntimeJava + { + EnableMetrics = true, + JavaAgent = new ContainerAppRuntimeJavaAgent + { + IsEnabled = true, + LoggingLoggerSettings = { new LoggerSetting("org.springframework.boot", Level.Debug) }, + }, + }, + AutoConfigureDataProtection = true, + }, + MaxInactiveRevisions = 10, + RevisionTransitionThreshold = 100, + }, + Template = new ContainerAppTemplate + { + InitContainers = {new ContainerAppInitContainer +{ +Image = "repo/testcontainerApp0:v4", +Name = "testinitcontainerApp0", +Command = {"/bin/sh"}, +Args = {"-c", "while true; do echo hello; sleep 10;done"}, +Resources = new AppContainerResources +{ +Cpu = 0.2, +Memory = "100Mi", +}, +}}, + Containers = {new ContainerAppContainer +{ +Probes = {new ContainerAppProbe +{ +HttpGet = new ContainerAppHttpRequestInfo(8080) +{ +HttpHeaders = {new ContainerAppHttpHeaderInfo("Custom-Header", "Awesome")}, +Path = "/health", +}, +InitialDelaySeconds = 3, +PeriodSeconds = 3, +ProbeType = ContainerAppProbeType.Liveness, +}}, +Image = "repo/testcontainerApp0:v1", +Name = "testcontainerApp0", +}}, + Scale = new ContainerAppScale + { + MinReplicas = 1, + MaxReplicas = 5, + CooldownPeriod = 350, + PollingInterval = 35, + Rules = {new ContainerAppScaleRule +{ +Name = "httpscalingrule", +Custom = new ContainerAppCustomScaleRule +{ +CustomScaleRuleType = "http", +Metadata = +{ +["concurrentRequests"] = "50" +}, +}, +}}, + }, + }, + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, containerAppName, data); + ContainerAppResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + ContainerAppData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + [Test] [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_CreateOrUpdateContainerApp() { - // Generated from example definition: specification/app/resource-manager/Microsoft.App/stable/2025-01-01/examples/ContainerApps_CreateOrUpdate.json + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/ContainerApps_CreateOrUpdate.json // this example is just showing the usage of "ContainerApps_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -41,7 +273,7 @@ public async Task CreateOrUpdate_CreateOrUpdateContainerApp() ContainerAppCollection collection = resourceGroupResource.GetContainerApps(); // invoke the operation - string containerAppName = "testcontainerapp0"; + string containerAppName = "testcontainerApp0"; ContainerAppData data = new ContainerAppData(new AzureLocation("East US")) { Identity = new ManagedServiceIdentity("SystemAssigned,UserAssigned") @@ -61,7 +293,7 @@ public async Task CreateOrUpdate_CreateOrUpdateContainerApp() TargetPort = 3000, Traffic = {new ContainerAppRevisionTrafficWeight { -RevisionName = "testcontainerapp0-ab1234", +RevisionName = "testcontainerApp0-ab1234", Weight = 100, Label = "production", }}, @@ -105,9 +337,31 @@ public async Task CreateOrUpdate_CreateOrUpdateContainerApp() HttpMaxRequestSize = 10, LogLevel = ContainerAppDaprLogLevel.Debug, IsApiLoggingEnabled = true, + AppHealth = new DaprAppHealth + { + IsEnabled = true, + Path = "/health", + ProbeIntervalSeconds = 3, + ProbeTimeoutMilliseconds = 1000, + Threshold = 3, + }, + MaxConcurrency = 10, + }, + Runtime = new ContainerAppRuntime + { + Java = new ContainerAppRuntimeJava + { + EnableMetrics = true, + JavaAgent = new ContainerAppRuntimeJavaAgent + { + IsEnabled = true, + LoggingLoggerSettings = { new LoggerSetting("org.springframework.boot", Level.Debug) }, + }, + }, + AutoConfigureDataProtection = true, }, - EnableMetrics = true, MaxInactiveRevisions = 10, + RevisionTransitionThreshold = 100, ServiceType = "redis", IdentitySettings = {new ContainerAppIdentitySettings("/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourcegroups/rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/myidentity") { @@ -121,14 +375,15 @@ public async Task CreateOrUpdate_CreateOrUpdateContainerApp() { InitContainers = {new ContainerAppInitContainer { -Image = "repo/testcontainerapp0:v4", +Image = "repo/testcontainerApp0:v4", Name = "testinitcontainerApp0", Command = {"/bin/sh"}, Args = {"-c", "while true; do echo hello; sleep 10;done"}, Resources = new AppContainerResources { -Cpu = 0.5, -Memory = "1Gi", +Cpu = 0.2, +Memory = "100Mi", +Gpu = 1, }, }}, Containers = {new ContainerAppContainer @@ -144,8 +399,8 @@ public async Task CreateOrUpdate_CreateOrUpdateContainerApp() PeriodSeconds = 3, ProbeType = ContainerAppProbeType.Liveness, }}, -Image = "repo/testcontainerapp0:v1", -Name = "testcontainerapp0", +Image = "repo/testcontainerApp0:v1", +Name = "testcontainerApp0", VolumeMounts = {new ContainerAppVolumeMount { VolumeName = "azurefile", @@ -216,6 +471,11 @@ public async Task CreateOrUpdate_CreateOrUpdateContainerApp() { ServiceId = new ResourceIdentifier("/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/containerApps/redisService"), Name = "redisService", +ClientType = "dotnet", +CustomizedKeys = +{ +["DesiredKey"] = "defaultKey" +}, }}, }, }; @@ -233,7 +493,7 @@ public async Task CreateOrUpdate_CreateOrUpdateContainerApp() [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_CreateOrUpdateManagedByApp() { - // Generated from example definition: specification/app/resource-manager/Microsoft.App/stable/2025-01-01/examples/ContainerApps_ManagedBy_CreateOrUpdate.json + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/ContainerApps_ManagedBy_CreateOrUpdate.json // this example is just showing the usage of "ContainerApps_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -252,7 +512,7 @@ public async Task CreateOrUpdate_CreateOrUpdateManagedByApp() ContainerAppCollection collection = resourceGroupResource.GetContainerApps(); // invoke the operation - string containerAppName = "testcontainerappmanagedby"; + string containerAppName = "testcontainerAppManagedBy"; ContainerAppData data = new ContainerAppData(new AzureLocation("East US")) { ManagedBy = "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.AppPlatform/Spring/springapp", @@ -267,7 +527,7 @@ public async Task CreateOrUpdate_CreateOrUpdateManagedByApp() Transport = ContainerAppIngressTransportMethod.Tcp, Traffic = {new ContainerAppRevisionTrafficWeight { -RevisionName = "testcontainerappmanagedby-ab1234", +RevisionName = "testcontainerAppManagedBy-ab1234", Weight = 100, }}, }, @@ -283,8 +543,8 @@ public async Task CreateOrUpdate_CreateOrUpdateManagedByApp() TcpSocket = new ContainerAppTcpSocketRequestInfo(8080), ProbeType = ContainerAppProbeType.Liveness, }}, -Image = "repo/testcontainerappmanagedby:v1", -Name = "testcontainerappmanagedby", +Image = "repo/testcontainerAppManagedBy:v1", +Name = "testcontainerAppManagedBy", }}, Scale = new ContainerAppScale { @@ -316,11 +576,191 @@ public async Task CreateOrUpdate_CreateOrUpdateManagedByApp() Console.WriteLine($"Succeeded on id: {resourceData.Id}"); } + [Test] + [Ignore("Only validating compilation of examples")] + public async Task CreateOrUpdate_CreateOrUpdateSourceToCloudApp() + { + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/ContainerApps_SourceToCloudApp_CreateOrUpdate.json + // this example is just showing the usage of "ContainerApps_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; + string resourceGroupName = "rg"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this ContainerAppResource + ContainerAppCollection collection = resourceGroupResource.GetContainerApps(); + + // invoke the operation + string containerAppName = "testcontainerApp0"; + ContainerAppData data = new ContainerAppData(new AzureLocation("East US")) + { + EnvironmentId = new ResourceIdentifier("/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/managedEnvironments/demokube"), + WorkloadProfileName = "My-GP-01", + PatchingMode = PatchingMode.Automatic, + Configuration = new ContainerAppConfiguration + { + Ingress = new ContainerAppIngressConfiguration + { + External = true, + TargetPort = 3000, + Traffic = {new ContainerAppRevisionTrafficWeight +{ +RevisionName = "testcontainerApp0-ab1234", +Weight = 100, +Label = "production", +}}, + CustomDomains = {new ContainerAppCustomDomain("www.my-name.com") +{ +BindingType = ContainerAppCustomDomainBindingType.SniEnabled, +CertificateId = new ResourceIdentifier("/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/managedEnvironments/demokube/certificates/my-certificate-for-my-name-dot-com"), +}, new ContainerAppCustomDomain("www.my-other-name.com") +{ +BindingType = ContainerAppCustomDomainBindingType.SniEnabled, +CertificateId = new ResourceIdentifier("/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/managedEnvironments/demokube/certificates/my-certificate-for-my-other-name-dot-com"), +}}, + IPSecurityRestrictions = {new ContainerAppIPSecurityRestrictionRule("Allow work IP A subnet", "192.168.1.1/32", ContainerAppIPRuleAction.Allow) +{ +Description = "Allowing all IP's within the subnet below to access containerapp", +}, new ContainerAppIPSecurityRestrictionRule("Allow work IP B subnet", "192.168.1.1/8", ContainerAppIPRuleAction.Allow) +{ +Description = "Allowing all IP's within the subnet below to access containerapp", +}}, + StickySessionsAffinity = Affinity.Sticky, + ClientCertificateMode = ContainerAppIngressClientCertificateMode.Accept, + CorsPolicy = new ContainerAppCorsPolicy(new string[] { "https://a.test.com", "https://b.test.com" }) + { + AllowedMethods = { "GET", "POST" }, + AllowedHeaders = { "HEADER1", "HEADER2" }, + ExposeHeaders = { "HEADER3", "HEADER4" }, + MaxAge = 1234, + AllowCredentials = true, + }, + AdditionalPortMappings = {new IngressPortMapping(true, 1234), new IngressPortMapping(false, 2345) +{ +ExposedPort = 3456, +}}, + }, + Dapr = new ContainerAppDaprConfiguration + { + IsEnabled = true, + AppProtocol = ContainerAppProtocol.Http, + AppPort = 3000, + HttpReadBufferSize = 30, + HttpMaxRequestSize = 10, + LogLevel = ContainerAppDaprLogLevel.Debug, + IsApiLoggingEnabled = true, + }, + MaxInactiveRevisions = 10, + RevisionTransitionThreshold = 100, + ServiceType = "redis", + }, + Template = new ContainerAppTemplate + { + InitContainers = {new ContainerAppInitContainer +{ +Image = "repo/testcontainerApp0:v4", +Name = "testinitcontainerApp0", +Command = {"/bin/sh"}, +Args = {"-c", "while true; do echo hello; sleep 10;done"}, +Resources = new AppContainerResources +{ +Cpu = 0.2, +Memory = "100Mi", +}, +}}, + Containers = {new ContainerAppContainer +{ +Probes = {new ContainerAppProbe +{ +HttpGet = new ContainerAppHttpRequestInfo(8080) +{ +HttpHeaders = {new ContainerAppHttpHeaderInfo("Custom-Header", "Awesome")}, +Path = "/health", +}, +InitialDelaySeconds = 3, +PeriodSeconds = 3, +ProbeType = ContainerAppProbeType.Liveness, +}}, +Image = "", +ImageType = ImageType.CloudBuild, +Name = "testcontainerApp0", +VolumeMounts = {new ContainerAppVolumeMount +{ +VolumeName = "azurefile", +MountPath = "/mnt/path1", +SubPath = "subPath1", +}, new ContainerAppVolumeMount +{ +VolumeName = "nfsazurefile", +MountPath = "/mnt/path2", +SubPath = "subPath2", +}}, +}}, + Scale = new ContainerAppScale + { + MinReplicas = 1, + MaxReplicas = 5, + CooldownPeriod = 350, + PollingInterval = 35, + Rules = {new ContainerAppScaleRule +{ +Name = "httpscalingrule", +Custom = new ContainerAppCustomScaleRule +{ +CustomScaleRuleType = "http", +Metadata = +{ +["concurrentRequests"] = "50" +}, +}, +}}, + }, + Volumes = {new ContainerAppVolume +{ +Name = "azurefile", +StorageType = ContainerAppStorageType.AzureFile, +StorageName = "storage", +}, new ContainerAppVolume +{ +Name = "nfsazurefile", +StorageType = ContainerAppStorageType.NfsAzureFile, +StorageName = "nfsStorage", +}}, + ServiceBinds = {new ContainerAppServiceBind +{ +ServiceId = new ResourceIdentifier("/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/containerApps/redisService"), +Name = "redisService", +ClientType = "dotnet", +CustomizedKeys = +{ +["DesiredKey"] = "defaultKey" +}, +}}, + }, + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, containerAppName, data); + ContainerAppResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + ContainerAppData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + [Test] [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_CreateOrUpdateTcpApp() { - // Generated from example definition: specification/app/resource-manager/Microsoft.App/stable/2025-01-01/examples/ContainerApps_TcpApp_CreateOrUpdate.json + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/ContainerApps_TcpApp_CreateOrUpdate.json // this example is just showing the usage of "ContainerApps_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -339,7 +779,7 @@ public async Task CreateOrUpdate_CreateOrUpdateTcpApp() ContainerAppCollection collection = resourceGroupResource.GetContainerApps(); // invoke the operation - string containerAppName = "testcontainerapptcp"; + string containerAppName = "testcontainerAppTcp"; ContainerAppData data = new ContainerAppData(new AzureLocation("East US")) { EnvironmentId = new ResourceIdentifier("/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/managedEnvironments/demokube"), @@ -353,7 +793,7 @@ public async Task CreateOrUpdate_CreateOrUpdateTcpApp() Transport = ContainerAppIngressTransportMethod.Tcp, Traffic = {new ContainerAppRevisionTrafficWeight { -RevisionName = "testcontainerapptcp-ab1234", +RevisionName = "testcontainerAppTcp-ab1234", Weight = 100, }}, }, @@ -369,8 +809,8 @@ public async Task CreateOrUpdate_CreateOrUpdateTcpApp() TcpSocket = new ContainerAppTcpSocketRequestInfo(8080), ProbeType = ContainerAppProbeType.Liveness, }}, -Image = "repo/testcontainerapptcp:v1", -Name = "testcontainerapptcp", +Image = "repo/testcontainerAppTcp:v1", +Name = "testcontainerAppTcp", }}, Scale = new ContainerAppScale { @@ -406,7 +846,7 @@ public async Task CreateOrUpdate_CreateOrUpdateTcpApp() [Ignore("Only validating compilation of examples")] public async Task Get_GetContainerApp() { - // Generated from example definition: specification/app/resource-manager/Microsoft.App/stable/2025-01-01/examples/ContainerApps_Get.json + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/ContainerApps_Get.json // this example is just showing the usage of "ContainerApps_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -425,7 +865,7 @@ public async Task Get_GetContainerApp() ContainerAppCollection collection = resourceGroupResource.GetContainerApps(); // invoke the operation - string containerAppName = "testcontainerapp0"; + string containerAppName = "testcontainerApp0"; ContainerAppResource result = await collection.GetAsync(containerAppName); // the variable result is a resource, you could call other operations on this instance as well @@ -439,7 +879,7 @@ public async Task Get_GetContainerApp() [Ignore("Only validating compilation of examples")] public async Task GetAll_ListContainerAppsByResourceGroup() { - // Generated from example definition: specification/app/resource-manager/Microsoft.App/stable/2025-01-01/examples/ContainerApps_ListByResourceGroup.json + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/ContainerApps_ListByResourceGroup.json // this example is just showing the usage of "ContainerApps_ListByResourceGroup" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -474,7 +914,7 @@ public async Task GetAll_ListContainerAppsByResourceGroup() [Ignore("Only validating compilation of examples")] public async Task Exists_GetContainerApp() { - // Generated from example definition: specification/app/resource-manager/Microsoft.App/stable/2025-01-01/examples/ContainerApps_Get.json + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/ContainerApps_Get.json // this example is just showing the usage of "ContainerApps_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -493,7 +933,7 @@ public async Task Exists_GetContainerApp() ContainerAppCollection collection = resourceGroupResource.GetContainerApps(); // invoke the operation - string containerAppName = "testcontainerapp0"; + string containerAppName = "testcontainerApp0"; bool result = await collection.ExistsAsync(containerAppName); Console.WriteLine($"Succeeded: {result}"); @@ -503,7 +943,7 @@ public async Task Exists_GetContainerApp() [Ignore("Only validating compilation of examples")] public async Task GetIfExists_GetContainerApp() { - // Generated from example definition: specification/app/resource-manager/Microsoft.App/stable/2025-01-01/examples/ContainerApps_Get.json + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/ContainerApps_Get.json // this example is just showing the usage of "ContainerApps_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -522,7 +962,7 @@ public async Task GetIfExists_GetContainerApp() ContainerAppCollection collection = resourceGroupResource.GetContainerApps(); // invoke the operation - string containerAppName = "testcontainerapp0"; + string containerAppName = "testcontainerApp0"; NullableResponse response = await collection.GetIfExistsAsync(containerAppName); ContainerAppResource result = response.HasValue ? response.Value : null; diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/tests/Generated/Samples/Sample_ContainerAppConnectedEnvironmentCertificateCollection.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/tests/Generated/Samples/Sample_ContainerAppConnectedEnvironmentCertificateCollection.cs index b85d23c09bee..0e28c9e04cc6 100644 --- a/sdk/containerapps/Azure.ResourceManager.AppContainers/tests/Generated/Samples/Sample_ContainerAppConnectedEnvironmentCertificateCollection.cs +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/tests/Generated/Samples/Sample_ContainerAppConnectedEnvironmentCertificateCollection.cs @@ -21,7 +21,7 @@ public partial class Sample_ContainerAppConnectedEnvironmentCertificateCollectio [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_CreateOrUpdateCertificate() { - // Generated from example definition: specification/app/resource-manager/Microsoft.App/stable/2025-01-01/examples/ConnectedEnvironmentsCertificate_CreateOrUpdate.json + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/ConnectedEnvironmentsCertificate_CreateOrUpdate.json // this example is just showing the usage of "ConnectedEnvironmentsCertificates_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -64,7 +64,7 @@ public async Task CreateOrUpdate_CreateOrUpdateCertificate() [Ignore("Only validating compilation of examples")] public async Task Get_GetCertificate() { - // Generated from example definition: specification/app/resource-manager/Microsoft.App/stable/2025-01-01/examples/ConnectedEnvironmentsCertificate_Get.json + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/ConnectedEnvironmentsCertificate_Get.json // this example is just showing the usage of "ConnectedEnvironmentsCertificates_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -98,7 +98,7 @@ public async Task Get_GetCertificate() [Ignore("Only validating compilation of examples")] public async Task GetAll_ListCertificatesByConnectedEnvironment() { - // Generated from example definition: specification/app/resource-manager/Microsoft.App/stable/2025-01-01/examples/ConnectedEnvironmentsCertificates_ListByConnectedEnvironment.json + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/ConnectedEnvironmentsCertificates_ListByConnectedEnvironment.json // this example is just showing the usage of "ConnectedEnvironmentsCertificates_List" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -134,7 +134,7 @@ public async Task GetAll_ListCertificatesByConnectedEnvironment() [Ignore("Only validating compilation of examples")] public async Task Exists_GetCertificate() { - // Generated from example definition: specification/app/resource-manager/Microsoft.App/stable/2025-01-01/examples/ConnectedEnvironmentsCertificate_Get.json + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/ConnectedEnvironmentsCertificate_Get.json // this example is just showing the usage of "ConnectedEnvironmentsCertificates_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -164,7 +164,7 @@ public async Task Exists_GetCertificate() [Ignore("Only validating compilation of examples")] public async Task GetIfExists_GetCertificate() { - // Generated from example definition: specification/app/resource-manager/Microsoft.App/stable/2025-01-01/examples/ConnectedEnvironmentsCertificate_Get.json + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/ConnectedEnvironmentsCertificate_Get.json // this example is just showing the usage of "ConnectedEnvironmentsCertificates_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/tests/Generated/Samples/Sample_ContainerAppConnectedEnvironmentCertificateResource.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/tests/Generated/Samples/Sample_ContainerAppConnectedEnvironmentCertificateResource.cs index ae4e7694e6e5..9e98bd2500e3 100644 --- a/sdk/containerapps/Azure.ResourceManager.AppContainers/tests/Generated/Samples/Sample_ContainerAppConnectedEnvironmentCertificateResource.cs +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/tests/Generated/Samples/Sample_ContainerAppConnectedEnvironmentCertificateResource.cs @@ -20,7 +20,7 @@ public partial class Sample_ContainerAppConnectedEnvironmentCertificateResource [Ignore("Only validating compilation of examples")] public async Task Get_GetCertificate() { - // Generated from example definition: specification/app/resource-manager/Microsoft.App/stable/2025-01-01/examples/ConnectedEnvironmentsCertificate_Get.json + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/ConnectedEnvironmentsCertificate_Get.json // this example is just showing the usage of "ConnectedEnvironmentsCertificates_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -51,7 +51,7 @@ public async Task Get_GetCertificate() [Ignore("Only validating compilation of examples")] public async Task Delete_DeleteCertificate() { - // Generated from example definition: specification/app/resource-manager/Microsoft.App/stable/2025-01-01/examples/ConnectedEnvironmentsCertificate_Delete.json + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/ConnectedEnvironmentsCertificate_Delete.json // this example is just showing the usage of "ConnectedEnvironmentsCertificates_Delete" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -78,7 +78,7 @@ public async Task Delete_DeleteCertificate() [Ignore("Only validating compilation of examples")] public async Task Update_PatchCertificate() { - // Generated from example definition: specification/app/resource-manager/Microsoft.App/stable/2025-01-01/examples/ConnectedEnvironmentsCertificates_Patch.json + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/ConnectedEnvironmentsCertificates_Patch.json // this example is just showing the usage of "ConnectedEnvironmentsCertificates_Update" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -104,7 +104,8 @@ public async Task Update_PatchCertificate() ["tag2"] = "value2" }, }; - ContainerAppConnectedEnvironmentCertificateResource result = await containerAppConnectedEnvironmentCertificate.UpdateAsync(patch); + ArmOperation lro = await containerAppConnectedEnvironmentCertificate.UpdateAsync(WaitUntil.Completed, patch); + ContainerAppConnectedEnvironmentCertificateResource result = lro.Value; // the variable result is a resource, you could call other operations on this instance as well // but just for demo, we get its data from this resource instance diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/tests/Generated/Samples/Sample_ContainerAppConnectedEnvironmentCollection.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/tests/Generated/Samples/Sample_ContainerAppConnectedEnvironmentCollection.cs index 1677d74baa53..7e27d126ec39 100644 --- a/sdk/containerapps/Azure.ResourceManager.AppContainers/tests/Generated/Samples/Sample_ContainerAppConnectedEnvironmentCollection.cs +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/tests/Generated/Samples/Sample_ContainerAppConnectedEnvironmentCollection.cs @@ -23,7 +23,7 @@ public partial class Sample_ContainerAppConnectedEnvironmentCollection [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_CreateKubeEnvironments() { - // Generated from example definition: specification/app/resource-manager/Microsoft.App/stable/2025-01-01/examples/ConnectedEnvironments_CreateOrUpdate.json + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/ConnectedEnvironments_CreateOrUpdate.json // this example is just showing the usage of "ConnectedEnvironments_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -68,7 +68,7 @@ public async Task CreateOrUpdate_CreateKubeEnvironments() [Ignore("Only validating compilation of examples")] public async Task Get_GetConnectedEnvironmentByConnectedEnvironmentName() { - // Generated from example definition: specification/app/resource-manager/Microsoft.App/stable/2025-01-01/examples/ConnectedEnvironments_Get.json + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/ConnectedEnvironments_Get.json // this example is just showing the usage of "ConnectedEnvironments_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -101,7 +101,7 @@ public async Task Get_GetConnectedEnvironmentByConnectedEnvironmentName() [Ignore("Only validating compilation of examples")] public async Task GetAll_ListEnvironmentsByResourceGroup() { - // Generated from example definition: specification/app/resource-manager/Microsoft.App/stable/2025-01-01/examples/ConnectedEnvironments_ListByResourceGroup.json + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/ConnectedEnvironments_ListByResourceGroup.json // this example is just showing the usage of "ConnectedEnvironments_ListByResourceGroup" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -136,7 +136,7 @@ public async Task GetAll_ListEnvironmentsByResourceGroup() [Ignore("Only validating compilation of examples")] public async Task Exists_GetConnectedEnvironmentByConnectedEnvironmentName() { - // Generated from example definition: specification/app/resource-manager/Microsoft.App/stable/2025-01-01/examples/ConnectedEnvironments_Get.json + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/ConnectedEnvironments_Get.json // this example is just showing the usage of "ConnectedEnvironments_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -165,7 +165,7 @@ public async Task Exists_GetConnectedEnvironmentByConnectedEnvironmentName() [Ignore("Only validating compilation of examples")] public async Task GetIfExists_GetConnectedEnvironmentByConnectedEnvironmentName() { - // Generated from example definition: specification/app/resource-manager/Microsoft.App/stable/2025-01-01/examples/ConnectedEnvironments_Get.json + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/ConnectedEnvironments_Get.json // this example is just showing the usage of "ConnectedEnvironments_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/tests/Generated/Samples/Sample_ContainerAppConnectedEnvironmentDaprComponentCollection.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/tests/Generated/Samples/Sample_ContainerAppConnectedEnvironmentDaprComponentCollection.cs index 41494e46449e..81c1c7411ede 100644 --- a/sdk/containerapps/Azure.ResourceManager.AppContainers/tests/Generated/Samples/Sample_ContainerAppConnectedEnvironmentDaprComponentCollection.cs +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/tests/Generated/Samples/Sample_ContainerAppConnectedEnvironmentDaprComponentCollection.cs @@ -20,7 +20,7 @@ public partial class Sample_ContainerAppConnectedEnvironmentDaprComponentCollect [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_CreateOrUpdateDaprComponent() { - // Generated from example definition: specification/app/resource-manager/Microsoft.App/stable/2025-01-01/examples/ConnectedEnvironmentsDaprComponents_CreateOrUpdate.json + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/ConnectedEnvironmentsDaprComponents_CreateOrUpdate.json // this example is just showing the usage of "ConnectedEnvironmentsDaprComponents_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -41,7 +41,7 @@ public async Task CreateOrUpdate_CreateOrUpdateDaprComponent() // invoke the operation string componentName = "reddog"; - ContainerAppDaprComponentData data = new ContainerAppDaprComponentData + ConnectedEnvironmentDaprComponentData data = new ConnectedEnvironmentDaprComponentData { ComponentType = "state.azure.cosmosdb", Version = "v1", @@ -70,13 +70,23 @@ public async Task CreateOrUpdate_CreateOrUpdateDaprComponent() SecretRef = "masterkey", }}, Scopes = { "container-app-1", "container-app-2" }, + ServiceComponentBind = {new DaprComponentServiceBinding +{ +Name = "statestore", +ServiceId = "/subscriptions/9f7371f1-b593-4c3c-84e2-9167806ad358/resourceGroups/ca-syn2-group/providers/Microsoft.App/containerapps/cappredis", +Metadata = new DaprServiceBindMetadata +{ +Name = "daprcomponentBind", +Value = "redis-bind", +}, +}}, }; ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, componentName, data); ContainerAppConnectedEnvironmentDaprComponentResource result = lro.Value; // the variable result is a resource, you could call other operations on this instance as well // but just for demo, we get its data from this resource instance - ContainerAppDaprComponentData resourceData = result.Data; + ConnectedEnvironmentDaprComponentData resourceData = result.Data; // for demo we just print out the id Console.WriteLine($"Succeeded on id: {resourceData.Id}"); } @@ -85,7 +95,7 @@ public async Task CreateOrUpdate_CreateOrUpdateDaprComponent() [Ignore("Only validating compilation of examples")] public async Task Get_GetDaprComponent() { - // Generated from example definition: specification/app/resource-manager/Microsoft.App/stable/2025-01-01/examples/ConnectedEnvironmentsDaprComponents_Get.json + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/ConnectedEnvironmentsDaprComponents_Get.json // this example is just showing the usage of "ConnectedEnvironmentsDaprComponents_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -110,7 +120,7 @@ public async Task Get_GetDaprComponent() // the variable result is a resource, you could call other operations on this instance as well // but just for demo, we get its data from this resource instance - ContainerAppDaprComponentData resourceData = result.Data; + ConnectedEnvironmentDaprComponentData resourceData = result.Data; // for demo we just print out the id Console.WriteLine($"Succeeded on id: {resourceData.Id}"); } @@ -119,7 +129,7 @@ public async Task Get_GetDaprComponent() [Ignore("Only validating compilation of examples")] public async Task GetAll_ListDaprComponents() { - // Generated from example definition: specification/app/resource-manager/Microsoft.App/stable/2025-01-01/examples/ConnectedEnvironmentsDaprComponents_List.json + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/ConnectedEnvironmentsDaprComponents_List.json // this example is just showing the usage of "ConnectedEnvironmentsDaprComponents_List" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -143,7 +153,7 @@ public async Task GetAll_ListDaprComponents() { // the variable item is a resource, you could call other operations on this instance as well // but just for demo, we get its data from this resource instance - ContainerAppDaprComponentData resourceData = item.Data; + ConnectedEnvironmentDaprComponentData resourceData = item.Data; // for demo we just print out the id Console.WriteLine($"Succeeded on id: {resourceData.Id}"); } @@ -155,7 +165,7 @@ public async Task GetAll_ListDaprComponents() [Ignore("Only validating compilation of examples")] public async Task Exists_GetDaprComponent() { - // Generated from example definition: specification/app/resource-manager/Microsoft.App/stable/2025-01-01/examples/ConnectedEnvironmentsDaprComponents_Get.json + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/ConnectedEnvironmentsDaprComponents_Get.json // this example is just showing the usage of "ConnectedEnvironmentsDaprComponents_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -185,7 +195,7 @@ public async Task Exists_GetDaprComponent() [Ignore("Only validating compilation of examples")] public async Task GetIfExists_GetDaprComponent() { - // Generated from example definition: specification/app/resource-manager/Microsoft.App/stable/2025-01-01/examples/ConnectedEnvironmentsDaprComponents_Get.json + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/ConnectedEnvironmentsDaprComponents_Get.json // this example is just showing the usage of "ConnectedEnvironmentsDaprComponents_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -217,7 +227,7 @@ public async Task GetIfExists_GetDaprComponent() { // the variable result is a resource, you could call other operations on this instance as well // but just for demo, we get its data from this resource instance - ContainerAppDaprComponentData resourceData = result.Data; + ConnectedEnvironmentDaprComponentData resourceData = result.Data; // for demo we just print out the id Console.WriteLine($"Succeeded on id: {resourceData.Id}"); } diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/tests/Generated/Samples/Sample_ContainerAppConnectedEnvironmentDaprComponentResource.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/tests/Generated/Samples/Sample_ContainerAppConnectedEnvironmentDaprComponentResource.cs index 3fbdf5a5dad4..47a421bd853c 100644 --- a/sdk/containerapps/Azure.ResourceManager.AppContainers/tests/Generated/Samples/Sample_ContainerAppConnectedEnvironmentDaprComponentResource.cs +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/tests/Generated/Samples/Sample_ContainerAppConnectedEnvironmentDaprComponentResource.cs @@ -20,7 +20,7 @@ public partial class Sample_ContainerAppConnectedEnvironmentDaprComponentResourc [Ignore("Only validating compilation of examples")] public async Task Get_GetDaprComponent() { - // Generated from example definition: specification/app/resource-manager/Microsoft.App/stable/2025-01-01/examples/ConnectedEnvironmentsDaprComponents_Get.json + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/ConnectedEnvironmentsDaprComponents_Get.json // this example is just showing the usage of "ConnectedEnvironmentsDaprComponents_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -42,7 +42,7 @@ public async Task Get_GetDaprComponent() // the variable result is a resource, you could call other operations on this instance as well // but just for demo, we get its data from this resource instance - ContainerAppDaprComponentData resourceData = result.Data; + ConnectedEnvironmentDaprComponentData resourceData = result.Data; // for demo we just print out the id Console.WriteLine($"Succeeded on id: {resourceData.Id}"); } @@ -51,7 +51,7 @@ public async Task Get_GetDaprComponent() [Ignore("Only validating compilation of examples")] public async Task Delete_DeleteDaprComponent() { - // Generated from example definition: specification/app/resource-manager/Microsoft.App/stable/2025-01-01/examples/ConnectedEnvironmentsDaprComponents_Delete.json + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/ConnectedEnvironmentsDaprComponents_Delete.json // this example is just showing the usage of "ConnectedEnvironmentsDaprComponents_Delete" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -78,7 +78,7 @@ public async Task Delete_DeleteDaprComponent() [Ignore("Only validating compilation of examples")] public async Task Update_CreateOrUpdateDaprComponent() { - // Generated from example definition: specification/app/resource-manager/Microsoft.App/stable/2025-01-01/examples/ConnectedEnvironmentsDaprComponents_CreateOrUpdate.json + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/ConnectedEnvironmentsDaprComponents_CreateOrUpdate.json // this example is just showing the usage of "ConnectedEnvironmentsDaprComponents_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -96,7 +96,7 @@ public async Task Update_CreateOrUpdateDaprComponent() ContainerAppConnectedEnvironmentDaprComponentResource containerAppConnectedEnvironmentDaprComponent = client.GetContainerAppConnectedEnvironmentDaprComponentResource(containerAppConnectedEnvironmentDaprComponentResourceId); // invoke the operation - ContainerAppDaprComponentData data = new ContainerAppDaprComponentData + ConnectedEnvironmentDaprComponentData data = new ConnectedEnvironmentDaprComponentData { ComponentType = "state.azure.cosmosdb", Version = "v1", @@ -125,13 +125,23 @@ public async Task Update_CreateOrUpdateDaprComponent() SecretRef = "masterkey", }}, Scopes = { "container-app-1", "container-app-2" }, + ServiceComponentBind = {new DaprComponentServiceBinding +{ +Name = "statestore", +ServiceId = "/subscriptions/9f7371f1-b593-4c3c-84e2-9167806ad358/resourceGroups/ca-syn2-group/providers/Microsoft.App/containerapps/cappredis", +Metadata = new DaprServiceBindMetadata +{ +Name = "daprcomponentBind", +Value = "redis-bind", +}, +}}, }; ArmOperation lro = await containerAppConnectedEnvironmentDaprComponent.UpdateAsync(WaitUntil.Completed, data); ContainerAppConnectedEnvironmentDaprComponentResource result = lro.Value; // the variable result is a resource, you could call other operations on this instance as well // but just for demo, we get its data from this resource instance - ContainerAppDaprComponentData resourceData = result.Data; + ConnectedEnvironmentDaprComponentData resourceData = result.Data; // for demo we just print out the id Console.WriteLine($"Succeeded on id: {resourceData.Id}"); } @@ -140,7 +150,7 @@ public async Task Update_CreateOrUpdateDaprComponent() [Ignore("Only validating compilation of examples")] public async Task GetSecrets_ListContainerAppsSecrets() { - // Generated from example definition: specification/app/resource-manager/Microsoft.App/stable/2025-01-01/examples/ConnectedEnvironmentsDaprComponents_ListSecrets.json + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/ConnectedEnvironmentsDaprComponents_ListSecrets.json // this example is just showing the usage of "ConnectedEnvironmentsDaprComponents_ListSecrets" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/tests/Generated/Samples/Sample_ContainerAppConnectedEnvironmentResource.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/tests/Generated/Samples/Sample_ContainerAppConnectedEnvironmentResource.cs index 926e6dd2b49c..e85cb73ae872 100644 --- a/sdk/containerapps/Azure.ResourceManager.AppContainers/tests/Generated/Samples/Sample_ContainerAppConnectedEnvironmentResource.cs +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/tests/Generated/Samples/Sample_ContainerAppConnectedEnvironmentResource.cs @@ -20,7 +20,7 @@ public partial class Sample_ContainerAppConnectedEnvironmentResource [Ignore("Only validating compilation of examples")] public async Task Get_GetConnectedEnvironmentByConnectedEnvironmentName() { - // Generated from example definition: specification/app/resource-manager/Microsoft.App/stable/2025-01-01/examples/ConnectedEnvironments_Get.json + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/ConnectedEnvironments_Get.json // this example is just showing the usage of "ConnectedEnvironments_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -50,7 +50,7 @@ public async Task Get_GetConnectedEnvironmentByConnectedEnvironmentName() [Ignore("Only validating compilation of examples")] public async Task Delete_DeleteConnectedEnvironmentByConnectedEnvironmentName() { - // Generated from example definition: specification/app/resource-manager/Microsoft.App/stable/2025-01-01/examples/ConnectedEnvironments_Delete.json + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/ConnectedEnvironments_Delete.json // this example is just showing the usage of "ConnectedEnvironments_Delete" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -76,7 +76,7 @@ public async Task Delete_DeleteConnectedEnvironmentByConnectedEnvironmentName() [Ignore("Only validating compilation of examples")] public async Task Update_PatchManagedEnvironment() { - // Generated from example definition: specification/app/resource-manager/Microsoft.App/stable/2025-01-01/examples/ConnectedEnvironments_Patch.json + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/ConnectedEnvironments_Patch.json // this example is just showing the usage of "ConnectedEnvironments_Update" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -93,7 +93,15 @@ public async Task Update_PatchManagedEnvironment() ContainerAppConnectedEnvironmentResource containerAppConnectedEnvironment = client.GetContainerAppConnectedEnvironmentResource(containerAppConnectedEnvironmentResourceId); // invoke the operation - ContainerAppConnectedEnvironmentResource result = await containerAppConnectedEnvironment.UpdateAsync(); + ContainerAppConnectedEnvironmentPatch patch = new ContainerAppConnectedEnvironmentPatch + { + Tags = +{ +["tag1"] = "value1", +["tag2"] = "value2" +}, + }; + ContainerAppConnectedEnvironmentResource result = await containerAppConnectedEnvironment.UpdateAsync(patch); // the variable result is a resource, you could call other operations on this instance as well // but just for demo, we get its data from this resource instance @@ -106,7 +114,7 @@ public async Task Update_PatchManagedEnvironment() [Ignore("Only validating compilation of examples")] public async Task CheckNameAvailability_CertificatesCheckNameAvailability() { - // Generated from example definition: specification/app/resource-manager/Microsoft.App/stable/2025-01-01/examples/ConnectedEnvironmentsCertificates_CheckNameAvailability.json + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/ConnectedEnvironmentsCertificates_CheckNameAvailability.json // this example is just showing the usage of "ConnectedEnvironments_CheckNameAvailability" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/tests/Generated/Samples/Sample_ContainerAppConnectedEnvironmentStorageCollection.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/tests/Generated/Samples/Sample_ContainerAppConnectedEnvironmentStorageCollection.cs index d0bd5e3bfd50..648abd41fac8 100644 --- a/sdk/containerapps/Azure.ResourceManager.AppContainers/tests/Generated/Samples/Sample_ContainerAppConnectedEnvironmentStorageCollection.cs +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/tests/Generated/Samples/Sample_ContainerAppConnectedEnvironmentStorageCollection.cs @@ -20,7 +20,7 @@ public partial class Sample_ContainerAppConnectedEnvironmentStorageCollection [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_CreateOrUpdateEnvironmentsStorage() { - // Generated from example definition: specification/app/resource-manager/Microsoft.App/stable/2025-01-01/examples/ConnectedEnvironmentsStorages_CreateOrUpdate.json + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/ConnectedEnvironmentsStorages_CreateOrUpdate.json // this example is just showing the usage of "ConnectedEnvironmentsStorages_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -43,12 +43,15 @@ public async Task CreateOrUpdate_CreateOrUpdateEnvironmentsStorage() string storageName = "jlaw-demo1"; ContainerAppConnectedEnvironmentStorageData data = new ContainerAppConnectedEnvironmentStorageData { - ConnectedEnvironmentStorageAzureFile = new ContainerAppAzureFileProperties + Properties = new ConnectedEnvironmentStorageProperties { - AccountName = "account1", - AccountKey = "key", - AccessMode = ContainerAppAccessMode.ReadOnly, - ShareName = "share1", + AzureFile = new ContainerAppAzureFileProperties + { + AccountName = "account1", + AccountKey = "key", + AccessMode = ContainerAppAccessMode.ReadOnly, + ShareName = "share1", + }, }, }; ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, storageName, data); @@ -65,7 +68,7 @@ public async Task CreateOrUpdate_CreateOrUpdateEnvironmentsStorage() [Ignore("Only validating compilation of examples")] public async Task Get_GetAEnvironmentsStoragePropertiesBySubscription() { - // Generated from example definition: specification/app/resource-manager/Microsoft.App/stable/2025-01-01/examples/ConnectedEnvironmentsStorages_Get.json + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/ConnectedEnvironmentsStorages_Get.json // this example is just showing the usage of "ConnectedEnvironmentsStorages_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -99,7 +102,7 @@ public async Task Get_GetAEnvironmentsStoragePropertiesBySubscription() [Ignore("Only validating compilation of examples")] public async Task GetAll_ListEnvironmentsStoragesBySubscription() { - // Generated from example definition: specification/app/resource-manager/Microsoft.App/stable/2025-01-01/examples/ConnectedEnvironmentsStorages_List.json + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/ConnectedEnvironmentsStorages_List.json // this example is just showing the usage of "ConnectedEnvironmentsStorages_List" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -135,7 +138,7 @@ public async Task GetAll_ListEnvironmentsStoragesBySubscription() [Ignore("Only validating compilation of examples")] public async Task Exists_GetAEnvironmentsStoragePropertiesBySubscription() { - // Generated from example definition: specification/app/resource-manager/Microsoft.App/stable/2025-01-01/examples/ConnectedEnvironmentsStorages_Get.json + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/ConnectedEnvironmentsStorages_Get.json // this example is just showing the usage of "ConnectedEnvironmentsStorages_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -165,7 +168,7 @@ public async Task Exists_GetAEnvironmentsStoragePropertiesBySubscription() [Ignore("Only validating compilation of examples")] public async Task GetIfExists_GetAEnvironmentsStoragePropertiesBySubscription() { - // Generated from example definition: specification/app/resource-manager/Microsoft.App/stable/2025-01-01/examples/ConnectedEnvironmentsStorages_Get.json + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/ConnectedEnvironmentsStorages_Get.json // this example is just showing the usage of "ConnectedEnvironmentsStorages_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/tests/Generated/Samples/Sample_ContainerAppConnectedEnvironmentStorageResource.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/tests/Generated/Samples/Sample_ContainerAppConnectedEnvironmentStorageResource.cs index 260f96fac7cc..67acc28a9b02 100644 --- a/sdk/containerapps/Azure.ResourceManager.AppContainers/tests/Generated/Samples/Sample_ContainerAppConnectedEnvironmentStorageResource.cs +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/tests/Generated/Samples/Sample_ContainerAppConnectedEnvironmentStorageResource.cs @@ -20,7 +20,7 @@ public partial class Sample_ContainerAppConnectedEnvironmentStorageResource [Ignore("Only validating compilation of examples")] public async Task Get_GetAEnvironmentsStoragePropertiesBySubscription() { - // Generated from example definition: specification/app/resource-manager/Microsoft.App/stable/2025-01-01/examples/ConnectedEnvironmentsStorages_Get.json + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/ConnectedEnvironmentsStorages_Get.json // this example is just showing the usage of "ConnectedEnvironmentsStorages_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -51,7 +51,7 @@ public async Task Get_GetAEnvironmentsStoragePropertiesBySubscription() [Ignore("Only validating compilation of examples")] public async Task Delete_ListEnvironmentsStoragesBySubscription() { - // Generated from example definition: specification/app/resource-manager/Microsoft.App/stable/2025-01-01/examples/ConnectedEnvironmentsStorages_Delete.json + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/ConnectedEnvironmentsStorages_Delete.json // this example is just showing the usage of "ConnectedEnvironmentsStorages_Delete" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -78,7 +78,7 @@ public async Task Delete_ListEnvironmentsStoragesBySubscription() [Ignore("Only validating compilation of examples")] public async Task Update_CreateOrUpdateEnvironmentsStorage() { - // Generated from example definition: specification/app/resource-manager/Microsoft.App/stable/2025-01-01/examples/ConnectedEnvironmentsStorages_CreateOrUpdate.json + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/ConnectedEnvironmentsStorages_CreateOrUpdate.json // this example is just showing the usage of "ConnectedEnvironmentsStorages_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -98,12 +98,15 @@ public async Task Update_CreateOrUpdateEnvironmentsStorage() // invoke the operation ContainerAppConnectedEnvironmentStorageData data = new ContainerAppConnectedEnvironmentStorageData { - ConnectedEnvironmentStorageAzureFile = new ContainerAppAzureFileProperties + Properties = new ConnectedEnvironmentStorageProperties { - AccountName = "account1", - AccountKey = "key", - AccessMode = ContainerAppAccessMode.ReadOnly, - ShareName = "share1", + AzureFile = new ContainerAppAzureFileProperties + { + AccountName = "account1", + AccountKey = "key", + AccessMode = ContainerAppAccessMode.ReadOnly, + ShareName = "share1", + }, }, }; ArmOperation lro = await containerAppConnectedEnvironmentStorage.UpdateAsync(WaitUntil.Completed, data); diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/tests/Generated/Samples/Sample_ContainerAppDetectorCollection.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/tests/Generated/Samples/Sample_ContainerAppDetectorCollection.cs index c20a7625f1ed..dd35a2a5fed0 100644 --- a/sdk/containerapps/Azure.ResourceManager.AppContainers/tests/Generated/Samples/Sample_ContainerAppDetectorCollection.cs +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/tests/Generated/Samples/Sample_ContainerAppDetectorCollection.cs @@ -19,7 +19,7 @@ public partial class Sample_ContainerAppDetectorCollection [Ignore("Only validating compilation of examples")] public async Task Get_GetContainerAppSDiagnosticsInfo() { - // Generated from example definition: specification/app/resource-manager/Microsoft.App/stable/2025-01-01/examples/ContainerAppsDiagnostics_Get.json + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/ContainerAppsDiagnostics_Get.json // this example is just showing the usage of "ContainerAppsDiagnostics_GetDetector" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -53,7 +53,7 @@ public async Task Get_GetContainerAppSDiagnosticsInfo() [Ignore("Only validating compilation of examples")] public async Task GetAll_GetTheListOfAvailableDiagnosticsForAGivenContainerApp() { - // Generated from example definition: specification/app/resource-manager/Microsoft.App/stable/2025-01-01/examples/ContainerAppsDiagnostics_List.json + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/ContainerAppsDiagnostics_List.json // this example is just showing the usage of "ContainerAppsDiagnostics_ListDetectors" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -89,7 +89,7 @@ public async Task GetAll_GetTheListOfAvailableDiagnosticsForAGivenContainerApp() [Ignore("Only validating compilation of examples")] public async Task Exists_GetContainerAppSDiagnosticsInfo() { - // Generated from example definition: specification/app/resource-manager/Microsoft.App/stable/2025-01-01/examples/ContainerAppsDiagnostics_Get.json + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/ContainerAppsDiagnostics_Get.json // this example is just showing the usage of "ContainerAppsDiagnostics_GetDetector" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -119,7 +119,7 @@ public async Task Exists_GetContainerAppSDiagnosticsInfo() [Ignore("Only validating compilation of examples")] public async Task GetIfExists_GetContainerAppSDiagnosticsInfo() { - // Generated from example definition: specification/app/resource-manager/Microsoft.App/stable/2025-01-01/examples/ContainerAppsDiagnostics_Get.json + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/ContainerAppsDiagnostics_Get.json // this example is just showing the usage of "ContainerAppsDiagnostics_GetDetector" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/tests/Generated/Samples/Sample_ContainerAppDetectorPropertyResource.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/tests/Generated/Samples/Sample_ContainerAppDetectorPropertyResource.cs index cf3f26468589..79356db0f590 100644 --- a/sdk/containerapps/Azure.ResourceManager.AppContainers/tests/Generated/Samples/Sample_ContainerAppDetectorPropertyResource.cs +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/tests/Generated/Samples/Sample_ContainerAppDetectorPropertyResource.cs @@ -19,7 +19,7 @@ public partial class Sample_ContainerAppDetectorPropertyResource [Ignore("Only validating compilation of examples")] public async Task Get_GetContainerApp() { - // Generated from example definition: specification/app/resource-manager/Microsoft.App/stable/2025-01-01/examples/ContainerApps_Get.json + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/ContainerApps_Get.json // this example is just showing the usage of "ContainerAppsDiagnostics_GetRoot" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -31,7 +31,7 @@ public async Task Get_GetContainerApp() // for more information of creating ContainerAppDetectorPropertyResource, please refer to the document of ContainerAppDetectorPropertyResource string subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; string resourceGroupName = "rg"; - string containerAppName = "testcontainerapp0"; + string containerAppName = "testcontainerApp0"; ResourceIdentifier containerAppDetectorPropertyResourceId = ContainerAppDetectorPropertyResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, containerAppName); ContainerAppDetectorPropertyResource containerAppDetectorProperty = client.GetContainerAppDetectorPropertyResource(containerAppDetectorPropertyResourceId); diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/tests/Generated/Samples/Sample_ContainerAppDetectorPropertyRevisionCollection.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/tests/Generated/Samples/Sample_ContainerAppDetectorPropertyRevisionCollection.cs index 5b2432915950..879fea38f54a 100644 --- a/sdk/containerapps/Azure.ResourceManager.AppContainers/tests/Generated/Samples/Sample_ContainerAppDetectorPropertyRevisionCollection.cs +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/tests/Generated/Samples/Sample_ContainerAppDetectorPropertyRevisionCollection.cs @@ -19,7 +19,7 @@ public partial class Sample_ContainerAppDetectorPropertyRevisionCollection [Ignore("Only validating compilation of examples")] public async Task Get_GetContainerAppSRevision() { - // Generated from example definition: specification/app/resource-manager/Microsoft.App/stable/2025-01-01/examples/Revisions_Get.json + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/Revisions_Get.json // this example is just showing the usage of "ContainerAppsDiagnostics_GetRevision" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -53,7 +53,7 @@ public async Task Get_GetContainerAppSRevision() [Ignore("Only validating compilation of examples")] public async Task GetAll_ListContainerAppSRevisions() { - // Generated from example definition: specification/app/resource-manager/Microsoft.App/stable/2025-01-01/examples/Revisions_List.json + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/Revisions_List.json // this example is just showing the usage of "ContainerAppsDiagnostics_ListRevisions" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -89,7 +89,7 @@ public async Task GetAll_ListContainerAppSRevisions() [Ignore("Only validating compilation of examples")] public async Task Exists_GetContainerAppSRevision() { - // Generated from example definition: specification/app/resource-manager/Microsoft.App/stable/2025-01-01/examples/Revisions_Get.json + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/Revisions_Get.json // this example is just showing the usage of "ContainerAppsDiagnostics_GetRevision" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -119,7 +119,7 @@ public async Task Exists_GetContainerAppSRevision() [Ignore("Only validating compilation of examples")] public async Task GetIfExists_GetContainerAppSRevision() { - // Generated from example definition: specification/app/resource-manager/Microsoft.App/stable/2025-01-01/examples/Revisions_Get.json + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/Revisions_Get.json // this example is just showing the usage of "ContainerAppsDiagnostics_GetRevision" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/tests/Generated/Samples/Sample_ContainerAppDetectorPropertyRevisionResource.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/tests/Generated/Samples/Sample_ContainerAppDetectorPropertyRevisionResource.cs index 443f57d3847b..e529874d10c3 100644 --- a/sdk/containerapps/Azure.ResourceManager.AppContainers/tests/Generated/Samples/Sample_ContainerAppDetectorPropertyRevisionResource.cs +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/tests/Generated/Samples/Sample_ContainerAppDetectorPropertyRevisionResource.cs @@ -19,7 +19,7 @@ public partial class Sample_ContainerAppDetectorPropertyRevisionResource [Ignore("Only validating compilation of examples")] public async Task Get_GetContainerAppSRevision() { - // Generated from example definition: specification/app/resource-manager/Microsoft.App/stable/2025-01-01/examples/Revisions_Get.json + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/Revisions_Get.json // this example is just showing the usage of "ContainerAppsDiagnostics_GetRevision" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/tests/Generated/Samples/Sample_ContainerAppDetectorResource.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/tests/Generated/Samples/Sample_ContainerAppDetectorResource.cs index dfe3cf0af6cc..52e00a3f5064 100644 --- a/sdk/containerapps/Azure.ResourceManager.AppContainers/tests/Generated/Samples/Sample_ContainerAppDetectorResource.cs +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/tests/Generated/Samples/Sample_ContainerAppDetectorResource.cs @@ -19,7 +19,7 @@ public partial class Sample_ContainerAppDetectorResource [Ignore("Only validating compilation of examples")] public async Task Get_GetContainerAppSDiagnosticsInfo() { - // Generated from example definition: specification/app/resource-manager/Microsoft.App/stable/2025-01-01/examples/ContainerAppsDiagnostics_Get.json + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/ContainerAppsDiagnostics_Get.json // this example is just showing the usage of "ContainerAppsDiagnostics_GetDetector" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/tests/Generated/Samples/Sample_ContainerAppJobCollection.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/tests/Generated/Samples/Sample_ContainerAppJobCollection.cs index d6a6141152e9..c41ef2051bf5 100644 --- a/sdk/containerapps/Azure.ResourceManager.AppContainers/tests/Generated/Samples/Sample_ContainerAppJobCollection.cs +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/tests/Generated/Samples/Sample_ContainerAppJobCollection.cs @@ -22,7 +22,7 @@ public partial class Sample_ContainerAppJobCollection [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_CreateOrUpdateContainerAppsJob() { - // Generated from example definition: specification/app/resource-manager/Microsoft.App/stable/2025-01-01/examples/Job_CreateorUpdate.json + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/Job_CreateorUpdate.json // this example is just showing the usage of "Jobs_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -41,7 +41,7 @@ public async Task CreateOrUpdate_CreateOrUpdateContainerAppsJob() ContainerAppJobCollection collection = resourceGroupResource.GetContainerAppJobs(); // invoke the operation - string jobName = "testcontainerappsjob0"; + string jobName = "testcontainerAppsJob0"; ContainerAppJobData data = new ContainerAppJobData(new AzureLocation("East US")) { Identity = new ManagedServiceIdentity("SystemAssigned,UserAssigned") @@ -72,14 +72,15 @@ public async Task CreateOrUpdate_CreateOrUpdateContainerAppsJob() { InitContainers = {new ContainerAppInitContainer { -Image = "repo/testcontainerappsjob0:v4", +Image = "repo/testcontainerAppsJob0:v4", Name = "testinitcontainerAppsJob0", Command = {"/bin/sh"}, Args = {"-c", "while true; do echo hello; sleep 10;done"}, Resources = new AppContainerResources { -Cpu = 0.5, -Memory = "1Gi", +Cpu = 0.2, +Memory = "100Mi", +Gpu = 1, }, }}, Containers = {new ContainerAppContainer @@ -95,8 +96,8 @@ public async Task CreateOrUpdate_CreateOrUpdateContainerAppsJob() PeriodSeconds = 3, ProbeType = ContainerAppProbeType.Liveness, }}, -Image = "repo/testcontainerappsjob0:v1", -Name = "testcontainerappsjob0", +Image = "repo/testcontainerAppsJob0:v1", +Name = "testcontainerAppsJob0", VolumeMounts = {new ContainerAppVolumeMount { VolumeName = "azurefile", @@ -109,16 +110,88 @@ public async Task CreateOrUpdate_CreateOrUpdateContainerAppsJob() SubPath = "subPath2", }}, }}, - Volumes = {new ContainerAppVolume + }, + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, jobName, data); + ContainerAppJobResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + ContainerAppJobData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task CreateOrUpdate_CreateOrUpdateContainerAppsJobOnAConnectedEnvironment() + { + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/Job_CreateorUpdate_ConnectedEnvironment.json + // this example is just showing the usage of "Jobs_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; + string resourceGroupName = "rg"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this ContainerAppJobResource + ContainerAppJobCollection collection = resourceGroupResource.GetContainerAppJobs(); + + // invoke the operation + string jobName = "testcontainerAppsJob0"; + ContainerAppJobData data = new ContainerAppJobData(new AzureLocation("East US")) + { + ExtendedLocation = new ContainerAppExtendedLocation + { + Name = "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.ExtendedLocation/customLocations/testcustomlocation", + ExtendedLocationType = ContainerAppExtendedLocationType.CustomLocation, + }, + EnvironmentId = "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/connectedEnvironments/demokube", + Configuration = new ContainerAppJobConfiguration(ContainerAppJobTriggerType.Manual, 10) + { + ReplicaRetryLimit = 10, + ManualTriggerConfig = new JobConfigurationManualTriggerConfig + { + ReplicaCompletionCount = 1, + Parallelism = 4, + }, + }, + Template = new ContainerAppJobTemplate + { + InitContainers = {new ContainerAppInitContainer +{ +Image = "repo/testcontainerAppsJob0:v4", +Name = "testinitcontainerAppsJob0", +Command = {"/bin/sh"}, +Args = {"-c", "while true; do echo hello; sleep 10;done"}, +Resources = new AppContainerResources { -Name = "azurefile", -StorageType = ContainerAppStorageType.AzureFile, -StorageName = "storage", -}, new ContainerAppVolume +Cpu = 0.2, +Memory = "100Mi", +}, +}}, + Containers = {new ContainerAppContainer +{ +Probes = {new ContainerAppProbe { -Name = "nfsazurefile", -StorageType = ContainerAppStorageType.NfsAzureFile, -StorageName = "nfsStorage", +HttpGet = new ContainerAppHttpRequestInfo(8080) +{ +HttpHeaders = {new ContainerAppHttpHeaderInfo("Custom-Header", "Awesome")}, +Path = "/health", +}, +InitialDelaySeconds = 5, +PeriodSeconds = 3, +ProbeType = ContainerAppProbeType.Liveness, +}}, +Image = "repo/testcontainerAppsJob0:v1", +Name = "testcontainerAppsJob0", }}, }, }; @@ -136,7 +209,7 @@ public async Task CreateOrUpdate_CreateOrUpdateContainerAppsJob() [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_CreateOrUpdateContainerAppsJobWithEventDrivenTrigger() { - // Generated from example definition: specification/app/resource-manager/Microsoft.App/stable/2025-01-01/examples/Job_CreateorUpdate_EventTrigger.json + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/Job_CreateorUpdate_EventTrigger.json // this example is just showing the usage of "Jobs_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -155,7 +228,7 @@ public async Task CreateOrUpdate_CreateOrUpdateContainerAppsJobWithEventDrivenTr ContainerAppJobCollection collection = resourceGroupResource.GetContainerAppJobs(); // invoke the operation - string jobName = "testcontainerappsjob0"; + string jobName = "testcontainerAppsJob0"; ContainerAppJobData data = new ContainerAppJobData(new AzureLocation("East US")) { Identity = new ManagedServiceIdentity("UserAssigned") @@ -195,20 +268,20 @@ public async Task CreateOrUpdate_CreateOrUpdateContainerAppsJobWithEventDrivenTr { InitContainers = {new ContainerAppInitContainer { -Image = "repo/testcontainerappsjob0:v4", +Image = "repo/testcontainerAppsJob0:v4", Name = "testinitcontainerAppsJob0", Command = {"/bin/sh"}, Args = {"-c", "while true; do echo hello; sleep 10;done"}, Resources = new AppContainerResources { -Cpu = 0.5, -Memory = "1Gi", +Cpu = 0.2, +Memory = "100Mi", }, }}, Containers = {new ContainerAppContainer { -Image = "repo/testcontainerappsjob0:v1", -Name = "testcontainerappsjob0", +Image = "repo/testcontainerAppsJob0:v1", +Name = "testcontainerAppsJob0", }}, }, }; @@ -226,7 +299,7 @@ public async Task CreateOrUpdate_CreateOrUpdateContainerAppsJobWithEventDrivenTr [Ignore("Only validating compilation of examples")] public async Task Get_GetContainerAppsJob() { - // Generated from example definition: specification/app/resource-manager/Microsoft.App/stable/2025-01-01/examples/Job_Get.json + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/Job_Get.json // this example is just showing the usage of "Jobs_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -245,7 +318,7 @@ public async Task Get_GetContainerAppsJob() ContainerAppJobCollection collection = resourceGroupResource.GetContainerAppJobs(); // invoke the operation - string jobName = "testcontainerappsjob0"; + string jobName = "testcontainerAppsJob0"; ContainerAppJobResource result = await collection.GetAsync(jobName); // the variable result is a resource, you could call other operations on this instance as well @@ -259,7 +332,7 @@ public async Task Get_GetContainerAppsJob() [Ignore("Only validating compilation of examples")] public async Task GetAll_ListContainerAppsJobsByResourceGroup() { - // Generated from example definition: specification/app/resource-manager/Microsoft.App/stable/2025-01-01/examples/Jobs_ListByResourceGroup.json + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/Jobs_ListByResourceGroup.json // this example is just showing the usage of "Jobs_ListByResourceGroup" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -294,7 +367,7 @@ public async Task GetAll_ListContainerAppsJobsByResourceGroup() [Ignore("Only validating compilation of examples")] public async Task Exists_GetContainerAppsJob() { - // Generated from example definition: specification/app/resource-manager/Microsoft.App/stable/2025-01-01/examples/Job_Get.json + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/Job_Get.json // this example is just showing the usage of "Jobs_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -313,7 +386,7 @@ public async Task Exists_GetContainerAppsJob() ContainerAppJobCollection collection = resourceGroupResource.GetContainerAppJobs(); // invoke the operation - string jobName = "testcontainerappsjob0"; + string jobName = "testcontainerAppsJob0"; bool result = await collection.ExistsAsync(jobName); Console.WriteLine($"Succeeded: {result}"); @@ -323,7 +396,7 @@ public async Task Exists_GetContainerAppsJob() [Ignore("Only validating compilation of examples")] public async Task GetIfExists_GetContainerAppsJob() { - // Generated from example definition: specification/app/resource-manager/Microsoft.App/stable/2025-01-01/examples/Job_Get.json + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/Job_Get.json // this example is just showing the usage of "Jobs_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -342,7 +415,7 @@ public async Task GetIfExists_GetContainerAppsJob() ContainerAppJobCollection collection = resourceGroupResource.GetContainerAppJobs(); // invoke the operation - string jobName = "testcontainerappsjob0"; + string jobName = "testcontainerAppsJob0"; NullableResponse response = await collection.GetIfExistsAsync(jobName); ContainerAppJobResource result = response.HasValue ? response.Value : null; diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/tests/Generated/Samples/Sample_ContainerAppJobDetectorCollection.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/tests/Generated/Samples/Sample_ContainerAppJobDetectorCollection.cs index 75af7900e108..8cc8ceb022db 100644 --- a/sdk/containerapps/Azure.ResourceManager.AppContainers/tests/Generated/Samples/Sample_ContainerAppJobDetectorCollection.cs +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/tests/Generated/Samples/Sample_ContainerAppJobDetectorCollection.cs @@ -19,7 +19,7 @@ public partial class Sample_ContainerAppJobDetectorCollection [Ignore("Only validating compilation of examples")] public async Task Get_GetDiagnosticDataForAContainerAppJob() { - // Generated from example definition: specification/app/resource-manager/Microsoft.App/stable/2025-01-01/examples/Job_GetDetector.json + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/Job_GetDetector.json // this example is just showing the usage of "Jobs_GetDetector" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -53,7 +53,7 @@ public async Task Get_GetDiagnosticDataForAContainerAppJob() [Ignore("Only validating compilation of examples")] public async Task GetAll_GetTheListOfAvailableDiagnosticDataForAContainerAppJob() { - // Generated from example definition: specification/app/resource-manager/Microsoft.App/stable/2025-01-01/examples/Job_ListDetectors.json + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/Job_ListDetectors.json // this example is just showing the usage of "Jobs_ListDetectors" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -89,7 +89,7 @@ public async Task GetAll_GetTheListOfAvailableDiagnosticDataForAContainerAppJob( [Ignore("Only validating compilation of examples")] public async Task Exists_GetDiagnosticDataForAContainerAppJob() { - // Generated from example definition: specification/app/resource-manager/Microsoft.App/stable/2025-01-01/examples/Job_GetDetector.json + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/Job_GetDetector.json // this example is just showing the usage of "Jobs_GetDetector" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -119,7 +119,7 @@ public async Task Exists_GetDiagnosticDataForAContainerAppJob() [Ignore("Only validating compilation of examples")] public async Task GetIfExists_GetDiagnosticDataForAContainerAppJob() { - // Generated from example definition: specification/app/resource-manager/Microsoft.App/stable/2025-01-01/examples/Job_GetDetector.json + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/Job_GetDetector.json // this example is just showing the usage of "Jobs_GetDetector" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/tests/Generated/Samples/Sample_ContainerAppJobDetectorPropertyCollection.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/tests/Generated/Samples/Sample_ContainerAppJobDetectorPropertyCollection.cs index 25b4e80c4599..0bc9c78033e7 100644 --- a/sdk/containerapps/Azure.ResourceManager.AppContainers/tests/Generated/Samples/Sample_ContainerAppJobDetectorPropertyCollection.cs +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/tests/Generated/Samples/Sample_ContainerAppJobDetectorPropertyCollection.cs @@ -19,7 +19,7 @@ public partial class Sample_ContainerAppJobDetectorPropertyCollection [Ignore("Only validating compilation of examples")] public async Task Get_GetContainerAppJobByName() { - // Generated from example definition: specification/app/resource-manager/Microsoft.App/stable/2025-01-01/examples/Job_ProxyGet.json + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/Job_ProxyGet.json // this example is just showing the usage of "Jobs_ProxyGet" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -31,7 +31,7 @@ public async Task Get_GetContainerAppJobByName() // for more information of creating ContainerAppJobResource, please refer to the document of ContainerAppJobResource string subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; string resourceGroupName = "rg"; - string jobName = "testcontainerappsjob0"; + string jobName = "testcontainerAppsJob0"; ResourceIdentifier containerAppJobResourceId = ContainerAppJobResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, jobName); ContainerAppJobResource containerAppJob = client.GetContainerAppJobResource(containerAppJobResourceId); @@ -53,7 +53,7 @@ public async Task Get_GetContainerAppJobByName() [Ignore("Only validating compilation of examples")] public async Task Exists_GetContainerAppJobByName() { - // Generated from example definition: specification/app/resource-manager/Microsoft.App/stable/2025-01-01/examples/Job_ProxyGet.json + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/Job_ProxyGet.json // this example is just showing the usage of "Jobs_ProxyGet" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -65,7 +65,7 @@ public async Task Exists_GetContainerAppJobByName() // for more information of creating ContainerAppJobResource, please refer to the document of ContainerAppJobResource string subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; string resourceGroupName = "rg"; - string jobName = "testcontainerappsjob0"; + string jobName = "testcontainerAppsJob0"; ResourceIdentifier containerAppJobResourceId = ContainerAppJobResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, jobName); ContainerAppJobResource containerAppJob = client.GetContainerAppJobResource(containerAppJobResourceId); @@ -83,7 +83,7 @@ public async Task Exists_GetContainerAppJobByName() [Ignore("Only validating compilation of examples")] public async Task GetIfExists_GetContainerAppJobByName() { - // Generated from example definition: specification/app/resource-manager/Microsoft.App/stable/2025-01-01/examples/Job_ProxyGet.json + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/Job_ProxyGet.json // this example is just showing the usage of "Jobs_ProxyGet" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -95,7 +95,7 @@ public async Task GetIfExists_GetContainerAppJobByName() // for more information of creating ContainerAppJobResource, please refer to the document of ContainerAppJobResource string subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; string resourceGroupName = "rg"; - string jobName = "testcontainerappsjob0"; + string jobName = "testcontainerAppsJob0"; ResourceIdentifier containerAppJobResourceId = ContainerAppJobResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, jobName); ContainerAppJobResource containerAppJob = client.GetContainerAppJobResource(containerAppJobResourceId); diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/tests/Generated/Samples/Sample_ContainerAppJobDetectorPropertyResource.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/tests/Generated/Samples/Sample_ContainerAppJobDetectorPropertyResource.cs index 1b213d32dcd3..b5edcb85ba19 100644 --- a/sdk/containerapps/Azure.ResourceManager.AppContainers/tests/Generated/Samples/Sample_ContainerAppJobDetectorPropertyResource.cs +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/tests/Generated/Samples/Sample_ContainerAppJobDetectorPropertyResource.cs @@ -19,7 +19,7 @@ public partial class Sample_ContainerAppJobDetectorPropertyResource [Ignore("Only validating compilation of examples")] public async Task Get_GetContainerAppJobByName() { - // Generated from example definition: specification/app/resource-manager/Microsoft.App/stable/2025-01-01/examples/Job_ProxyGet.json + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/Job_ProxyGet.json // this example is just showing the usage of "Jobs_ProxyGet" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -31,7 +31,7 @@ public async Task Get_GetContainerAppJobByName() // for more information of creating ContainerAppJobDetectorPropertyResource, please refer to the document of ContainerAppJobDetectorPropertyResource string subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; string resourceGroupName = "rg"; - string jobName = "testcontainerappsjob0"; + string jobName = "testcontainerAppsJob0"; string apiName = "rootApi"; ResourceIdentifier containerAppJobDetectorPropertyResourceId = ContainerAppJobDetectorPropertyResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, jobName, apiName); ContainerAppJobDetectorPropertyResource containerAppJobDetectorProperty = client.GetContainerAppJobDetectorPropertyResource(containerAppJobDetectorPropertyResourceId); diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/tests/Generated/Samples/Sample_ContainerAppJobDetectorResource.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/tests/Generated/Samples/Sample_ContainerAppJobDetectorResource.cs index 9e7aba9106f1..ad995e6ad69a 100644 --- a/sdk/containerapps/Azure.ResourceManager.AppContainers/tests/Generated/Samples/Sample_ContainerAppJobDetectorResource.cs +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/tests/Generated/Samples/Sample_ContainerAppJobDetectorResource.cs @@ -19,7 +19,7 @@ public partial class Sample_ContainerAppJobDetectorResource [Ignore("Only validating compilation of examples")] public async Task Get_GetDiagnosticDataForAContainerAppJob() { - // Generated from example definition: specification/app/resource-manager/Microsoft.App/stable/2025-01-01/examples/Job_GetDetector.json + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/Job_GetDetector.json // this example is just showing the usage of "Jobs_GetDetector" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/tests/Generated/Samples/Sample_ContainerAppJobExecutionCollection.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/tests/Generated/Samples/Sample_ContainerAppJobExecutionCollection.cs index 1bafe112d9d3..74f8e7899525 100644 --- a/sdk/containerapps/Azure.ResourceManager.AppContainers/tests/Generated/Samples/Sample_ContainerAppJobExecutionCollection.cs +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/tests/Generated/Samples/Sample_ContainerAppJobExecutionCollection.cs @@ -19,7 +19,7 @@ public partial class Sample_ContainerAppJobExecutionCollection [Ignore("Only validating compilation of examples")] public async Task Get_GetASingleJobExecution() { - // Generated from example definition: specification/app/resource-manager/Microsoft.App/stable/2025-01-01/examples/Job_Execution_Get.json + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/Job_Execution_Get.json // this example is just showing the usage of "JobExecution" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -31,7 +31,7 @@ public async Task Get_GetASingleJobExecution() // for more information of creating ContainerAppJobResource, please refer to the document of ContainerAppJobResource string subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; string resourceGroupName = "rg"; - string jobName = "testcontainerappsjob0"; + string jobName = "testcontainerAppsJob0"; ResourceIdentifier containerAppJobResourceId = ContainerAppJobResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, jobName); ContainerAppJobResource containerAppJob = client.GetContainerAppJobResource(containerAppJobResourceId); @@ -53,7 +53,7 @@ public async Task Get_GetASingleJobExecution() [Ignore("Only validating compilation of examples")] public async Task GetAll_GetAContainerAppsJobExecutions() { - // Generated from example definition: specification/app/resource-manager/Microsoft.App/stable/2025-01-01/examples/Job_Executions_Get.json + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/Job_Executions_Get.json // this example is just showing the usage of "JobsExecutions_List" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -65,7 +65,7 @@ public async Task GetAll_GetAContainerAppsJobExecutions() // for more information of creating ContainerAppJobResource, please refer to the document of ContainerAppJobResource string subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; string resourceGroupName = "rg"; - string jobName = "testcontainerappsjob0"; + string jobName = "testcontainerAppsJob0"; ResourceIdentifier containerAppJobResourceId = ContainerAppJobResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, jobName); ContainerAppJobResource containerAppJob = client.GetContainerAppJobResource(containerAppJobResourceId); @@ -89,7 +89,7 @@ public async Task GetAll_GetAContainerAppsJobExecutions() [Ignore("Only validating compilation of examples")] public async Task Exists_GetASingleJobExecution() { - // Generated from example definition: specification/app/resource-manager/Microsoft.App/stable/2025-01-01/examples/Job_Execution_Get.json + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/Job_Execution_Get.json // this example is just showing the usage of "JobExecution" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -101,7 +101,7 @@ public async Task Exists_GetASingleJobExecution() // for more information of creating ContainerAppJobResource, please refer to the document of ContainerAppJobResource string subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; string resourceGroupName = "rg"; - string jobName = "testcontainerappsjob0"; + string jobName = "testcontainerAppsJob0"; ResourceIdentifier containerAppJobResourceId = ContainerAppJobResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, jobName); ContainerAppJobResource containerAppJob = client.GetContainerAppJobResource(containerAppJobResourceId); @@ -119,7 +119,7 @@ public async Task Exists_GetASingleJobExecution() [Ignore("Only validating compilation of examples")] public async Task GetIfExists_GetASingleJobExecution() { - // Generated from example definition: specification/app/resource-manager/Microsoft.App/stable/2025-01-01/examples/Job_Execution_Get.json + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/Job_Execution_Get.json // this example is just showing the usage of "JobExecution" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -131,7 +131,7 @@ public async Task GetIfExists_GetASingleJobExecution() // for more information of creating ContainerAppJobResource, please refer to the document of ContainerAppJobResource string subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; string resourceGroupName = "rg"; - string jobName = "testcontainerappsjob0"; + string jobName = "testcontainerAppsJob0"; ResourceIdentifier containerAppJobResourceId = ContainerAppJobResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, jobName); ContainerAppJobResource containerAppJob = client.GetContainerAppJobResource(containerAppJobResourceId); diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/tests/Generated/Samples/Sample_ContainerAppJobExecutionResource.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/tests/Generated/Samples/Sample_ContainerAppJobExecutionResource.cs index c81ac871b37c..b47f46ffed50 100644 --- a/sdk/containerapps/Azure.ResourceManager.AppContainers/tests/Generated/Samples/Sample_ContainerAppJobExecutionResource.cs +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/tests/Generated/Samples/Sample_ContainerAppJobExecutionResource.cs @@ -19,7 +19,7 @@ public partial class Sample_ContainerAppJobExecutionResource [Ignore("Only validating compilation of examples")] public async Task Get_GetASingleJobExecution() { - // Generated from example definition: specification/app/resource-manager/Microsoft.App/stable/2025-01-01/examples/Job_Execution_Get.json + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/Job_Execution_Get.json // this example is just showing the usage of "JobExecution" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -31,7 +31,7 @@ public async Task Get_GetASingleJobExecution() // for more information of creating ContainerAppJobExecutionResource, please refer to the document of ContainerAppJobExecutionResource string subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; string resourceGroupName = "rg"; - string jobName = "testcontainerappsjob0"; + string jobName = "testcontainerAppsJob0"; string jobExecutionName = "jobExecution1"; ResourceIdentifier containerAppJobExecutionResourceId = ContainerAppJobExecutionResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, jobName, jobExecutionName); ContainerAppJobExecutionResource containerAppJobExecution = client.GetContainerAppJobExecutionResource(containerAppJobExecutionResourceId); @@ -50,7 +50,7 @@ public async Task Get_GetASingleJobExecution() [Ignore("Only validating compilation of examples")] public async Task StopExecutionJob_TerminateAContainerAppsJob() { - // Generated from example definition: specification/app/resource-manager/Microsoft.App/stable/2025-01-01/examples/Job_Stop_Execution.json + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/Job_Stop_Execution.json // this example is just showing the usage of "Jobs_StopExecution" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -62,7 +62,7 @@ public async Task StopExecutionJob_TerminateAContainerAppsJob() // for more information of creating ContainerAppJobExecutionResource, please refer to the document of ContainerAppJobExecutionResource string subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; string resourceGroupName = "rg"; - string jobName = "testcontainerappsjob0"; + string jobName = "testcontainerAppsJob0"; string jobExecutionName = "jobExecution1"; ResourceIdentifier containerAppJobExecutionResourceId = ContainerAppJobExecutionResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, jobName, jobExecutionName); ContainerAppJobExecutionResource containerAppJobExecution = client.GetContainerAppJobExecutionResource(containerAppJobExecutionResourceId); diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/tests/Generated/Samples/Sample_ContainerAppJobResource.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/tests/Generated/Samples/Sample_ContainerAppJobResource.cs index ed670bf7d94c..8e3417e04aff 100644 --- a/sdk/containerapps/Azure.ResourceManager.AppContainers/tests/Generated/Samples/Sample_ContainerAppJobResource.cs +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/tests/Generated/Samples/Sample_ContainerAppJobResource.cs @@ -20,7 +20,7 @@ public partial class Sample_ContainerAppJobResource [Ignore("Only validating compilation of examples")] public async Task Get_GetContainerAppsJob() { - // Generated from example definition: specification/app/resource-manager/Microsoft.App/stable/2025-01-01/examples/Job_Get.json + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/Job_Get.json // this example is just showing the usage of "Jobs_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -32,7 +32,7 @@ public async Task Get_GetContainerAppsJob() // for more information of creating ContainerAppJobResource, please refer to the document of ContainerAppJobResource string subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; string resourceGroupName = "rg"; - string jobName = "testcontainerappsjob0"; + string jobName = "testcontainerAppsJob0"; ResourceIdentifier containerAppJobResourceId = ContainerAppJobResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, jobName); ContainerAppJobResource containerAppJob = client.GetContainerAppJobResource(containerAppJobResourceId); @@ -50,7 +50,7 @@ public async Task Get_GetContainerAppsJob() [Ignore("Only validating compilation of examples")] public async Task Delete_DeleteContainerAppsJob() { - // Generated from example definition: specification/app/resource-manager/Microsoft.App/stable/2025-01-01/examples/Job_Delete.json + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/Job_Delete.json // this example is just showing the usage of "Jobs_Delete" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -62,7 +62,7 @@ public async Task Delete_DeleteContainerAppsJob() // for more information of creating ContainerAppJobResource, please refer to the document of ContainerAppJobResource string subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; string resourceGroupName = "rg"; - string jobName = "testworkercontainerappsjob0"; + string jobName = "testWorkerContainerAppsJob0"; ResourceIdentifier containerAppJobResourceId = ContainerAppJobResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, jobName); ContainerAppJobResource containerAppJob = client.GetContainerAppJobResource(containerAppJobResourceId); @@ -76,7 +76,7 @@ public async Task Delete_DeleteContainerAppsJob() [Ignore("Only validating compilation of examples")] public async Task Update_PatchContainerAppsJob() { - // Generated from example definition: specification/app/resource-manager/Microsoft.App/stable/2025-01-01/examples/Job_Patch.json + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/Job_Patch.json // this example is just showing the usage of "Jobs_Update" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -88,7 +88,7 @@ public async Task Update_PatchContainerAppsJob() // for more information of creating ContainerAppJobResource, please refer to the document of ContainerAppJobResource string subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; string resourceGroupName = "rg"; - string jobName = "testcontainerappsjob0"; + string jobName = "testcontainerAppsJob0"; ResourceIdentifier containerAppJobResourceId = ContainerAppJobResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, jobName); ContainerAppJobResource containerAppJob = client.GetContainerAppJobResource(containerAppJobResourceId); @@ -110,14 +110,14 @@ public async Task Update_PatchContainerAppsJob() { InitContainers = {new ContainerAppInitContainer { -Image = "repo/testcontainerappsjob0:v4", +Image = "repo/testcontainerAppsJob0:v4", Name = "testinitcontainerAppsJob0", Command = {"/bin/sh"}, Args = {"-c", "while true; do echo hello; sleep 10;done"}, Resources = new AppContainerResources { -Cpu = 0.5, -Memory = "1Gi", +Cpu = 0.2, +Memory = "100Mi", }, }}, Containers = {new ContainerAppContainer @@ -133,8 +133,8 @@ public async Task Update_PatchContainerAppsJob() PeriodSeconds = 3, ProbeType = ContainerAppProbeType.Liveness, }}, -Image = "repo/testcontainerappsjob0:v1", -Name = "testcontainerappsjob0", +Image = "repo/testcontainerAppsJob0:v1", +Name = "testcontainerAppsJob0", }}, }, }, @@ -153,7 +153,7 @@ public async Task Update_PatchContainerAppsJob() [Ignore("Only validating compilation of examples")] public async Task Start_RunAContainerAppsJob() { - // Generated from example definition: specification/app/resource-manager/Microsoft.App/stable/2025-01-01/examples/Job_Start.json + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/Job_Start.json // this example is just showing the usage of "Jobs_Start" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -165,7 +165,7 @@ public async Task Start_RunAContainerAppsJob() // for more information of creating ContainerAppJobResource, please refer to the document of ContainerAppJobResource string subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; string resourceGroupName = "rg"; - string jobName = "testcontainerappsjob0"; + string jobName = "testcontainerAppsJob0"; ResourceIdentifier containerAppJobResourceId = ContainerAppJobResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, jobName); ContainerAppJobResource containerAppJob = client.GetContainerAppJobResource(containerAppJobResourceId); @@ -174,24 +174,24 @@ public async Task Start_RunAContainerAppsJob() { Containers = {new JobExecutionContainer { -Image = "repo/testcontainerappsjob0:v4", -Name = "testcontainerappsjob0", +Image = "repo/testcontainerAppsJob0:v4", +Name = "testcontainerAppsJob0", Resources = new AppContainerResources { -Cpu = 0.5, -Memory = "1Gi", +Cpu = 0.2, +Memory = "100Mi", }, }}, InitContainers = {new JobExecutionContainer { -Image = "repo/testcontainerappsjob0:v4", +Image = "repo/testcontainerAppsJob0:v4", Name = "testinitcontainerAppsJob0", Command = {"/bin/sh"}, Args = {"-c", "while true; do echo hello; sleep 10;done"}, Resources = new AppContainerResources { -Cpu = 0.5, -Memory = "1Gi", +Cpu = 0.2, +Memory = "100Mi", }, }}, }; @@ -205,7 +205,7 @@ public async Task Start_RunAContainerAppsJob() [Ignore("Only validating compilation of examples")] public async Task StopMultipleExecutions_TerminateMultipleContainerAppsJob() { - // Generated from example definition: specification/app/resource-manager/Microsoft.App/stable/2025-01-01/examples/Job_Stop_Multiple.json + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/Job_Stop_Multiple.json // this example is just showing the usage of "Jobs_StopMultipleExecutions" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -217,7 +217,7 @@ public async Task StopMultipleExecutions_TerminateMultipleContainerAppsJob() // for more information of creating ContainerAppJobResource, please refer to the document of ContainerAppJobResource string subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; string resourceGroupName = "rg"; - string jobName = "testcontainerappsjob0"; + string jobName = "testcontainerAppsJob0"; ResourceIdentifier containerAppJobResourceId = ContainerAppJobResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, jobName); ContainerAppJobResource containerAppJob = client.GetContainerAppJobResource(containerAppJobResourceId); @@ -232,7 +232,7 @@ public async Task StopMultipleExecutions_TerminateMultipleContainerAppsJob() [Ignore("Only validating compilation of examples")] public async Task GetSecrets_ListContainerAppsJobSecrets() { - // Generated from example definition: specification/app/resource-manager/Microsoft.App/stable/2025-01-01/examples/Job_ListSecrets.json + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/Job_ListSecrets.json // this example is just showing the usage of "Jobs_ListSecrets" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -244,7 +244,7 @@ public async Task GetSecrets_ListContainerAppsJobSecrets() // for more information of creating ContainerAppJobResource, please refer to the document of ContainerAppJobResource string subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; string resourceGroupName = "rg"; - string jobName = "testcontainerappsjob0"; + string jobName = "testcontainerAppsJob0"; ResourceIdentifier containerAppJobResourceId = ContainerAppJobResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, jobName); ContainerAppJobResource containerAppJob = client.GetContainerAppJobResource(containerAppJobResourceId); @@ -256,5 +256,67 @@ public async Task GetSecrets_ListContainerAppsJobSecrets() Console.WriteLine("Succeeded"); } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Resume_ResumeJob() + { + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/Jobs_Resume.json + // this example is just showing the usage of "Jobs_Resume" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ContainerAppJobResource created on azure + // for more information of creating ContainerAppJobResource, please refer to the document of ContainerAppJobResource + string subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; + string resourceGroupName = "rg"; + string jobName = "testcontainerAppsJob0"; + ResourceIdentifier containerAppJobResourceId = ContainerAppJobResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, jobName); + ContainerAppJobResource containerAppJob = client.GetContainerAppJobResource(containerAppJobResourceId); + + // invoke the operation + ArmOperation lro = await containerAppJob.ResumeAsync(WaitUntil.Completed); + ContainerAppJobResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + ContainerAppJobData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Suspend_SuspendJob() + { + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/Jobs_Suspend.json + // this example is just showing the usage of "Jobs_Suspend" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ContainerAppJobResource created on azure + // for more information of creating ContainerAppJobResource, please refer to the document of ContainerAppJobResource + string subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; + string resourceGroupName = "rg"; + string jobName = "testcontainerAppsJob0"; + ResourceIdentifier containerAppJobResourceId = ContainerAppJobResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, jobName); + ContainerAppJobResource containerAppJob = client.GetContainerAppJobResource(containerAppJobResourceId); + + // invoke the operation + ArmOperation lro = await containerAppJob.SuspendAsync(WaitUntil.Completed); + ContainerAppJobResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + ContainerAppJobData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } } } diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/tests/Generated/Samples/Sample_ContainerAppManagedCertificateCollection.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/tests/Generated/Samples/Sample_ContainerAppManagedCertificateCollection.cs index 0dc4ffd2a0d2..2d82e8555732 100644 --- a/sdk/containerapps/Azure.ResourceManager.AppContainers/tests/Generated/Samples/Sample_ContainerAppManagedCertificateCollection.cs +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/tests/Generated/Samples/Sample_ContainerAppManagedCertificateCollection.cs @@ -20,7 +20,7 @@ public partial class Sample_ContainerAppManagedCertificateCollection [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_CreateOrUpdateCertificate() { - // Generated from example definition: specification/app/resource-manager/Microsoft.App/stable/2025-01-01/examples/ManagedCertificate_CreateOrUpdate.json + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/ManagedCertificate_CreateOrUpdate.json // this example is just showing the usage of "ManagedCertificates_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -63,7 +63,7 @@ public async Task CreateOrUpdate_CreateOrUpdateCertificate() [Ignore("Only validating compilation of examples")] public async Task Get_GetCertificate() { - // Generated from example definition: specification/app/resource-manager/Microsoft.App/stable/2025-01-01/examples/ManagedCertificate_Get.json + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/ManagedCertificate_Get.json // this example is just showing the usage of "ManagedCertificates_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -97,7 +97,7 @@ public async Task Get_GetCertificate() [Ignore("Only validating compilation of examples")] public async Task GetAll_ListManagedCertificatesByManagedEnvironment() { - // Generated from example definition: specification/app/resource-manager/Microsoft.App/stable/2025-01-01/examples/ManagedCertificates_ListByManagedEnvironment.json + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/ManagedCertificates_ListByManagedEnvironment.json // this example is just showing the usage of "ManagedCertificates_List" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -133,7 +133,7 @@ public async Task GetAll_ListManagedCertificatesByManagedEnvironment() [Ignore("Only validating compilation of examples")] public async Task Exists_GetCertificate() { - // Generated from example definition: specification/app/resource-manager/Microsoft.App/stable/2025-01-01/examples/ManagedCertificate_Get.json + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/ManagedCertificate_Get.json // this example is just showing the usage of "ManagedCertificates_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -163,7 +163,7 @@ public async Task Exists_GetCertificate() [Ignore("Only validating compilation of examples")] public async Task GetIfExists_GetCertificate() { - // Generated from example definition: specification/app/resource-manager/Microsoft.App/stable/2025-01-01/examples/ManagedCertificate_Get.json + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/ManagedCertificate_Get.json // this example is just showing the usage of "ManagedCertificates_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/tests/Generated/Samples/Sample_ContainerAppManagedCertificateResource.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/tests/Generated/Samples/Sample_ContainerAppManagedCertificateResource.cs index 9551a0d5c6be..1c48cf068e8f 100644 --- a/sdk/containerapps/Azure.ResourceManager.AppContainers/tests/Generated/Samples/Sample_ContainerAppManagedCertificateResource.cs +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/tests/Generated/Samples/Sample_ContainerAppManagedCertificateResource.cs @@ -20,7 +20,7 @@ public partial class Sample_ContainerAppManagedCertificateResource [Ignore("Only validating compilation of examples")] public async Task Get_GetCertificate() { - // Generated from example definition: specification/app/resource-manager/Microsoft.App/stable/2025-01-01/examples/ManagedCertificate_Get.json + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/ManagedCertificate_Get.json // this example is just showing the usage of "ManagedCertificates_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -51,7 +51,7 @@ public async Task Get_GetCertificate() [Ignore("Only validating compilation of examples")] public async Task Delete_DeleteCertificate() { - // Generated from example definition: specification/app/resource-manager/Microsoft.App/stable/2025-01-01/examples/ManagedCertificate_Delete.json + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/ManagedCertificate_Delete.json // this example is just showing the usage of "ManagedCertificates_Delete" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -78,7 +78,7 @@ public async Task Delete_DeleteCertificate() [Ignore("Only validating compilation of examples")] public async Task Update_PatchManagedCertificate() { - // Generated from example definition: specification/app/resource-manager/Microsoft.App/stable/2025-01-01/examples/ManagedCertificates_Patch.json + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/ManagedCertificates_Patch.json // this example is just showing the usage of "ManagedCertificates_Update" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/tests/Generated/Samples/Sample_ContainerAppManagedEnvironmentCertificateCollection.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/tests/Generated/Samples/Sample_ContainerAppManagedEnvironmentCertificateCollection.cs index fba8b49add35..c3bdc0b5eb97 100644 --- a/sdk/containerapps/Azure.ResourceManager.AppContainers/tests/Generated/Samples/Sample_ContainerAppManagedEnvironmentCertificateCollection.cs +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/tests/Generated/Samples/Sample_ContainerAppManagedEnvironmentCertificateCollection.cs @@ -21,7 +21,7 @@ public partial class Sample_ContainerAppManagedEnvironmentCertificateCollection [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_CreateOrUpdateCertificate() { - // Generated from example definition: specification/app/resource-manager/Microsoft.App/stable/2025-01-01/examples/Certificate_CreateOrUpdate.json + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/Certificate_CreateOrUpdate.json // this example is just showing the usage of "Certificates_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -48,6 +48,7 @@ public async Task CreateOrUpdate_CreateOrUpdateCertificate() { Password = "private key password", Value = Encoding.UTF8.GetBytes("Y2VydA=="), + CertificateType = ContainerAppCertificateType.ImagePullTrustedCA, }, }; ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, certificateName, data); @@ -64,7 +65,7 @@ public async Task CreateOrUpdate_CreateOrUpdateCertificate() [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_CreateOrUpdateCertificateUsingManagedIdentity() { - // Generated from example definition: specification/app/resource-manager/Microsoft.App/stable/2025-01-01/examples/Certificate_CreateOrUpdate_FromKeyVault.json + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/Certificate_CreateOrUpdate_FromKeyVault.json // this example is just showing the usage of "Certificates_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -94,6 +95,7 @@ public async Task CreateOrUpdate_CreateOrUpdateCertificateUsingManagedIdentity() Identity = "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/test-rg/providers/microsoft.managedidentity/userassignedidentities/test-user-mi", KeyVaultUri = new Uri("https://xxxxxxxx.vault.azure.net/certificates/certName"), }, + CertificateType = ContainerAppCertificateType.ServerSSLCertificate, }, }; ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, certificateName, data); @@ -110,7 +112,7 @@ public async Task CreateOrUpdate_CreateOrUpdateCertificateUsingManagedIdentity() [Ignore("Only validating compilation of examples")] public async Task Get_GetCertificate() { - // Generated from example definition: specification/app/resource-manager/Microsoft.App/stable/2025-01-01/examples/Certificate_Get.json + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/Certificate_Get.json // this example is just showing the usage of "Certificates_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -144,7 +146,7 @@ public async Task Get_GetCertificate() [Ignore("Only validating compilation of examples")] public async Task GetAll_ListCertificatesByManagedEnvironment() { - // Generated from example definition: specification/app/resource-manager/Microsoft.App/stable/2025-01-01/examples/Certificates_ListByManagedEnvironment.json + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/Certificates_ListByManagedEnvironment.json // this example is just showing the usage of "Certificates_List" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -180,7 +182,7 @@ public async Task GetAll_ListCertificatesByManagedEnvironment() [Ignore("Only validating compilation of examples")] public async Task Exists_GetCertificate() { - // Generated from example definition: specification/app/resource-manager/Microsoft.App/stable/2025-01-01/examples/Certificate_Get.json + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/Certificate_Get.json // this example is just showing the usage of "Certificates_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -210,7 +212,7 @@ public async Task Exists_GetCertificate() [Ignore("Only validating compilation of examples")] public async Task GetIfExists_GetCertificate() { - // Generated from example definition: specification/app/resource-manager/Microsoft.App/stable/2025-01-01/examples/Certificate_Get.json + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/Certificate_Get.json // this example is just showing the usage of "Certificates_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/tests/Generated/Samples/Sample_ContainerAppManagedEnvironmentCertificateResource.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/tests/Generated/Samples/Sample_ContainerAppManagedEnvironmentCertificateResource.cs index 019d7d7f2915..b897b9381d9d 100644 --- a/sdk/containerapps/Azure.ResourceManager.AppContainers/tests/Generated/Samples/Sample_ContainerAppManagedEnvironmentCertificateResource.cs +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/tests/Generated/Samples/Sample_ContainerAppManagedEnvironmentCertificateResource.cs @@ -20,7 +20,7 @@ public partial class Sample_ContainerAppManagedEnvironmentCertificateResource [Ignore("Only validating compilation of examples")] public async Task Get_GetCertificate() { - // Generated from example definition: specification/app/resource-manager/Microsoft.App/stable/2025-01-01/examples/Certificate_Get.json + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/Certificate_Get.json // this example is just showing the usage of "Certificates_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -51,7 +51,7 @@ public async Task Get_GetCertificate() [Ignore("Only validating compilation of examples")] public async Task Delete_DeleteCertificate() { - // Generated from example definition: specification/app/resource-manager/Microsoft.App/stable/2025-01-01/examples/Certificate_Delete.json + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/Certificate_Delete.json // this example is just showing the usage of "Certificates_Delete" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -78,7 +78,7 @@ public async Task Delete_DeleteCertificate() [Ignore("Only validating compilation of examples")] public async Task Update_PatchCertificate() { - // Generated from example definition: specification/app/resource-manager/Microsoft.App/stable/2025-01-01/examples/Certificates_Patch.json + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/Certificates_Patch.json // this example is just showing the usage of "Certificates_Update" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/tests/Generated/Samples/Sample_ContainerAppManagedEnvironmentCollection.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/tests/Generated/Samples/Sample_ContainerAppManagedEnvironmentCollection.cs index e84c9293b4dc..474af9cf9b6a 100644 --- a/sdk/containerapps/Azure.ResourceManager.AppContainers/tests/Generated/Samples/Sample_ContainerAppManagedEnvironmentCollection.cs +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/tests/Generated/Samples/Sample_ContainerAppManagedEnvironmentCollection.cs @@ -23,7 +23,7 @@ public partial class Sample_ContainerAppManagedEnvironmentCollection [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_CreateEnvironmentWithCustomInfrastructureResourceGroup() { - // Generated from example definition: specification/app/resource-manager/Microsoft.App/stable/2025-01-01/examples/ManagedEnvironments_CustomInfrastructureResourceGroup_Create.json + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/ManagedEnvironments_CustomInfrastructureResourceGroup_Create.json // this example is just showing the usage of "ManagedEnvironments_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -59,6 +59,7 @@ public async Task CreateOrUpdate_CreateEnvironmentWithCustomInfrastructureResour }, }, IsZoneRedundant = true, + AvailabilityZones = { "1", "2", "3" }, CustomDomainConfiguration = new ContainerAppCustomDomainConfiguration { DnsSuffix = "www.my-name.com", @@ -67,6 +68,7 @@ public async Task CreateOrUpdate_CreateEnvironmentWithCustomInfrastructureResour }, WorkloadProfiles = {new ContainerAppWorkloadProfile("My-GP-01", "GeneralPurpose") { +EnableFips = true, MinimumNodeCount = 3, MaximumNodeCount = 12, }, new ContainerAppWorkloadProfile("My-MO-01", "MemoryOptimized") @@ -94,7 +96,7 @@ public async Task CreateOrUpdate_CreateEnvironmentWithCustomInfrastructureResour [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_CreateEnvironments() { - // Generated from example definition: specification/app/resource-manager/Microsoft.App/stable/2025-01-01/examples/ManagedEnvironments_CreateOrUpdate.json + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/ManagedEnvironments_CreateOrUpdate.json // this example is just showing the usage of "ManagedEnvironments_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -134,9 +136,45 @@ public async Task CreateOrUpdate_CreateEnvironments() { CustomerId = "string", SharedKey = "string", + DynamicJsonColumns = true, + }, + }, + AppInsightsConnectionString = "InstrumentationKey=00000000-0000-0000-0000-000000000000;IngestionEndpoint=https://eastus-8.in.applicationinsights.azure.com/;LiveEndpoint=https://eastus.livediagnostics.monitor.azure.com/", + OpenTelemetryConfiguration = new OpenTelemetryConfiguration + { + DestinationsConfiguration = new DestinationsConfiguration + { + DataDogConfiguration = new DataDogConfiguration + { + Site = "string", + Key = "000000000000000000000000", + }, + OtlpConfigurations = {new OtlpConfiguration +{ +Name = "dashboard", +Endpoint = "dashboard.k8s.region.azurecontainerapps.io:80", +Insecure = true, +Headers = {new Header +{ +Key = "api-key", +Value = "xxxxxxxxxxx", +}}, +}}, + }, + TracesConfiguration = new TracesConfiguration + { + IncludeDapr = true, + Destinations = { "appInsights" }, + }, + LogsDestinations = { "appInsights" }, + MetricsConfiguration = new MetricsConfiguration + { + IncludeKeda = true, + Destinations = { "dataDog" }, }, }, IsZoneRedundant = true, + AvailabilityZones = { "1", "2", "3" }, CustomDomainConfiguration = new ContainerAppCustomDomainConfiguration { DnsSuffix = "www.my-name.com", @@ -145,6 +183,7 @@ public async Task CreateOrUpdate_CreateEnvironments() }, WorkloadProfiles = {new ContainerAppWorkloadProfile("My-GP-01", "GeneralPurpose") { +EnableFips = true, MinimumNodeCount = 3, MaximumNodeCount = 12, }, new ContainerAppWorkloadProfile("My-MO-01", "MemoryOptimized") @@ -158,6 +197,23 @@ public async Task CreateOrUpdate_CreateEnvironments() }, new ContainerAppWorkloadProfile("My-consumption-01", "Consumption")}, IsMtlsEnabled = true, IsEnabled = true, + IngressConfiguration = new IngressConfiguration + { + WorkloadProfileName = "My-CO-01", + Scale = new IngressConfigurationScale + { + MinReplicas = 2, + MaxReplicas = 4, + }, + TerminationGracePeriodSeconds = 3600, + HeaderCountLimit = 30, + RequestIdleTimeout = 5, + }, + DiskEncryptionKeyVaultConfiguration = new DiskEncryptionConfigurationKeyVaultConfiguration + { + KeyUri = new Uri("https://contoso.vault.azure.net/mykey/19ff8313ca394b89b9e824bbbdc8c521"), + AuthIdentity = new ResourceIdentifier("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/contoso-resources/providers/Microsoft.ManagedIdentity/userAssignedIdentities/contoso-identity"), + }, }; ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, environmentName, data); ContainerAppManagedEnvironmentResource result = lro.Value; @@ -173,7 +229,7 @@ public async Task CreateOrUpdate_CreateEnvironments() [Ignore("Only validating compilation of examples")] public async Task Get_GetEnvironmentsByName() { - // Generated from example definition: specification/app/resource-manager/Microsoft.App/stable/2025-01-01/examples/ManagedEnvironments_Get.json + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/ManagedEnvironments_Get.json // this example is just showing the usage of "ManagedEnvironments_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -206,7 +262,7 @@ public async Task Get_GetEnvironmentsByName() [Ignore("Only validating compilation of examples")] public async Task GetAll_ListEnvironmentsByResourceGroup() { - // Generated from example definition: specification/app/resource-manager/Microsoft.App/stable/2025-01-01/examples/ManagedEnvironments_ListByResourceGroup.json + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/ManagedEnvironments_ListByResourceGroup.json // this example is just showing the usage of "ManagedEnvironments_ListByResourceGroup" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -241,7 +297,7 @@ public async Task GetAll_ListEnvironmentsByResourceGroup() [Ignore("Only validating compilation of examples")] public async Task Exists_GetEnvironmentsByName() { - // Generated from example definition: specification/app/resource-manager/Microsoft.App/stable/2025-01-01/examples/ManagedEnvironments_Get.json + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/ManagedEnvironments_Get.json // this example is just showing the usage of "ManagedEnvironments_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -270,7 +326,7 @@ public async Task Exists_GetEnvironmentsByName() [Ignore("Only validating compilation of examples")] public async Task GetIfExists_GetEnvironmentsByName() { - // Generated from example definition: specification/app/resource-manager/Microsoft.App/stable/2025-01-01/examples/ManagedEnvironments_Get.json + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/ManagedEnvironments_Get.json // this example is just showing the usage of "ManagedEnvironments_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/tests/Generated/Samples/Sample_ContainerAppManagedEnvironmentDaprComponentCollection.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/tests/Generated/Samples/Sample_ContainerAppManagedEnvironmentDaprComponentCollection.cs index d4ba1c0ac8fd..4ae3e75d44b0 100644 --- a/sdk/containerapps/Azure.ResourceManager.AppContainers/tests/Generated/Samples/Sample_ContainerAppManagedEnvironmentDaprComponentCollection.cs +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/tests/Generated/Samples/Sample_ContainerAppManagedEnvironmentDaprComponentCollection.cs @@ -20,7 +20,7 @@ public partial class Sample_ContainerAppManagedEnvironmentDaprComponentCollectio [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_CreateOrUpdateDaprComponentWithSecretStoreComponent() { - // Generated from example definition: specification/app/resource-manager/Microsoft.App/stable/2025-01-01/examples/DaprComponents_CreateOrUpdate_SecretStoreComponent.json + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/DaprComponents_CreateOrUpdate_SecretStoreComponent.json // this example is just showing the usage of "DaprComponents_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -66,6 +66,16 @@ public async Task CreateOrUpdate_CreateOrUpdateDaprComponentWithSecretStoreCompo SecretRef = "masterkey", }}, Scopes = { "container-app-1", "container-app-2" }, + ServiceComponentBind = {new DaprComponentServiceBinding +{ +Name = "statestore", +ServiceId = "/subscriptions/9f7371f1-b593-4c3c-84e2-9167806ad358/resourceGroups/ca-syn2-group/providers/Microsoft.App/containerapps/cappredis", +Metadata = new DaprServiceBindMetadata +{ +Name = "daprcomponentBind", +Value = "redis-bind", +}, +}}, }; ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, componentName, data); ContainerAppManagedEnvironmentDaprComponentResource result = lro.Value; @@ -81,7 +91,7 @@ public async Task CreateOrUpdate_CreateOrUpdateDaprComponentWithSecretStoreCompo [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_CreateOrUpdateDaprComponentWithSecrets() { - // Generated from example definition: specification/app/resource-manager/Microsoft.App/stable/2025-01-01/examples/DaprComponents_CreateOrUpdate_Secrets.json + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/DaprComponents_CreateOrUpdate_Secrets.json // this example is just showing the usage of "DaprComponents_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -131,6 +141,16 @@ public async Task CreateOrUpdate_CreateOrUpdateDaprComponentWithSecrets() SecretRef = "masterkey", }}, Scopes = { "container-app-1", "container-app-2" }, + ServiceComponentBind = {new DaprComponentServiceBinding +{ +Name = "statestore", +ServiceId = "/subscriptions/9f7371f1-b593-4c3c-84e2-9167806ad358/resourceGroups/ca-syn2-group/providers/Microsoft.App/containerapps/cappredis", +Metadata = new DaprServiceBindMetadata +{ +Name = "daprcomponentBind", +Value = "redis-bind", +}, +}}, }; ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, componentName, data); ContainerAppManagedEnvironmentDaprComponentResource result = lro.Value; @@ -146,7 +166,7 @@ public async Task CreateOrUpdate_CreateOrUpdateDaprComponentWithSecrets() [Ignore("Only validating compilation of examples")] public async Task Get_GetDaprComponentWithSecretStoreComponent() { - // Generated from example definition: specification/app/resource-manager/Microsoft.App/stable/2025-01-01/examples/DaprComponents_Get_SecretStoreComponent.json + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/DaprComponents_Get_SecretStoreComponent.json // this example is just showing the usage of "DaprComponents_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -180,7 +200,7 @@ public async Task Get_GetDaprComponentWithSecretStoreComponent() [Ignore("Only validating compilation of examples")] public async Task Get_GetDaprComponentWithSecrets() { - // Generated from example definition: specification/app/resource-manager/Microsoft.App/stable/2025-01-01/examples/DaprComponents_Get_Secrets.json + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/DaprComponents_Get_Secrets.json // this example is just showing the usage of "DaprComponents_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -214,7 +234,7 @@ public async Task Get_GetDaprComponentWithSecrets() [Ignore("Only validating compilation of examples")] public async Task GetAll_ListDaprComponents() { - // Generated from example definition: specification/app/resource-manager/Microsoft.App/stable/2025-01-01/examples/DaprComponents_List.json + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/DaprComponents_List.json // this example is just showing the usage of "DaprComponents_List" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -250,7 +270,7 @@ public async Task GetAll_ListDaprComponents() [Ignore("Only validating compilation of examples")] public async Task Exists_GetDaprComponentWithSecretStoreComponent() { - // Generated from example definition: specification/app/resource-manager/Microsoft.App/stable/2025-01-01/examples/DaprComponents_Get_SecretStoreComponent.json + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/DaprComponents_Get_SecretStoreComponent.json // this example is just showing the usage of "DaprComponents_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -280,7 +300,7 @@ public async Task Exists_GetDaprComponentWithSecretStoreComponent() [Ignore("Only validating compilation of examples")] public async Task Exists_GetDaprComponentWithSecrets() { - // Generated from example definition: specification/app/resource-manager/Microsoft.App/stable/2025-01-01/examples/DaprComponents_Get_Secrets.json + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/DaprComponents_Get_Secrets.json // this example is just showing the usage of "DaprComponents_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -310,7 +330,7 @@ public async Task Exists_GetDaprComponentWithSecrets() [Ignore("Only validating compilation of examples")] public async Task GetIfExists_GetDaprComponentWithSecretStoreComponent() { - // Generated from example definition: specification/app/resource-manager/Microsoft.App/stable/2025-01-01/examples/DaprComponents_Get_SecretStoreComponent.json + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/DaprComponents_Get_SecretStoreComponent.json // this example is just showing the usage of "DaprComponents_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -352,7 +372,7 @@ public async Task GetIfExists_GetDaprComponentWithSecretStoreComponent() [Ignore("Only validating compilation of examples")] public async Task GetIfExists_GetDaprComponentWithSecrets() { - // Generated from example definition: specification/app/resource-manager/Microsoft.App/stable/2025-01-01/examples/DaprComponents_Get_Secrets.json + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/DaprComponents_Get_Secrets.json // this example is just showing the usage of "DaprComponents_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/tests/Generated/Samples/Sample_ContainerAppManagedEnvironmentDaprComponentResource.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/tests/Generated/Samples/Sample_ContainerAppManagedEnvironmentDaprComponentResource.cs index 40f265649668..1d0de5e25d95 100644 --- a/sdk/containerapps/Azure.ResourceManager.AppContainers/tests/Generated/Samples/Sample_ContainerAppManagedEnvironmentDaprComponentResource.cs +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/tests/Generated/Samples/Sample_ContainerAppManagedEnvironmentDaprComponentResource.cs @@ -20,7 +20,7 @@ public partial class Sample_ContainerAppManagedEnvironmentDaprComponentResource [Ignore("Only validating compilation of examples")] public async Task Get_GetDaprComponentWithSecretStoreComponent() { - // Generated from example definition: specification/app/resource-manager/Microsoft.App/stable/2025-01-01/examples/DaprComponents_Get_SecretStoreComponent.json + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/DaprComponents_Get_SecretStoreComponent.json // this example is just showing the usage of "DaprComponents_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -51,7 +51,7 @@ public async Task Get_GetDaprComponentWithSecretStoreComponent() [Ignore("Only validating compilation of examples")] public async Task Get_GetDaprComponentWithSecrets() { - // Generated from example definition: specification/app/resource-manager/Microsoft.App/stable/2025-01-01/examples/DaprComponents_Get_Secrets.json + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/DaprComponents_Get_Secrets.json // this example is just showing the usage of "DaprComponents_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -82,7 +82,7 @@ public async Task Get_GetDaprComponentWithSecrets() [Ignore("Only validating compilation of examples")] public async Task Delete_DeleteDaprComponent() { - // Generated from example definition: specification/app/resource-manager/Microsoft.App/stable/2025-01-01/examples/DaprComponents_Delete.json + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/DaprComponents_Delete.json // this example is just showing the usage of "DaprComponents_Delete" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -109,7 +109,7 @@ public async Task Delete_DeleteDaprComponent() [Ignore("Only validating compilation of examples")] public async Task Update_CreateOrUpdateDaprComponentWithSecretStoreComponent() { - // Generated from example definition: specification/app/resource-manager/Microsoft.App/stable/2025-01-01/examples/DaprComponents_CreateOrUpdate_SecretStoreComponent.json + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/DaprComponents_CreateOrUpdate_SecretStoreComponent.json // this example is just showing the usage of "DaprComponents_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -152,6 +152,16 @@ public async Task Update_CreateOrUpdateDaprComponentWithSecretStoreComponent() SecretRef = "masterkey", }}, Scopes = { "container-app-1", "container-app-2" }, + ServiceComponentBind = {new DaprComponentServiceBinding +{ +Name = "statestore", +ServiceId = "/subscriptions/9f7371f1-b593-4c3c-84e2-9167806ad358/resourceGroups/ca-syn2-group/providers/Microsoft.App/containerapps/cappredis", +Metadata = new DaprServiceBindMetadata +{ +Name = "daprcomponentBind", +Value = "redis-bind", +}, +}}, }; ArmOperation lro = await containerAppManagedEnvironmentDaprComponent.UpdateAsync(WaitUntil.Completed, data); ContainerAppManagedEnvironmentDaprComponentResource result = lro.Value; @@ -167,7 +177,7 @@ public async Task Update_CreateOrUpdateDaprComponentWithSecretStoreComponent() [Ignore("Only validating compilation of examples")] public async Task Update_CreateOrUpdateDaprComponentWithSecrets() { - // Generated from example definition: specification/app/resource-manager/Microsoft.App/stable/2025-01-01/examples/DaprComponents_CreateOrUpdate_Secrets.json + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/DaprComponents_CreateOrUpdate_Secrets.json // this example is just showing the usage of "DaprComponents_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -214,6 +224,16 @@ public async Task Update_CreateOrUpdateDaprComponentWithSecrets() SecretRef = "masterkey", }}, Scopes = { "container-app-1", "container-app-2" }, + ServiceComponentBind = {new DaprComponentServiceBinding +{ +Name = "statestore", +ServiceId = "/subscriptions/9f7371f1-b593-4c3c-84e2-9167806ad358/resourceGroups/ca-syn2-group/providers/Microsoft.App/containerapps/cappredis", +Metadata = new DaprServiceBindMetadata +{ +Name = "daprcomponentBind", +Value = "redis-bind", +}, +}}, }; ArmOperation lro = await containerAppManagedEnvironmentDaprComponent.UpdateAsync(WaitUntil.Completed, data); ContainerAppManagedEnvironmentDaprComponentResource result = lro.Value; @@ -229,7 +249,7 @@ public async Task Update_CreateOrUpdateDaprComponentWithSecrets() [Ignore("Only validating compilation of examples")] public async Task GetSecrets_ListContainerAppsSecrets() { - // Generated from example definition: specification/app/resource-manager/Microsoft.App/stable/2025-01-01/examples/DaprComponents_ListSecrets.json + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/DaprComponents_ListSecrets.json // this example is just showing the usage of "DaprComponents_ListSecrets" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/tests/Generated/Samples/Sample_ContainerAppManagedEnvironmentDetectorCollection.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/tests/Generated/Samples/Sample_ContainerAppManagedEnvironmentDetectorCollection.cs index f8ef008ed758..ab6a467751b2 100644 --- a/sdk/containerapps/Azure.ResourceManager.AppContainers/tests/Generated/Samples/Sample_ContainerAppManagedEnvironmentDetectorCollection.cs +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/tests/Generated/Samples/Sample_ContainerAppManagedEnvironmentDetectorCollection.cs @@ -19,7 +19,7 @@ public partial class Sample_ContainerAppManagedEnvironmentDetectorCollection [Ignore("Only validating compilation of examples")] public async Task Get_GetDiagnosticDataForAManagedEnvironments() { - // Generated from example definition: specification/app/resource-manager/Microsoft.App/stable/2025-01-01/examples/ManagedEnvironmentDiagnostics_Get.json + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/ManagedEnvironmentDiagnostics_Get.json // this example is just showing the usage of "ManagedEnvironmentDiagnostics_GetDetector" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -53,7 +53,7 @@ public async Task Get_GetDiagnosticDataForAManagedEnvironments() [Ignore("Only validating compilation of examples")] public async Task GetAll_GetTheListOfAvailableDiagnosticDataForAManagedEnvironments() { - // Generated from example definition: specification/app/resource-manager/Microsoft.App/stable/2025-01-01/examples/ManagedEnvironmentDiagnostics_List.json + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/ManagedEnvironmentDiagnostics_List.json // this example is just showing the usage of "ManagedEnvironmentDiagnostics_ListDetectors" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -89,7 +89,7 @@ public async Task GetAll_GetTheListOfAvailableDiagnosticDataForAManagedEnvironme [Ignore("Only validating compilation of examples")] public async Task Exists_GetDiagnosticDataForAManagedEnvironments() { - // Generated from example definition: specification/app/resource-manager/Microsoft.App/stable/2025-01-01/examples/ManagedEnvironmentDiagnostics_Get.json + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/ManagedEnvironmentDiagnostics_Get.json // this example is just showing the usage of "ManagedEnvironmentDiagnostics_GetDetector" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -119,7 +119,7 @@ public async Task Exists_GetDiagnosticDataForAManagedEnvironments() [Ignore("Only validating compilation of examples")] public async Task GetIfExists_GetDiagnosticDataForAManagedEnvironments() { - // Generated from example definition: specification/app/resource-manager/Microsoft.App/stable/2025-01-01/examples/ManagedEnvironmentDiagnostics_Get.json + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/ManagedEnvironmentDiagnostics_Get.json // this example is just showing the usage of "ManagedEnvironmentDiagnostics_GetDetector" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/tests/Generated/Samples/Sample_ContainerAppManagedEnvironmentDetectorResource.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/tests/Generated/Samples/Sample_ContainerAppManagedEnvironmentDetectorResource.cs index 190bf64b5f1d..e553ae41fbc1 100644 --- a/sdk/containerapps/Azure.ResourceManager.AppContainers/tests/Generated/Samples/Sample_ContainerAppManagedEnvironmentDetectorResource.cs +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/tests/Generated/Samples/Sample_ContainerAppManagedEnvironmentDetectorResource.cs @@ -19,7 +19,7 @@ public partial class Sample_ContainerAppManagedEnvironmentDetectorResource [Ignore("Only validating compilation of examples")] public async Task Get_GetDiagnosticDataForAManagedEnvironments() { - // Generated from example definition: specification/app/resource-manager/Microsoft.App/stable/2025-01-01/examples/ManagedEnvironmentDiagnostics_Get.json + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/ManagedEnvironmentDiagnostics_Get.json // this example is just showing the usage of "ManagedEnvironmentDiagnostics_GetDetector" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/tests/Generated/Samples/Sample_ContainerAppManagedEnvironmentDetectorResourcePropertyResource.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/tests/Generated/Samples/Sample_ContainerAppManagedEnvironmentDetectorResourcePropertyResource.cs index 888ee31ce434..9c7b89e00fac 100644 --- a/sdk/containerapps/Azure.ResourceManager.AppContainers/tests/Generated/Samples/Sample_ContainerAppManagedEnvironmentDetectorResourcePropertyResource.cs +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/tests/Generated/Samples/Sample_ContainerAppManagedEnvironmentDetectorResourcePropertyResource.cs @@ -19,7 +19,7 @@ public partial class Sample_ContainerAppManagedEnvironmentDetectorResourceProper [Ignore("Only validating compilation of examples")] public async Task Get_GetEnvironmentsByName() { - // Generated from example definition: specification/app/resource-manager/Microsoft.App/stable/2025-01-01/examples/ManagedEnvironments_Get.json + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/ManagedEnvironments_Get.json // this example is just showing the usage of "ManagedEnvironmentsDiagnostics_GetRoot" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/tests/Generated/Samples/Sample_ContainerAppManagedEnvironmentResource.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/tests/Generated/Samples/Sample_ContainerAppManagedEnvironmentResource.cs index 7a8f4ecc7da4..c67dfb2227e5 100644 --- a/sdk/containerapps/Azure.ResourceManager.AppContainers/tests/Generated/Samples/Sample_ContainerAppManagedEnvironmentResource.cs +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/tests/Generated/Samples/Sample_ContainerAppManagedEnvironmentResource.cs @@ -20,7 +20,7 @@ public partial class Sample_ContainerAppManagedEnvironmentResource [Ignore("Only validating compilation of examples")] public async Task Get_GetEnvironmentsByName() { - // Generated from example definition: specification/app/resource-manager/Microsoft.App/stable/2025-01-01/examples/ManagedEnvironments_Get.json + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/ManagedEnvironments_Get.json // this example is just showing the usage of "ManagedEnvironments_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -50,7 +50,7 @@ public async Task Get_GetEnvironmentsByName() [Ignore("Only validating compilation of examples")] public async Task Delete_DeleteEnvironmentByName() { - // Generated from example definition: specification/app/resource-manager/Microsoft.App/stable/2025-01-01/examples/ManagedEnvironments_Delete.json + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/ManagedEnvironments_Delete.json // this example is just showing the usage of "ManagedEnvironments_Delete" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -76,7 +76,7 @@ public async Task Delete_DeleteEnvironmentByName() [Ignore("Only validating compilation of examples")] public async Task Update_PatchManagedEnvironment() { - // Generated from example definition: specification/app/resource-manager/Microsoft.App/stable/2025-01-01/examples/ManagedEnvironments_Patch.json + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/ManagedEnvironments_Patch.json // this example is just showing the usage of "ManagedEnvironments_Update" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -115,7 +115,7 @@ public async Task Update_PatchManagedEnvironment() [Ignore("Only validating compilation of examples")] public async Task GetAuthToken_GetManagedEnvironmentAuthToken() { - // Generated from example definition: specification/app/resource-manager/Microsoft.App/stable/2025-01-01/examples/ManagedEnvironments_GetAuthToken.json + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/ManagedEnvironments_GetAuthToken.json // this example is just showing the usage of "ManagedEnvironments_GetAuthToken" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -141,7 +141,7 @@ public async Task GetAuthToken_GetManagedEnvironmentAuthToken() [Ignore("Only validating compilation of examples")] public async Task GetWorkloadProfileStates_ListEnvironmentsBySubscription() { - // Generated from example definition: specification/app/resource-manager/Microsoft.App/stable/2025-01-01/examples/ManagedEnvironments_ListWorkloadProfileStates.json + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/ManagedEnvironments_ListWorkloadProfileStates.json // this example is just showing the usage of "ManagedEnvironments_ListWorkloadProfileStates" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -170,7 +170,7 @@ public async Task GetWorkloadProfileStates_ListEnvironmentsBySubscription() [Ignore("Only validating compilation of examples")] public async Task CheckContainerAppNameAvailability_CertificatesCheckNameAvailability() { - // Generated from example definition: specification/app/resource-manager/Microsoft.App/stable/2025-01-01/examples/Certificates_CheckNameAvailability.json + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/Certificates_CheckNameAvailability.json // this example is just showing the usage of "Namespaces_CheckNameAvailability" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -201,7 +201,7 @@ public async Task CheckContainerAppNameAvailability_CertificatesCheckNameAvailab [Ignore("Only validating compilation of examples")] public async Task CheckContainerAppNameAvailability_ContainerAppsCheckNameAvailability() { - // Generated from example definition: specification/app/resource-manager/Microsoft.App/stable/2025-01-01/examples/ContainerApps_CheckNameAvailability.json + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/ContainerApps_CheckNameAvailability.json // this example is just showing the usage of "Namespaces_CheckNameAvailability" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -228,11 +228,40 @@ public async Task CheckContainerAppNameAvailability_ContainerAppsCheckNameAvaila Console.WriteLine($"Succeeded: {result}"); } + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetManagedEnvironmentPrivateLinkResources_ListPrivateLinkResourcesByManagedEnvironment() + { + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/ManagedEnvironmentPrivateLinkResources_List.json + // this example is just showing the usage of "ManagedEnvironmentPrivateLinkResources_List" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ContainerAppManagedEnvironmentResource created on azure + // for more information of creating ContainerAppManagedEnvironmentResource, please refer to the document of ContainerAppManagedEnvironmentResource + string subscriptionId = "8efdecc5-919e-44eb-b179-915dca89ebf9"; + string resourceGroupName = "examplerg"; + string environmentName = "managedEnv"; + ResourceIdentifier containerAppManagedEnvironmentResourceId = ContainerAppManagedEnvironmentResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, environmentName); + ContainerAppManagedEnvironmentResource containerAppManagedEnvironment = client.GetContainerAppManagedEnvironmentResource(containerAppManagedEnvironmentResourceId); + + // invoke the operation and iterate over the result + await foreach (AppContainersPrivateLinkResource item in containerAppManagedEnvironment.GetManagedEnvironmentPrivateLinkResourcesAsync()) + { + Console.WriteLine($"Succeeded: {item}"); + } + + Console.WriteLine("Succeeded"); + } + [Test] [Ignore("Only validating compilation of examples")] public async Task GetManagedEnvironmentUsages_ListManagedEnvironmentUsages() { - // Generated from example definition: specification/app/resource-manager/Microsoft.App/stable/2025-01-01/examples/ManagedEnvironmentUsages_List.json + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/ManagedEnvironmentUsages_List.json // this example is just showing the usage of "ManagedEnvironmentUsages_List" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/tests/Generated/Samples/Sample_ContainerAppManagedEnvironmentStorageCollection.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/tests/Generated/Samples/Sample_ContainerAppManagedEnvironmentStorageCollection.cs index 543d570345f8..717716b726d6 100644 --- a/sdk/containerapps/Azure.ResourceManager.AppContainers/tests/Generated/Samples/Sample_ContainerAppManagedEnvironmentStorageCollection.cs +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/tests/Generated/Samples/Sample_ContainerAppManagedEnvironmentStorageCollection.cs @@ -20,7 +20,7 @@ public partial class Sample_ContainerAppManagedEnvironmentStorageCollection [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_CreateOrUpdateEnvironmentsStorage() { - // Generated from example definition: specification/app/resource-manager/Microsoft.App/stable/2025-01-01/examples/ManagedEnvironmentsStorages_CreateOrUpdate.json + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/ManagedEnvironmentsStorages_CreateOrUpdate.json // this example is just showing the usage of "ManagedEnvironmentsStorages_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -68,7 +68,7 @@ public async Task CreateOrUpdate_CreateOrUpdateEnvironmentsStorage() [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_CreateOrUpdateEnvironmentsStorageForNFSAzureFile() { - // Generated from example definition: specification/app/resource-manager/Microsoft.App/stable/2025-01-01/examples/ManagedEnvironmentsStorages_CreateOrUpdate_NfsAzureFile.json + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/ManagedEnvironmentsStorages_CreateOrUpdate_NfsAzureFile.json // this example is just showing the usage of "ManagedEnvironmentsStorages_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -115,7 +115,7 @@ public async Task CreateOrUpdate_CreateOrUpdateEnvironmentsStorageForNFSAzureFil [Ignore("Only validating compilation of examples")] public async Task Get_GetAEnvironmentsStorage() { - // Generated from example definition: specification/app/resource-manager/Microsoft.App/stable/2025-01-01/examples/ManagedEnvironmentsStorages_Get.json + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/ManagedEnvironmentsStorages_Get.json // this example is just showing the usage of "ManagedEnvironmentsStorages_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -149,7 +149,7 @@ public async Task Get_GetAEnvironmentsStorage() [Ignore("Only validating compilation of examples")] public async Task Get_GetAEnvironmentsStorageForNFSAzureFile() { - // Generated from example definition: specification/app/resource-manager/Microsoft.App/stable/2025-01-01/examples/ManagedEnvironmentsStorages_Get_NfsAzureFile.json + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/ManagedEnvironmentsStorages_Get_NfsAzureFile.json // this example is just showing the usage of "ManagedEnvironmentsStorages_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -183,7 +183,7 @@ public async Task Get_GetAEnvironmentsStorageForNFSAzureFile() [Ignore("Only validating compilation of examples")] public async Task GetAll_ListEnvironmentsStoragesBySubscription() { - // Generated from example definition: specification/app/resource-manager/Microsoft.App/stable/2025-01-01/examples/ManagedEnvironmentsStorages_List.json + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/ManagedEnvironmentsStorages_List.json // this example is just showing the usage of "ManagedEnvironmentsStorages_List" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -219,7 +219,7 @@ public async Task GetAll_ListEnvironmentsStoragesBySubscription() [Ignore("Only validating compilation of examples")] public async Task Exists_GetAEnvironmentsStorage() { - // Generated from example definition: specification/app/resource-manager/Microsoft.App/stable/2025-01-01/examples/ManagedEnvironmentsStorages_Get.json + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/ManagedEnvironmentsStorages_Get.json // this example is just showing the usage of "ManagedEnvironmentsStorages_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -249,7 +249,7 @@ public async Task Exists_GetAEnvironmentsStorage() [Ignore("Only validating compilation of examples")] public async Task Exists_GetAEnvironmentsStorageForNFSAzureFile() { - // Generated from example definition: specification/app/resource-manager/Microsoft.App/stable/2025-01-01/examples/ManagedEnvironmentsStorages_Get_NfsAzureFile.json + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/ManagedEnvironmentsStorages_Get_NfsAzureFile.json // this example is just showing the usage of "ManagedEnvironmentsStorages_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -279,7 +279,7 @@ public async Task Exists_GetAEnvironmentsStorageForNFSAzureFile() [Ignore("Only validating compilation of examples")] public async Task GetIfExists_GetAEnvironmentsStorage() { - // Generated from example definition: specification/app/resource-manager/Microsoft.App/stable/2025-01-01/examples/ManagedEnvironmentsStorages_Get.json + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/ManagedEnvironmentsStorages_Get.json // this example is just showing the usage of "ManagedEnvironmentsStorages_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -321,7 +321,7 @@ public async Task GetIfExists_GetAEnvironmentsStorage() [Ignore("Only validating compilation of examples")] public async Task GetIfExists_GetAEnvironmentsStorageForNFSAzureFile() { - // Generated from example definition: specification/app/resource-manager/Microsoft.App/stable/2025-01-01/examples/ManagedEnvironmentsStorages_Get_NfsAzureFile.json + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/ManagedEnvironmentsStorages_Get_NfsAzureFile.json // this example is just showing the usage of "ManagedEnvironmentsStorages_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/tests/Generated/Samples/Sample_ContainerAppManagedEnvironmentStorageResource.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/tests/Generated/Samples/Sample_ContainerAppManagedEnvironmentStorageResource.cs index 72006c19b6f2..013125713ad8 100644 --- a/sdk/containerapps/Azure.ResourceManager.AppContainers/tests/Generated/Samples/Sample_ContainerAppManagedEnvironmentStorageResource.cs +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/tests/Generated/Samples/Sample_ContainerAppManagedEnvironmentStorageResource.cs @@ -20,7 +20,7 @@ public partial class Sample_ContainerAppManagedEnvironmentStorageResource [Ignore("Only validating compilation of examples")] public async Task Get_GetAEnvironmentsStorage() { - // Generated from example definition: specification/app/resource-manager/Microsoft.App/stable/2025-01-01/examples/ManagedEnvironmentsStorages_Get.json + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/ManagedEnvironmentsStorages_Get.json // this example is just showing the usage of "ManagedEnvironmentsStorages_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -51,7 +51,7 @@ public async Task Get_GetAEnvironmentsStorage() [Ignore("Only validating compilation of examples")] public async Task Get_GetAEnvironmentsStorageForNFSAzureFile() { - // Generated from example definition: specification/app/resource-manager/Microsoft.App/stable/2025-01-01/examples/ManagedEnvironmentsStorages_Get_NfsAzureFile.json + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/ManagedEnvironmentsStorages_Get_NfsAzureFile.json // this example is just showing the usage of "ManagedEnvironmentsStorages_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -82,7 +82,7 @@ public async Task Get_GetAEnvironmentsStorageForNFSAzureFile() [Ignore("Only validating compilation of examples")] public async Task Delete_ListEnvironmentsStoragesBySubscription() { - // Generated from example definition: specification/app/resource-manager/Microsoft.App/stable/2025-01-01/examples/ManagedEnvironmentsStorages_Delete.json + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/ManagedEnvironmentsStorages_Delete.json // this example is just showing the usage of "ManagedEnvironmentsStorages_Delete" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -109,7 +109,7 @@ public async Task Delete_ListEnvironmentsStoragesBySubscription() [Ignore("Only validating compilation of examples")] public async Task Update_CreateOrUpdateEnvironmentsStorage() { - // Generated from example definition: specification/app/resource-manager/Microsoft.App/stable/2025-01-01/examples/ManagedEnvironmentsStorages_CreateOrUpdate.json + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/ManagedEnvironmentsStorages_CreateOrUpdate.json // this example is just showing the usage of "ManagedEnvironmentsStorages_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -154,7 +154,7 @@ public async Task Update_CreateOrUpdateEnvironmentsStorage() [Ignore("Only validating compilation of examples")] public async Task Update_CreateOrUpdateEnvironmentsStorageForNFSAzureFile() { - // Generated from example definition: specification/app/resource-manager/Microsoft.App/stable/2025-01-01/examples/ManagedEnvironmentsStorages_CreateOrUpdate_NfsAzureFile.json + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/ManagedEnvironmentsStorages_CreateOrUpdate_NfsAzureFile.json // this example is just showing the usage of "ManagedEnvironmentsStorages_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/tests/Generated/Samples/Sample_ContainerAppReplicaCollection.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/tests/Generated/Samples/Sample_ContainerAppReplicaCollection.cs index 17416d97790d..f700880e3d6d 100644 --- a/sdk/containerapps/Azure.ResourceManager.AppContainers/tests/Generated/Samples/Sample_ContainerAppReplicaCollection.cs +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/tests/Generated/Samples/Sample_ContainerAppReplicaCollection.cs @@ -19,7 +19,7 @@ public partial class Sample_ContainerAppReplicaCollection [Ignore("Only validating compilation of examples")] public async Task Get_GetContainerAppSRevisionReplica() { - // Generated from example definition: specification/app/resource-manager/Microsoft.App/stable/2025-01-01/examples/Replicas_Get.json + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/Replicas_Get.json // this example is just showing the usage of "ContainerAppsRevisionReplicas_GetReplica" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -54,7 +54,7 @@ public async Task Get_GetContainerAppSRevisionReplica() [Ignore("Only validating compilation of examples")] public async Task GetAll_ListContainerAppSReplicas() { - // Generated from example definition: specification/app/resource-manager/Microsoft.App/stable/2025-01-01/examples/Replicas_List.json + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/Replicas_List.json // this example is just showing the usage of "ContainerAppsRevisionReplicas_ListReplicas" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -91,7 +91,7 @@ public async Task GetAll_ListContainerAppSReplicas() [Ignore("Only validating compilation of examples")] public async Task Exists_GetContainerAppSRevisionReplica() { - // Generated from example definition: specification/app/resource-manager/Microsoft.App/stable/2025-01-01/examples/Replicas_Get.json + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/Replicas_Get.json // this example is just showing the usage of "ContainerAppsRevisionReplicas_GetReplica" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -122,7 +122,7 @@ public async Task Exists_GetContainerAppSRevisionReplica() [Ignore("Only validating compilation of examples")] public async Task GetIfExists_GetContainerAppSRevisionReplica() { - // Generated from example definition: specification/app/resource-manager/Microsoft.App/stable/2025-01-01/examples/Replicas_Get.json + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/Replicas_Get.json // this example is just showing the usage of "ContainerAppsRevisionReplicas_GetReplica" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/tests/Generated/Samples/Sample_ContainerAppReplicaResource.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/tests/Generated/Samples/Sample_ContainerAppReplicaResource.cs index 5ca72f49a337..73ac46bd2b14 100644 --- a/sdk/containerapps/Azure.ResourceManager.AppContainers/tests/Generated/Samples/Sample_ContainerAppReplicaResource.cs +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/tests/Generated/Samples/Sample_ContainerAppReplicaResource.cs @@ -19,7 +19,7 @@ public partial class Sample_ContainerAppReplicaResource [Ignore("Only validating compilation of examples")] public async Task Get_GetContainerAppSRevisionReplica() { - // Generated from example definition: specification/app/resource-manager/Microsoft.App/stable/2025-01-01/examples/Replicas_Get.json + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/Replicas_Get.json // this example is just showing the usage of "ContainerAppsRevisionReplicas_GetReplica" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/tests/Generated/Samples/Sample_ContainerAppResource.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/tests/Generated/Samples/Sample_ContainerAppResource.cs index 2f78307722e8..6b96fd6e53b0 100644 --- a/sdk/containerapps/Azure.ResourceManager.AppContainers/tests/Generated/Samples/Sample_ContainerAppResource.cs +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/tests/Generated/Samples/Sample_ContainerAppResource.cs @@ -20,7 +20,7 @@ public partial class Sample_ContainerAppResource [Ignore("Only validating compilation of examples")] public async Task Get_GetContainerApp() { - // Generated from example definition: specification/app/resource-manager/Microsoft.App/stable/2025-01-01/examples/ContainerApps_Get.json + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/ContainerApps_Get.json // this example is just showing the usage of "ContainerApps_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -32,7 +32,7 @@ public async Task Get_GetContainerApp() // for more information of creating ContainerAppResource, please refer to the document of ContainerAppResource string subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; string resourceGroupName = "rg"; - string containerAppName = "testcontainerapp0"; + string containerAppName = "testcontainerApp0"; ResourceIdentifier containerAppResourceId = ContainerAppResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, containerAppName); ContainerAppResource containerApp = client.GetContainerAppResource(containerAppResourceId); @@ -50,7 +50,7 @@ public async Task Get_GetContainerApp() [Ignore("Only validating compilation of examples")] public async Task Delete_DeleteContainerApp() { - // Generated from example definition: specification/app/resource-manager/Microsoft.App/stable/2025-01-01/examples/ContainerApps_Delete.json + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/ContainerApps_Delete.json // this example is just showing the usage of "ContainerApps_Delete" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -62,7 +62,7 @@ public async Task Delete_DeleteContainerApp() // for more information of creating ContainerAppResource, please refer to the document of ContainerAppResource string subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; string resourceGroupName = "rg"; - string containerAppName = "testworkerapp0"; + string containerAppName = "testWorkerApp0"; ResourceIdentifier containerAppResourceId = ContainerAppResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, containerAppName); ContainerAppResource containerApp = client.GetContainerAppResource(containerAppResourceId); @@ -76,7 +76,7 @@ public async Task Delete_DeleteContainerApp() [Ignore("Only validating compilation of examples")] public async Task Update_PatchContainerApp() { - // Generated from example definition: specification/app/resource-manager/Microsoft.App/stable/2025-01-01/examples/ContainerApps_Patch.json + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/ContainerApps_Patch.json // this example is just showing the usage of "ContainerApps_Update" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -88,7 +88,7 @@ public async Task Update_PatchContainerApp() // for more information of creating ContainerAppResource, please refer to the document of ContainerAppResource string subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; string resourceGroupName = "rg"; - string containerAppName = "testcontainerapp0"; + string containerAppName = "testcontainerApp0"; ResourceIdentifier containerAppResourceId = ContainerAppResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, containerAppName); ContainerAppResource containerApp = client.GetContainerAppResource(containerAppResourceId); @@ -103,7 +103,7 @@ public async Task Update_PatchContainerApp() TargetPort = 3000, Traffic = {new ContainerAppRevisionTrafficWeight { -RevisionName = "testcontainerapp0-ab1234", +RevisionName = "testcontainerApp0-ab1234", Weight = 100, Label = "production", }}, @@ -134,21 +134,43 @@ public async Task Update_PatchContainerApp() HttpMaxRequestSize = 10, LogLevel = ContainerAppDaprLogLevel.Debug, IsApiLoggingEnabled = true, + AppHealth = new DaprAppHealth + { + IsEnabled = true, + Path = "/health", + ProbeIntervalSeconds = 3, + ProbeTimeoutMilliseconds = 1000, + Threshold = 3, + }, + MaxConcurrency = 10, + }, + Runtime = new ContainerAppRuntime + { + Java = new ContainerAppRuntimeJava + { + EnableMetrics = true, + JavaAgent = new ContainerAppRuntimeJavaAgent + { + IsEnabled = true, + LoggingLoggerSettings = { new LoggerSetting("org.springframework.boot", Level.Debug) }, + }, + }, + AutoConfigureDataProtection = true, }, - EnableMetrics = true, MaxInactiveRevisions = 10, + RevisionTransitionThreshold = 100, ServiceType = "redis", }, Template = new ContainerAppTemplate { InitContainers = {new ContainerAppInitContainer { -Image = "repo/testcontainerapp0:v4", +Image = "repo/testcontainerApp0:v4", Name = "testinitcontainerApp0", Resources = new AppContainerResources { -Cpu = 0.5, -Memory = "1Gi", +Cpu = 0.2, +Memory = "100Mi", }, }}, Containers = {new ContainerAppContainer @@ -164,8 +186,8 @@ public async Task Update_PatchContainerApp() PeriodSeconds = 3, ProbeType = ContainerAppProbeType.Liveness, }}, -Image = "repo/testcontainerapp0:v1", -Name = "testcontainerapp0", +Image = "repo/testcontainerApp0:v1", +Name = "testcontainerApp0", }}, Scale = new ContainerAppScale { @@ -190,6 +212,11 @@ public async Task Update_PatchContainerApp() { ServiceId = new ResourceIdentifier("/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/containerApps/service"), Name = "service", +ClientType = "dotnet", +CustomizedKeys = +{ +["DesiredKey"] = "defaultKey" +}, }}, }, Tags = @@ -212,7 +239,7 @@ public async Task Update_PatchContainerApp() [Ignore("Only validating compilation of examples")] public async Task GetCustomHostNameAnalysis_AnalyzeCustomHostname() { - // Generated from example definition: specification/app/resource-manager/Microsoft.App/stable/2025-01-01/examples/ContainerApps_ListCustomHostNameAnalysis.json + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/ContainerApps_ListCustomHostNameAnalysis.json // this example is just showing the usage of "ContainerApps_ListCustomHostNameAnalysis" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -224,7 +251,7 @@ public async Task GetCustomHostNameAnalysis_AnalyzeCustomHostname() // for more information of creating ContainerAppResource, please refer to the document of ContainerAppResource string subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; string resourceGroupName = "rg"; - string containerAppName = "testcontainerapp0"; + string containerAppName = "testcontainerApp0"; ResourceIdentifier containerAppResourceId = ContainerAppResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, containerAppName); ContainerAppResource containerApp = client.GetContainerAppResource(containerAppResourceId); @@ -239,7 +266,7 @@ public async Task GetCustomHostNameAnalysis_AnalyzeCustomHostname() [Ignore("Only validating compilation of examples")] public async Task GetSecrets_ListContainerAppsSecrets() { - // Generated from example definition: specification/app/resource-manager/Microsoft.App/stable/2025-01-01/examples/ContainerApps_ListSecrets.json + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/ContainerApps_ListSecrets.json // this example is just showing the usage of "ContainerApps_ListSecrets" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -251,7 +278,7 @@ public async Task GetSecrets_ListContainerAppsSecrets() // for more information of creating ContainerAppResource, please refer to the document of ContainerAppResource string subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; string resourceGroupName = "rg"; - string containerAppName = "testcontainerapp0"; + string containerAppName = "testcontainerApp0"; ResourceIdentifier containerAppResourceId = ContainerAppResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, containerAppName); ContainerAppResource containerApp = client.GetContainerAppResource(containerAppResourceId); @@ -268,7 +295,7 @@ public async Task GetSecrets_ListContainerAppsSecrets() [Ignore("Only validating compilation of examples")] public async Task GetAuthToken_GetContainerAppAuthToken() { - // Generated from example definition: specification/app/resource-manager/Microsoft.App/stable/2025-01-01/examples/ContainerApps_GetAuthToken.json + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/ContainerApps_GetAuthToken.json // this example is just showing the usage of "ContainerApps_GetAuthToken" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -280,7 +307,7 @@ public async Task GetAuthToken_GetContainerAppAuthToken() // for more information of creating ContainerAppResource, please refer to the document of ContainerAppResource string subscriptionId = "651f8027-33e8-4ec4-97b4-f6e9f3dc8744"; string resourceGroupName = "rg"; - string containerAppName = "testcontainerapp0"; + string containerAppName = "testcontainerApp0"; ResourceIdentifier containerAppResourceId = ContainerAppResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, containerAppName); ContainerAppResource containerApp = client.GetContainerAppResource(containerAppResourceId); @@ -294,7 +321,7 @@ public async Task GetAuthToken_GetContainerAppAuthToken() [Ignore("Only validating compilation of examples")] public async Task Start_StartContainerApp() { - // Generated from example definition: specification/app/resource-manager/Microsoft.App/stable/2025-01-01/examples/ContainerApps_Start.json + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/ContainerApps_Start.json // this example is just showing the usage of "ContainerApps_Start" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -306,7 +333,7 @@ public async Task Start_StartContainerApp() // for more information of creating ContainerAppResource, please refer to the document of ContainerAppResource string subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; string resourceGroupName = "rg"; - string containerAppName = "testworkerapp0"; + string containerAppName = "testWorkerApp0"; ResourceIdentifier containerAppResourceId = ContainerAppResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, containerAppName); ContainerAppResource containerApp = client.GetContainerAppResource(containerAppResourceId); @@ -325,7 +352,7 @@ public async Task Start_StartContainerApp() [Ignore("Only validating compilation of examples")] public async Task Stop_StopContainerApp() { - // Generated from example definition: specification/app/resource-manager/Microsoft.App/stable/2025-01-01/examples/ContainerApps_Stop.json + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/ContainerApps_Stop.json // this example is just showing the usage of "ContainerApps_Stop" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -337,7 +364,7 @@ public async Task Stop_StopContainerApp() // for more information of creating ContainerAppResource, please refer to the document of ContainerAppResource string subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; string resourceGroupName = "rg"; - string containerAppName = "testworkerApp0"; + string containerAppName = "testWorkerApp0"; ResourceIdentifier containerAppResourceId = ContainerAppResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, containerAppName); ContainerAppResource containerApp = client.GetContainerAppResource(containerAppResourceId); diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/tests/Generated/Samples/Sample_ContainerAppRevisionCollection.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/tests/Generated/Samples/Sample_ContainerAppRevisionCollection.cs index dc179e503739..209b983030b2 100644 --- a/sdk/containerapps/Azure.ResourceManager.AppContainers/tests/Generated/Samples/Sample_ContainerAppRevisionCollection.cs +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/tests/Generated/Samples/Sample_ContainerAppRevisionCollection.cs @@ -19,7 +19,7 @@ public partial class Sample_ContainerAppRevisionCollection [Ignore("Only validating compilation of examples")] public async Task Get_GetContainerAppSRevision() { - // Generated from example definition: specification/app/resource-manager/Microsoft.App/stable/2025-01-01/examples/Revisions_Get.json + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/Revisions_Get.json // this example is just showing the usage of "ContainerAppsRevisions_GetRevision" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -53,7 +53,7 @@ public async Task Get_GetContainerAppSRevision() [Ignore("Only validating compilation of examples")] public async Task GetAll_ListContainerAppSRevisions() { - // Generated from example definition: specification/app/resource-manager/Microsoft.App/stable/2025-01-01/examples/Revisions_List.json + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/Revisions_List.json // this example is just showing the usage of "ContainerAppsRevisions_ListRevisions" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -89,7 +89,7 @@ public async Task GetAll_ListContainerAppSRevisions() [Ignore("Only validating compilation of examples")] public async Task Exists_GetContainerAppSRevision() { - // Generated from example definition: specification/app/resource-manager/Microsoft.App/stable/2025-01-01/examples/Revisions_Get.json + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/Revisions_Get.json // this example is just showing the usage of "ContainerAppsRevisions_GetRevision" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -119,7 +119,7 @@ public async Task Exists_GetContainerAppSRevision() [Ignore("Only validating compilation of examples")] public async Task GetIfExists_GetContainerAppSRevision() { - // Generated from example definition: specification/app/resource-manager/Microsoft.App/stable/2025-01-01/examples/Revisions_Get.json + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/Revisions_Get.json // this example is just showing the usage of "ContainerAppsRevisions_GetRevision" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/tests/Generated/Samples/Sample_ContainerAppRevisionResource.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/tests/Generated/Samples/Sample_ContainerAppRevisionResource.cs index 0c2ad50a27a7..8f50c4090e76 100644 --- a/sdk/containerapps/Azure.ResourceManager.AppContainers/tests/Generated/Samples/Sample_ContainerAppRevisionResource.cs +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/tests/Generated/Samples/Sample_ContainerAppRevisionResource.cs @@ -19,7 +19,7 @@ public partial class Sample_ContainerAppRevisionResource [Ignore("Only validating compilation of examples")] public async Task Get_GetContainerAppSRevision() { - // Generated from example definition: specification/app/resource-manager/Microsoft.App/stable/2025-01-01/examples/Revisions_Get.json + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/Revisions_Get.json // this example is just showing the usage of "ContainerAppsRevisions_GetRevision" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -50,7 +50,7 @@ public async Task Get_GetContainerAppSRevision() [Ignore("Only validating compilation of examples")] public async Task ActivateRevision_ActivateContainerAppSRevision() { - // Generated from example definition: specification/app/resource-manager/Microsoft.App/stable/2025-01-01/examples/Revisions_Activate.json + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/Revisions_Activate.json // this example is just showing the usage of "ContainerAppsRevisions_ActivateRevision" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -77,7 +77,7 @@ public async Task ActivateRevision_ActivateContainerAppSRevision() [Ignore("Only validating compilation of examples")] public async Task DeactivateRevision_DeactivateContainerAppSRevision() { - // Generated from example definition: specification/app/resource-manager/Microsoft.App/stable/2025-01-01/examples/Revisions_Deactivate.json + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/Revisions_Deactivate.json // this example is just showing the usage of "ContainerAppsRevisions_DeactivateRevision" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -104,7 +104,7 @@ public async Task DeactivateRevision_DeactivateContainerAppSRevision() [Ignore("Only validating compilation of examples")] public async Task RestartRevision_RestartContainerAppSRevision() { - // Generated from example definition: specification/app/resource-manager/Microsoft.App/stable/2025-01-01/examples/Revisions_Restart.json + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/Revisions_Restart.json // this example is just showing the usage of "ContainerAppsRevisions_RestartRevision" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -126,5 +126,33 @@ public async Task RestartRevision_RestartContainerAppSRevision() Console.WriteLine("Succeeded"); } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task InvokeFunctionsHostFunctionsExtension_InvokeFunctionsHostUsingFunctionsExtensionAPI() + { + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/FunctionsExtension_Post.json + // this example is just showing the usage of "FunctionsExtension_InvokeFunctionsHost" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ContainerAppRevisionResource created on azure + // for more information of creating ContainerAppRevisionResource, please refer to the document of ContainerAppRevisionResource + string subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; + string resourceGroupName = "rg"; + string containerAppName = "testcontainerApp0"; + string revisionName = "testcontainerApp0-pjxhsye"; + ResourceIdentifier containerAppRevisionResourceId = ContainerAppRevisionResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, containerAppName, revisionName); + ContainerAppRevisionResource containerAppRevision = client.GetContainerAppRevisionResource(containerAppRevisionResourceId); + + // invoke the operation + string functionAppName = "testcontainerApp0"; + string result = await containerAppRevision.InvokeFunctionsHostFunctionsExtensionAsync(functionAppName); + + Console.WriteLine($"Succeeded: {result}"); + } } } diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/tests/Generated/Samples/Sample_ContainerAppSourceControlCollection.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/tests/Generated/Samples/Sample_ContainerAppSourceControlCollection.cs index f58444f3d7b8..347ed8cfacc1 100644 --- a/sdk/containerapps/Azure.ResourceManager.AppContainers/tests/Generated/Samples/Sample_ContainerAppSourceControlCollection.cs +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/tests/Generated/Samples/Sample_ContainerAppSourceControlCollection.cs @@ -20,7 +20,7 @@ public partial class Sample_ContainerAppSourceControlCollection [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_CreateOrUpdateContainerAppSourceControl() { - // Generated from example definition: specification/app/resource-manager/Microsoft.App/stable/2025-01-01/examples/SourceControls_CreateOrUpdate.json + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/SourceControls_CreateOrUpdate.json // this example is just showing the usage of "ContainerAppsSourceControls_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -61,11 +61,14 @@ public async Task CreateOrUpdate_CreateOrUpdateContainerAppSourceControl() Kind = "feaderated", }, ContextPath = "./", + DockerfilePath = "./Dockerfile", GitHubPersonalAccessToken = "test", Image = "image/tag", + BuildEnvironmentVariables = { new ContainerAppSimpleEnvironmentVariable("foo1", "bar1"), new ContainerAppSimpleEnvironmentVariable("foo2", "bar2") }, }, }; - ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, sourceControlName, data); + string xMsGitHubAuxiliary = "githubaccesstoken"; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, sourceControlName, data, xMsGitHubAuxiliary: xMsGitHubAuxiliary); ContainerAppSourceControlResource result = lro.Value; // the variable result is a resource, you could call other operations on this instance as well @@ -79,7 +82,7 @@ public async Task CreateOrUpdate_CreateOrUpdateContainerAppSourceControl() [Ignore("Only validating compilation of examples")] public async Task Get_GetContainerAppSSourceControl() { - // Generated from example definition: specification/app/resource-manager/Microsoft.App/stable/2025-01-01/examples/SourceControls_Get.json + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/SourceControls_Get.json // this example is just showing the usage of "ContainerAppsSourceControls_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -113,7 +116,7 @@ public async Task Get_GetContainerAppSSourceControl() [Ignore("Only validating compilation of examples")] public async Task GetAll_ListAppSSourceControls() { - // Generated from example definition: specification/app/resource-manager/Microsoft.App/stable/2025-01-01/examples/SourceControls_ListByContainer.json + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/SourceControls_ListByContainer.json // this example is just showing the usage of "ContainerAppsSourceControls_ListByContainerApp" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -149,7 +152,7 @@ public async Task GetAll_ListAppSSourceControls() [Ignore("Only validating compilation of examples")] public async Task Exists_GetContainerAppSSourceControl() { - // Generated from example definition: specification/app/resource-manager/Microsoft.App/stable/2025-01-01/examples/SourceControls_Get.json + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/SourceControls_Get.json // this example is just showing the usage of "ContainerAppsSourceControls_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -179,7 +182,7 @@ public async Task Exists_GetContainerAppSSourceControl() [Ignore("Only validating compilation of examples")] public async Task GetIfExists_GetContainerAppSSourceControl() { - // Generated from example definition: specification/app/resource-manager/Microsoft.App/stable/2025-01-01/examples/SourceControls_Get.json + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/SourceControls_Get.json // this example is just showing the usage of "ContainerAppsSourceControls_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/tests/Generated/Samples/Sample_ContainerAppSourceControlResource.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/tests/Generated/Samples/Sample_ContainerAppSourceControlResource.cs index 8f5c7f1ec1dd..f5c53a9b90d5 100644 --- a/sdk/containerapps/Azure.ResourceManager.AppContainers/tests/Generated/Samples/Sample_ContainerAppSourceControlResource.cs +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/tests/Generated/Samples/Sample_ContainerAppSourceControlResource.cs @@ -20,7 +20,7 @@ public partial class Sample_ContainerAppSourceControlResource [Ignore("Only validating compilation of examples")] public async Task Get_GetContainerAppSSourceControl() { - // Generated from example definition: specification/app/resource-manager/Microsoft.App/stable/2025-01-01/examples/SourceControls_Get.json + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/SourceControls_Get.json // this example is just showing the usage of "ContainerAppsSourceControls_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -51,7 +51,7 @@ public async Task Get_GetContainerAppSSourceControl() [Ignore("Only validating compilation of examples")] public async Task Delete_DeleteContainerAppSourceControl() { - // Generated from example definition: specification/app/resource-manager/Microsoft.App/stable/2025-01-01/examples/SourceControls_Delete.json + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/SourceControls_Delete.json // this example is just showing the usage of "ContainerAppsSourceControls_Delete" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -69,7 +69,10 @@ public async Task Delete_DeleteContainerAppSourceControl() ContainerAppSourceControlResource containerAppSourceControl = client.GetContainerAppSourceControlResource(containerAppSourceControlResourceId); // invoke the operation - await containerAppSourceControl.DeleteAsync(WaitUntil.Completed); + string xMsGitHubAuxiliary = "githubaccesstoken"; + bool? ignoreWorkflowDeletionFailure = false; + bool? deleteWorkflow = false; + await containerAppSourceControl.DeleteAsync(WaitUntil.Completed, xMsGitHubAuxiliary: xMsGitHubAuxiliary, ignoreWorkflowDeletionFailure: ignoreWorkflowDeletionFailure, deleteWorkflow: deleteWorkflow); Console.WriteLine("Succeeded"); } @@ -78,7 +81,7 @@ public async Task Delete_DeleteContainerAppSourceControl() [Ignore("Only validating compilation of examples")] public async Task Update_CreateOrUpdateContainerAppSourceControl() { - // Generated from example definition: specification/app/resource-manager/Microsoft.App/stable/2025-01-01/examples/SourceControls_CreateOrUpdate.json + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/SourceControls_CreateOrUpdate.json // this example is just showing the usage of "ContainerAppsSourceControls_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -116,11 +119,14 @@ public async Task Update_CreateOrUpdateContainerAppSourceControl() Kind = "feaderated", }, ContextPath = "./", + DockerfilePath = "./Dockerfile", GitHubPersonalAccessToken = "test", Image = "image/tag", + BuildEnvironmentVariables = { new ContainerAppSimpleEnvironmentVariable("foo1", "bar1"), new ContainerAppSimpleEnvironmentVariable("foo2", "bar2") }, }, }; - ArmOperation lro = await containerAppSourceControl.UpdateAsync(WaitUntil.Completed, data); + string xMsGitHubAuxiliary = "githubaccesstoken"; + ArmOperation lro = await containerAppSourceControl.UpdateAsync(WaitUntil.Completed, data, xMsGitHubAuxiliary: xMsGitHubAuxiliary); ContainerAppSourceControlResource result = lro.Value; // the variable result is a resource, you could call other operations on this instance as well diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/tests/Generated/Samples/Sample_ContainerAppsBuildResource.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/tests/Generated/Samples/Sample_ContainerAppsBuildResource.cs new file mode 100644 index 000000000000..c114e47e8a29 --- /dev/null +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/tests/Generated/Samples/Sample_ContainerAppsBuildResource.cs @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using NUnit.Framework; + +namespace Azure.ResourceManager.AppContainers.Samples +{ + public partial class Sample_ContainerAppsBuildResource + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_ContainerAppsBuildsGet0() + { + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/ContainerAppsBuilds_Get.json + // this example is just showing the usage of "ContainerAppsBuilds_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ContainerAppsBuildResource created on azure + // for more information of creating ContainerAppsBuildResource, please refer to the document of ContainerAppsBuildResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "rg"; + string containerAppName = "testCapp"; + string buildName = "testBuild"; + ResourceIdentifier containerAppsBuildResourceId = ContainerAppsBuildResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, containerAppName, buildName); + ContainerAppsBuildResource containerAppsBuildResource = client.GetContainerAppsBuildResource(containerAppsBuildResourceId); + + // invoke the operation + ContainerAppsBuildResource result = await containerAppsBuildResource.GetAsync(); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + ContainerAppsBuildResourceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Delete_ContainerAppsBuildsDelete0() + { + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/ContainerAppsBuilds_Delete.json + // this example is just showing the usage of "ContainerAppsBuilds_Delete" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ContainerAppsBuildResource created on azure + // for more information of creating ContainerAppsBuildResource, please refer to the document of ContainerAppsBuildResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "rg"; + string containerAppName = "testCapp"; + string buildName = "testBuild"; + ResourceIdentifier containerAppsBuildResourceId = ContainerAppsBuildResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, containerAppName, buildName); + ContainerAppsBuildResource containerAppsBuildResource = client.GetContainerAppsBuildResource(containerAppsBuildResourceId); + + // invoke the operation + await containerAppsBuildResource.DeleteAsync(WaitUntil.Completed); + + Console.WriteLine("Succeeded"); + } + } +} diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/tests/Generated/Samples/Sample_ContainerAppsBuildResourceCollection.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/tests/Generated/Samples/Sample_ContainerAppsBuildResourceCollection.cs new file mode 100644 index 000000000000..947c213cf606 --- /dev/null +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/tests/Generated/Samples/Sample_ContainerAppsBuildResourceCollection.cs @@ -0,0 +1,160 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using NUnit.Framework; + +namespace Azure.ResourceManager.AppContainers.Samples +{ + public partial class Sample_ContainerAppsBuildResourceCollection + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_ContainerAppsBuildsGet0() + { + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/ContainerAppsBuilds_Get.json + // this example is just showing the usage of "ContainerAppsBuilds_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ContainerAppResource created on azure + // for more information of creating ContainerAppResource, please refer to the document of ContainerAppResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "rg"; + string containerAppName = "testCapp"; + ResourceIdentifier containerAppResourceId = ContainerAppResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, containerAppName); + ContainerAppResource containerApp = client.GetContainerAppResource(containerAppResourceId); + + // get the collection of this ContainerAppsBuildResource + ContainerAppsBuildResourceCollection collection = containerApp.GetContainerAppsBuildResources(); + + // invoke the operation + string buildName = "testBuild"; + ContainerAppsBuildResource result = await collection.GetAsync(buildName); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + ContainerAppsBuildResourceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetAll_ContainerAppsBuildsListByContainerApp0() + { + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/ContainerAppsBuilds_ListByContainerApp.json + // this example is just showing the usage of "ContainerAppsBuildsByContainerApp_List" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ContainerAppResource created on azure + // for more information of creating ContainerAppResource, please refer to the document of ContainerAppResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "rg"; + string containerAppName = "testCapp"; + ResourceIdentifier containerAppResourceId = ContainerAppResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, containerAppName); + ContainerAppResource containerApp = client.GetContainerAppResource(containerAppResourceId); + + // get the collection of this ContainerAppsBuildResource + ContainerAppsBuildResourceCollection collection = containerApp.GetContainerAppsBuildResources(); + + // invoke the operation and iterate over the result + await foreach (ContainerAppsBuildResource item in collection.GetAllAsync()) + { + // the variable item is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + ContainerAppsBuildResourceData resourceData = item.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Exists_ContainerAppsBuildsGet0() + { + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/ContainerAppsBuilds_Get.json + // this example is just showing the usage of "ContainerAppsBuilds_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ContainerAppResource created on azure + // for more information of creating ContainerAppResource, please refer to the document of ContainerAppResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "rg"; + string containerAppName = "testCapp"; + ResourceIdentifier containerAppResourceId = ContainerAppResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, containerAppName); + ContainerAppResource containerApp = client.GetContainerAppResource(containerAppResourceId); + + // get the collection of this ContainerAppsBuildResource + ContainerAppsBuildResourceCollection collection = containerApp.GetContainerAppsBuildResources(); + + // invoke the operation + string buildName = "testBuild"; + bool result = await collection.ExistsAsync(buildName); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetIfExists_ContainerAppsBuildsGet0() + { + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/ContainerAppsBuilds_Get.json + // this example is just showing the usage of "ContainerAppsBuilds_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ContainerAppResource created on azure + // for more information of creating ContainerAppResource, please refer to the document of ContainerAppResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "rg"; + string containerAppName = "testCapp"; + ResourceIdentifier containerAppResourceId = ContainerAppResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, containerAppName); + ContainerAppResource containerApp = client.GetContainerAppResource(containerAppResourceId); + + // get the collection of this ContainerAppsBuildResource + ContainerAppsBuildResourceCollection collection = containerApp.GetContainerAppsBuildResources(); + + // invoke the operation + string buildName = "testBuild"; + NullableResponse response = await collection.GetIfExistsAsync(buildName); + ContainerAppsBuildResource result = response.HasValue ? response.Value : null; + + if (result == null) + { + Console.WriteLine("Succeeded with null as result"); + } + else + { + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + ContainerAppsBuildResourceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + } +} diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/tests/Generated/Samples/Sample_ContainerAppsPatchResource.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/tests/Generated/Samples/Sample_ContainerAppsPatchResource.cs new file mode 100644 index 000000000000..daa69fa437e8 --- /dev/null +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/tests/Generated/Samples/Sample_ContainerAppsPatchResource.cs @@ -0,0 +1,140 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.AppContainers.Models; +using NUnit.Framework; + +namespace Azure.ResourceManager.AppContainers.Samples +{ + public partial class Sample_ContainerAppsPatchResource + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_ContainerAppsPatchesGet0() + { + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/ContainerAppsPatches_Get.json + // this example is just showing the usage of "ContainerAppsPatches_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ContainerAppsPatchResource created on azure + // for more information of creating ContainerAppsPatchResource, please refer to the document of ContainerAppsPatchResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "rg"; + string containerAppName = "test-app"; + string patchName = "testPatch-25fe4b"; + ResourceIdentifier containerAppsPatchResourceId = ContainerAppsPatchResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, containerAppName, patchName); + ContainerAppsPatchResource containerAppsPatchResource = client.GetContainerAppsPatchResource(containerAppsPatchResourceId); + + // invoke the operation + ContainerAppsPatchResource result = await containerAppsPatchResource.GetAsync(); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + ContainerAppsPatchResourceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Delete_ContainerAppsPatchesDelete0() + { + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/ContainerAppsPatches_Delete.json + // this example is just showing the usage of "ContainerAppsPatches_Delete" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ContainerAppsPatchResource created on azure + // for more information of creating ContainerAppsPatchResource, please refer to the document of ContainerAppsPatchResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "rg"; + string containerAppName = "test-app"; + string patchName = "testPatch-25fe4b"; + ResourceIdentifier containerAppsPatchResourceId = ContainerAppsPatchResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, containerAppName, patchName); + ContainerAppsPatchResource containerAppsPatchResource = client.GetContainerAppsPatchResource(containerAppsPatchResourceId); + + // invoke the operation + await containerAppsPatchResource.DeleteAsync(WaitUntil.Completed); + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task SkipConfigure_ContainerAppsPatchesSkipConfigure0() + { + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/ContainerAppsPatches_Skip_Configure.json + // this example is just showing the usage of "ContainerAppsPatches_SkipConfigure" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ContainerAppsPatchResource created on azure + // for more information of creating ContainerAppsPatchResource, please refer to the document of ContainerAppsPatchResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "rg"; + string containerAppName = "test-app"; + string patchName = "testPatch-25fe4b"; + ResourceIdentifier containerAppsPatchResourceId = ContainerAppsPatchResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, containerAppName, patchName); + ContainerAppsPatchResource containerAppsPatchResource = client.GetContainerAppsPatchResource(containerAppsPatchResourceId); + + // invoke the operation + PatchSkipConfig patchSkipConfig = new PatchSkipConfig + { + Skip = true, + }; + await containerAppsPatchResource.SkipConfigureAsync(WaitUntil.Completed, patchSkipConfig); + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Apply_ContainerAppsPatchesApply0() + { + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/ContainerAppsPatches_Apply.json + // this example is just showing the usage of "ContainerAppsPatches_Apply" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ContainerAppsPatchResource created on azure + // for more information of creating ContainerAppsPatchResource, please refer to the document of ContainerAppsPatchResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "rg"; + string containerAppName = "test-app"; + string patchName = "testPatch-25fe4b"; + ResourceIdentifier containerAppsPatchResourceId = ContainerAppsPatchResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, containerAppName, patchName); + ContainerAppsPatchResource containerAppsPatchResource = client.GetContainerAppsPatchResource(containerAppsPatchResourceId); + + // invoke the operation + ArmOperation lro = await containerAppsPatchResource.ApplyAsync(WaitUntil.Completed); + ContainerAppsPatchResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + ContainerAppsPatchResourceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } +} diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/tests/Generated/Samples/Sample_ContainerAppsPatchResourceCollection.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/tests/Generated/Samples/Sample_ContainerAppsPatchResourceCollection.cs new file mode 100644 index 000000000000..3243baa833fd --- /dev/null +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/tests/Generated/Samples/Sample_ContainerAppsPatchResourceCollection.cs @@ -0,0 +1,160 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using NUnit.Framework; + +namespace Azure.ResourceManager.AppContainers.Samples +{ + public partial class Sample_ContainerAppsPatchResourceCollection + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_ContainerAppsPatchesGet0() + { + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/ContainerAppsPatches_Get.json + // this example is just showing the usage of "ContainerAppsPatches_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ContainerAppResource created on azure + // for more information of creating ContainerAppResource, please refer to the document of ContainerAppResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "rg"; + string containerAppName = "test-app"; + ResourceIdentifier containerAppResourceId = ContainerAppResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, containerAppName); + ContainerAppResource containerApp = client.GetContainerAppResource(containerAppResourceId); + + // get the collection of this ContainerAppsPatchResource + ContainerAppsPatchResourceCollection collection = containerApp.GetContainerAppsPatchResources(); + + // invoke the operation + string patchName = "testPatch-25fe4b"; + ContainerAppsPatchResource result = await collection.GetAsync(patchName); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + ContainerAppsPatchResourceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetAll_ContainerAppsPatchesListByContainerApp0() + { + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/ContainerAppsPatches_ListByContainerApp.json + // this example is just showing the usage of "ContainerAppsPatches_ListByContainerApp" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ContainerAppResource created on azure + // for more information of creating ContainerAppResource, please refer to the document of ContainerAppResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "rg"; + string containerAppName = "test-app"; + ResourceIdentifier containerAppResourceId = ContainerAppResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, containerAppName); + ContainerAppResource containerApp = client.GetContainerAppResource(containerAppResourceId); + + // get the collection of this ContainerAppsPatchResource + ContainerAppsPatchResourceCollection collection = containerApp.GetContainerAppsPatchResources(); + + // invoke the operation and iterate over the result + await foreach (ContainerAppsPatchResource item in collection.GetAllAsync()) + { + // the variable item is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + ContainerAppsPatchResourceData resourceData = item.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Exists_ContainerAppsPatchesGet0() + { + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/ContainerAppsPatches_Get.json + // this example is just showing the usage of "ContainerAppsPatches_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ContainerAppResource created on azure + // for more information of creating ContainerAppResource, please refer to the document of ContainerAppResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "rg"; + string containerAppName = "test-app"; + ResourceIdentifier containerAppResourceId = ContainerAppResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, containerAppName); + ContainerAppResource containerApp = client.GetContainerAppResource(containerAppResourceId); + + // get the collection of this ContainerAppsPatchResource + ContainerAppsPatchResourceCollection collection = containerApp.GetContainerAppsPatchResources(); + + // invoke the operation + string patchName = "testPatch-25fe4b"; + bool result = await collection.ExistsAsync(patchName); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetIfExists_ContainerAppsPatchesGet0() + { + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/ContainerAppsPatches_Get.json + // this example is just showing the usage of "ContainerAppsPatches_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ContainerAppResource created on azure + // for more information of creating ContainerAppResource, please refer to the document of ContainerAppResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "rg"; + string containerAppName = "test-app"; + ResourceIdentifier containerAppResourceId = ContainerAppResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, containerAppName); + ContainerAppResource containerApp = client.GetContainerAppResource(containerAppResourceId); + + // get the collection of this ContainerAppsPatchResource + ContainerAppsPatchResourceCollection collection = containerApp.GetContainerAppsPatchResources(); + + // invoke the operation + string patchName = "testPatch-25fe4b"; + NullableResponse response = await collection.GetIfExistsAsync(patchName); + ContainerAppsPatchResource result = response.HasValue ? response.Value : null; + + if (result == null) + { + Console.WriteLine("Succeeded with null as result"); + } + else + { + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + ContainerAppsPatchResourceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + } +} diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/tests/Generated/Samples/Sample_DaprComponentResiliencyPolicyCollection.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/tests/Generated/Samples/Sample_DaprComponentResiliencyPolicyCollection.cs new file mode 100644 index 000000000000..05094746bbbb --- /dev/null +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/tests/Generated/Samples/Sample_DaprComponentResiliencyPolicyCollection.cs @@ -0,0 +1,360 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.AppContainers.Models; +using NUnit.Framework; + +namespace Azure.ResourceManager.AppContainers.Samples +{ + public partial class Sample_DaprComponentResiliencyPolicyCollection + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task CreateOrUpdate_CreateOrUpdateDaprComponentResiliencyPolicyWithAllOptions() + { + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/DaprComponentResiliencyPolicy_CreateOrUpdate_AllOptions.json + // this example is just showing the usage of "DaprComponentResiliencyPolicies_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ContainerAppManagedEnvironmentDaprComponentResource created on azure + // for more information of creating ContainerAppManagedEnvironmentDaprComponentResource, please refer to the document of ContainerAppManagedEnvironmentDaprComponentResource + string subscriptionId = "8efdecc5-919e-44eb-b179-915dca89ebf9"; + string resourceGroupName = "examplerg"; + string environmentName = "myenvironment"; + string componentName = "mydaprcomponent"; + ResourceIdentifier containerAppManagedEnvironmentDaprComponentResourceId = ContainerAppManagedEnvironmentDaprComponentResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, environmentName, componentName); + ContainerAppManagedEnvironmentDaprComponentResource containerAppManagedEnvironmentDaprComponent = client.GetContainerAppManagedEnvironmentDaprComponentResource(containerAppManagedEnvironmentDaprComponentResourceId); + + // get the collection of this DaprComponentResiliencyPolicyResource + DaprComponentResiliencyPolicyCollection collection = containerAppManagedEnvironmentDaprComponent.GetDaprComponentResiliencyPolicies(); + + // invoke the operation + string name = "myresiliencypolicy"; + DaprComponentResiliencyPolicyData data = new DaprComponentResiliencyPolicyData + { + InboundPolicy = new DaprComponentResiliencyPolicyConfiguration + { + HttpRetryPolicy = new DaprComponentResiliencyPolicyHttpRetryPolicyConfiguration + { + MaxRetries = 15, + RetryBackOff = new DaprComponentResiliencyPolicyHttpRetryBackOffConfiguration + { + InitialDelayInMilliseconds = 2000, + MaxIntervalInMilliseconds = 5500, + }, + }, + ResponseTimeoutInSeconds = 30, + CircuitBreakerPolicy = new DaprComponentResiliencyPolicyCircuitBreakerPolicyConfiguration + { + ConsecutiveErrors = 5, + TimeoutInSeconds = 10, + IntervalInSeconds = 4, + }, + }, + OutboundPolicy = new DaprComponentResiliencyPolicyConfiguration + { + HttpRetryPolicy = new DaprComponentResiliencyPolicyHttpRetryPolicyConfiguration + { + MaxRetries = 5, + RetryBackOff = new DaprComponentResiliencyPolicyHttpRetryBackOffConfiguration + { + InitialDelayInMilliseconds = 100, + MaxIntervalInMilliseconds = 30000, + }, + }, + ResponseTimeoutInSeconds = 12, + CircuitBreakerPolicy = new DaprComponentResiliencyPolicyCircuitBreakerPolicyConfiguration + { + ConsecutiveErrors = 3, + TimeoutInSeconds = 20, + IntervalInSeconds = 60, + }, + }, + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, name, data); + DaprComponentResiliencyPolicyResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + DaprComponentResiliencyPolicyData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task CreateOrUpdate_CreateOrUpdateDaprComponentResiliencyPolicyWithOutboundPolicyOnly() + { + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/DaprComponentResiliencyPolicy_CreateOrUpdate_OutboundOnly.json + // this example is just showing the usage of "DaprComponentResiliencyPolicies_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ContainerAppManagedEnvironmentDaprComponentResource created on azure + // for more information of creating ContainerAppManagedEnvironmentDaprComponentResource, please refer to the document of ContainerAppManagedEnvironmentDaprComponentResource + string subscriptionId = "8efdecc5-919e-44eb-b179-915dca89ebf9"; + string resourceGroupName = "examplerg"; + string environmentName = "myenvironment"; + string componentName = "mydaprcomponent"; + ResourceIdentifier containerAppManagedEnvironmentDaprComponentResourceId = ContainerAppManagedEnvironmentDaprComponentResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, environmentName, componentName); + ContainerAppManagedEnvironmentDaprComponentResource containerAppManagedEnvironmentDaprComponent = client.GetContainerAppManagedEnvironmentDaprComponentResource(containerAppManagedEnvironmentDaprComponentResourceId); + + // get the collection of this DaprComponentResiliencyPolicyResource + DaprComponentResiliencyPolicyCollection collection = containerAppManagedEnvironmentDaprComponent.GetDaprComponentResiliencyPolicies(); + + // invoke the operation + string name = "myresiliencypolicy"; + DaprComponentResiliencyPolicyData data = new DaprComponentResiliencyPolicyData + { + OutboundPolicy = new DaprComponentResiliencyPolicyConfiguration + { + HttpRetryPolicy = new DaprComponentResiliencyPolicyHttpRetryPolicyConfiguration + { + MaxRetries = 5, + RetryBackOff = new DaprComponentResiliencyPolicyHttpRetryBackOffConfiguration + { + InitialDelayInMilliseconds = 100, + MaxIntervalInMilliseconds = 30000, + }, + }, + ResponseTimeoutInSeconds = 12, + CircuitBreakerPolicy = new DaprComponentResiliencyPolicyCircuitBreakerPolicyConfiguration + { + ConsecutiveErrors = 3, + TimeoutInSeconds = 20, + IntervalInSeconds = 60, + }, + }, + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, name, data); + DaprComponentResiliencyPolicyResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + DaprComponentResiliencyPolicyData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task CreateOrUpdate_CreateOrUpdateDaprComponentResiliencyPolicyWithSparseOptions() + { + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/DaprComponentResiliencyPolicy_CreateOrUpdate_SparseOptions.json + // this example is just showing the usage of "DaprComponentResiliencyPolicies_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ContainerAppManagedEnvironmentDaprComponentResource created on azure + // for more information of creating ContainerAppManagedEnvironmentDaprComponentResource, please refer to the document of ContainerAppManagedEnvironmentDaprComponentResource + string subscriptionId = "8efdecc5-919e-44eb-b179-915dca89ebf9"; + string resourceGroupName = "examplerg"; + string environmentName = "myenvironment"; + string componentName = "mydaprcomponent"; + ResourceIdentifier containerAppManagedEnvironmentDaprComponentResourceId = ContainerAppManagedEnvironmentDaprComponentResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, environmentName, componentName); + ContainerAppManagedEnvironmentDaprComponentResource containerAppManagedEnvironmentDaprComponent = client.GetContainerAppManagedEnvironmentDaprComponentResource(containerAppManagedEnvironmentDaprComponentResourceId); + + // get the collection of this DaprComponentResiliencyPolicyResource + DaprComponentResiliencyPolicyCollection collection = containerAppManagedEnvironmentDaprComponent.GetDaprComponentResiliencyPolicies(); + + // invoke the operation + string name = "myresiliencypolicy"; + DaprComponentResiliencyPolicyData data = new DaprComponentResiliencyPolicyData + { + InboundPolicy = new DaprComponentResiliencyPolicyConfiguration + { + HttpRetryPolicy = new DaprComponentResiliencyPolicyHttpRetryPolicyConfiguration + { + MaxRetries = 5, + RetryBackOff = new DaprComponentResiliencyPolicyHttpRetryBackOffConfiguration + { + InitialDelayInMilliseconds = 2000, + MaxIntervalInMilliseconds = 5500, + }, + }, + CircuitBreakerPolicy = new DaprComponentResiliencyPolicyCircuitBreakerPolicyConfiguration + { + ConsecutiveErrors = 3, + TimeoutInSeconds = 20, + }, + }, + OutboundPolicy = new DaprComponentResiliencyPolicyConfiguration + { + ResponseTimeoutInSeconds = 12, + }, + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, name, data); + DaprComponentResiliencyPolicyResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + DaprComponentResiliencyPolicyData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_GetDaprComponentResiliencyPolicy() + { + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/DaprComponentResiliencyPolicies_Get.json + // this example is just showing the usage of "DaprComponentResiliencyPolicies_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ContainerAppManagedEnvironmentDaprComponentResource created on azure + // for more information of creating ContainerAppManagedEnvironmentDaprComponentResource, please refer to the document of ContainerAppManagedEnvironmentDaprComponentResource + string subscriptionId = "8efdecc5-919e-44eb-b179-915dca89ebf9"; + string resourceGroupName = "examplerg"; + string environmentName = "myenvironment"; + string componentName = "mydaprcomponent"; + ResourceIdentifier containerAppManagedEnvironmentDaprComponentResourceId = ContainerAppManagedEnvironmentDaprComponentResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, environmentName, componentName); + ContainerAppManagedEnvironmentDaprComponentResource containerAppManagedEnvironmentDaprComponent = client.GetContainerAppManagedEnvironmentDaprComponentResource(containerAppManagedEnvironmentDaprComponentResourceId); + + // get the collection of this DaprComponentResiliencyPolicyResource + DaprComponentResiliencyPolicyCollection collection = containerAppManagedEnvironmentDaprComponent.GetDaprComponentResiliencyPolicies(); + + // invoke the operation + string name = "myresiliencypolicy"; + DaprComponentResiliencyPolicyResource result = await collection.GetAsync(name); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + DaprComponentResiliencyPolicyData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetAll_ListDaprComponentResiliencyPolicies() + { + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/DaprComponentResiliencyPolicies_List.json + // this example is just showing the usage of "DaprComponentResiliencyPolicies_List" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ContainerAppManagedEnvironmentDaprComponentResource created on azure + // for more information of creating ContainerAppManagedEnvironmentDaprComponentResource, please refer to the document of ContainerAppManagedEnvironmentDaprComponentResource + string subscriptionId = "8efdecc5-919e-44eb-b179-915dca89ebf9"; + string resourceGroupName = "examplerg"; + string environmentName = "myenvironment"; + string componentName = "mydaprcomponent"; + ResourceIdentifier containerAppManagedEnvironmentDaprComponentResourceId = ContainerAppManagedEnvironmentDaprComponentResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, environmentName, componentName); + ContainerAppManagedEnvironmentDaprComponentResource containerAppManagedEnvironmentDaprComponent = client.GetContainerAppManagedEnvironmentDaprComponentResource(containerAppManagedEnvironmentDaprComponentResourceId); + + // get the collection of this DaprComponentResiliencyPolicyResource + DaprComponentResiliencyPolicyCollection collection = containerAppManagedEnvironmentDaprComponent.GetDaprComponentResiliencyPolicies(); + + // invoke the operation and iterate over the result + await foreach (DaprComponentResiliencyPolicyResource item in collection.GetAllAsync()) + { + // the variable item is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + DaprComponentResiliencyPolicyData resourceData = item.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Exists_GetDaprComponentResiliencyPolicy() + { + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/DaprComponentResiliencyPolicies_Get.json + // this example is just showing the usage of "DaprComponentResiliencyPolicies_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ContainerAppManagedEnvironmentDaprComponentResource created on azure + // for more information of creating ContainerAppManagedEnvironmentDaprComponentResource, please refer to the document of ContainerAppManagedEnvironmentDaprComponentResource + string subscriptionId = "8efdecc5-919e-44eb-b179-915dca89ebf9"; + string resourceGroupName = "examplerg"; + string environmentName = "myenvironment"; + string componentName = "mydaprcomponent"; + ResourceIdentifier containerAppManagedEnvironmentDaprComponentResourceId = ContainerAppManagedEnvironmentDaprComponentResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, environmentName, componentName); + ContainerAppManagedEnvironmentDaprComponentResource containerAppManagedEnvironmentDaprComponent = client.GetContainerAppManagedEnvironmentDaprComponentResource(containerAppManagedEnvironmentDaprComponentResourceId); + + // get the collection of this DaprComponentResiliencyPolicyResource + DaprComponentResiliencyPolicyCollection collection = containerAppManagedEnvironmentDaprComponent.GetDaprComponentResiliencyPolicies(); + + // invoke the operation + string name = "myresiliencypolicy"; + bool result = await collection.ExistsAsync(name); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetIfExists_GetDaprComponentResiliencyPolicy() + { + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/DaprComponentResiliencyPolicies_Get.json + // this example is just showing the usage of "DaprComponentResiliencyPolicies_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ContainerAppManagedEnvironmentDaprComponentResource created on azure + // for more information of creating ContainerAppManagedEnvironmentDaprComponentResource, please refer to the document of ContainerAppManagedEnvironmentDaprComponentResource + string subscriptionId = "8efdecc5-919e-44eb-b179-915dca89ebf9"; + string resourceGroupName = "examplerg"; + string environmentName = "myenvironment"; + string componentName = "mydaprcomponent"; + ResourceIdentifier containerAppManagedEnvironmentDaprComponentResourceId = ContainerAppManagedEnvironmentDaprComponentResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, environmentName, componentName); + ContainerAppManagedEnvironmentDaprComponentResource containerAppManagedEnvironmentDaprComponent = client.GetContainerAppManagedEnvironmentDaprComponentResource(containerAppManagedEnvironmentDaprComponentResourceId); + + // get the collection of this DaprComponentResiliencyPolicyResource + DaprComponentResiliencyPolicyCollection collection = containerAppManagedEnvironmentDaprComponent.GetDaprComponentResiliencyPolicies(); + + // invoke the operation + string name = "myresiliencypolicy"; + NullableResponse response = await collection.GetIfExistsAsync(name); + DaprComponentResiliencyPolicyResource result = response.HasValue ? response.Value : null; + + if (result == null) + { + Console.WriteLine("Succeeded with null as result"); + } + else + { + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + DaprComponentResiliencyPolicyData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + } +} diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/tests/Generated/Samples/Sample_DaprComponentResiliencyPolicyResource.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/tests/Generated/Samples/Sample_DaprComponentResiliencyPolicyResource.cs new file mode 100644 index 000000000000..d26073957a53 --- /dev/null +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/tests/Generated/Samples/Sample_DaprComponentResiliencyPolicyResource.cs @@ -0,0 +1,265 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.AppContainers.Models; +using NUnit.Framework; + +namespace Azure.ResourceManager.AppContainers.Samples +{ + public partial class Sample_DaprComponentResiliencyPolicyResource + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_GetDaprComponentResiliencyPolicy() + { + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/DaprComponentResiliencyPolicies_Get.json + // this example is just showing the usage of "DaprComponentResiliencyPolicies_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this DaprComponentResiliencyPolicyResource created on azure + // for more information of creating DaprComponentResiliencyPolicyResource, please refer to the document of DaprComponentResiliencyPolicyResource + string subscriptionId = "8efdecc5-919e-44eb-b179-915dca89ebf9"; + string resourceGroupName = "examplerg"; + string environmentName = "myenvironment"; + string componentName = "mydaprcomponent"; + string name = "myresiliencypolicy"; + ResourceIdentifier daprComponentResiliencyPolicyResourceId = DaprComponentResiliencyPolicyResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, environmentName, componentName, name); + DaprComponentResiliencyPolicyResource daprComponentResiliencyPolicy = client.GetDaprComponentResiliencyPolicyResource(daprComponentResiliencyPolicyResourceId); + + // invoke the operation + DaprComponentResiliencyPolicyResource result = await daprComponentResiliencyPolicy.GetAsync(); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + DaprComponentResiliencyPolicyData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Delete_DeleteDaprComponentResiliencyPolicy() + { + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/DaprComponentResiliencyPolicies_Delete.json + // this example is just showing the usage of "DaprComponentResiliencyPolicies_Delete" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this DaprComponentResiliencyPolicyResource created on azure + // for more information of creating DaprComponentResiliencyPolicyResource, please refer to the document of DaprComponentResiliencyPolicyResource + string subscriptionId = "8efdecc5-919e-44eb-b179-915dca89ebf9"; + string resourceGroupName = "examplerg"; + string environmentName = "myenvironment"; + string componentName = "mydaprcomponent"; + string name = "myresiliencypolicy"; + ResourceIdentifier daprComponentResiliencyPolicyResourceId = DaprComponentResiliencyPolicyResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, environmentName, componentName, name); + DaprComponentResiliencyPolicyResource daprComponentResiliencyPolicy = client.GetDaprComponentResiliencyPolicyResource(daprComponentResiliencyPolicyResourceId); + + // invoke the operation + await daprComponentResiliencyPolicy.DeleteAsync(WaitUntil.Completed); + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Update_CreateOrUpdateDaprComponentResiliencyPolicyWithAllOptions() + { + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/DaprComponentResiliencyPolicy_CreateOrUpdate_AllOptions.json + // this example is just showing the usage of "DaprComponentResiliencyPolicies_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this DaprComponentResiliencyPolicyResource created on azure + // for more information of creating DaprComponentResiliencyPolicyResource, please refer to the document of DaprComponentResiliencyPolicyResource + string subscriptionId = "8efdecc5-919e-44eb-b179-915dca89ebf9"; + string resourceGroupName = "examplerg"; + string environmentName = "myenvironment"; + string componentName = "mydaprcomponent"; + string name = "myresiliencypolicy"; + ResourceIdentifier daprComponentResiliencyPolicyResourceId = DaprComponentResiliencyPolicyResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, environmentName, componentName, name); + DaprComponentResiliencyPolicyResource daprComponentResiliencyPolicy = client.GetDaprComponentResiliencyPolicyResource(daprComponentResiliencyPolicyResourceId); + + // invoke the operation + DaprComponentResiliencyPolicyData data = new DaprComponentResiliencyPolicyData + { + InboundPolicy = new DaprComponentResiliencyPolicyConfiguration + { + HttpRetryPolicy = new DaprComponentResiliencyPolicyHttpRetryPolicyConfiguration + { + MaxRetries = 15, + RetryBackOff = new DaprComponentResiliencyPolicyHttpRetryBackOffConfiguration + { + InitialDelayInMilliseconds = 2000, + MaxIntervalInMilliseconds = 5500, + }, + }, + ResponseTimeoutInSeconds = 30, + CircuitBreakerPolicy = new DaprComponentResiliencyPolicyCircuitBreakerPolicyConfiguration + { + ConsecutiveErrors = 5, + TimeoutInSeconds = 10, + IntervalInSeconds = 4, + }, + }, + OutboundPolicy = new DaprComponentResiliencyPolicyConfiguration + { + HttpRetryPolicy = new DaprComponentResiliencyPolicyHttpRetryPolicyConfiguration + { + MaxRetries = 5, + RetryBackOff = new DaprComponentResiliencyPolicyHttpRetryBackOffConfiguration + { + InitialDelayInMilliseconds = 100, + MaxIntervalInMilliseconds = 30000, + }, + }, + ResponseTimeoutInSeconds = 12, + CircuitBreakerPolicy = new DaprComponentResiliencyPolicyCircuitBreakerPolicyConfiguration + { + ConsecutiveErrors = 3, + TimeoutInSeconds = 20, + IntervalInSeconds = 60, + }, + }, + }; + ArmOperation lro = await daprComponentResiliencyPolicy.UpdateAsync(WaitUntil.Completed, data); + DaprComponentResiliencyPolicyResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + DaprComponentResiliencyPolicyData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Update_CreateOrUpdateDaprComponentResiliencyPolicyWithOutboundPolicyOnly() + { + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/DaprComponentResiliencyPolicy_CreateOrUpdate_OutboundOnly.json + // this example is just showing the usage of "DaprComponentResiliencyPolicies_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this DaprComponentResiliencyPolicyResource created on azure + // for more information of creating DaprComponentResiliencyPolicyResource, please refer to the document of DaprComponentResiliencyPolicyResource + string subscriptionId = "8efdecc5-919e-44eb-b179-915dca89ebf9"; + string resourceGroupName = "examplerg"; + string environmentName = "myenvironment"; + string componentName = "mydaprcomponent"; + string name = "myresiliencypolicy"; + ResourceIdentifier daprComponentResiliencyPolicyResourceId = DaprComponentResiliencyPolicyResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, environmentName, componentName, name); + DaprComponentResiliencyPolicyResource daprComponentResiliencyPolicy = client.GetDaprComponentResiliencyPolicyResource(daprComponentResiliencyPolicyResourceId); + + // invoke the operation + DaprComponentResiliencyPolicyData data = new DaprComponentResiliencyPolicyData + { + OutboundPolicy = new DaprComponentResiliencyPolicyConfiguration + { + HttpRetryPolicy = new DaprComponentResiliencyPolicyHttpRetryPolicyConfiguration + { + MaxRetries = 5, + RetryBackOff = new DaprComponentResiliencyPolicyHttpRetryBackOffConfiguration + { + InitialDelayInMilliseconds = 100, + MaxIntervalInMilliseconds = 30000, + }, + }, + ResponseTimeoutInSeconds = 12, + CircuitBreakerPolicy = new DaprComponentResiliencyPolicyCircuitBreakerPolicyConfiguration + { + ConsecutiveErrors = 3, + TimeoutInSeconds = 20, + IntervalInSeconds = 60, + }, + }, + }; + ArmOperation lro = await daprComponentResiliencyPolicy.UpdateAsync(WaitUntil.Completed, data); + DaprComponentResiliencyPolicyResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + DaprComponentResiliencyPolicyData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Update_CreateOrUpdateDaprComponentResiliencyPolicyWithSparseOptions() + { + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/DaprComponentResiliencyPolicy_CreateOrUpdate_SparseOptions.json + // this example is just showing the usage of "DaprComponentResiliencyPolicies_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this DaprComponentResiliencyPolicyResource created on azure + // for more information of creating DaprComponentResiliencyPolicyResource, please refer to the document of DaprComponentResiliencyPolicyResource + string subscriptionId = "8efdecc5-919e-44eb-b179-915dca89ebf9"; + string resourceGroupName = "examplerg"; + string environmentName = "myenvironment"; + string componentName = "mydaprcomponent"; + string name = "myresiliencypolicy"; + ResourceIdentifier daprComponentResiliencyPolicyResourceId = DaprComponentResiliencyPolicyResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, environmentName, componentName, name); + DaprComponentResiliencyPolicyResource daprComponentResiliencyPolicy = client.GetDaprComponentResiliencyPolicyResource(daprComponentResiliencyPolicyResourceId); + + // invoke the operation + DaprComponentResiliencyPolicyData data = new DaprComponentResiliencyPolicyData + { + InboundPolicy = new DaprComponentResiliencyPolicyConfiguration + { + HttpRetryPolicy = new DaprComponentResiliencyPolicyHttpRetryPolicyConfiguration + { + MaxRetries = 5, + RetryBackOff = new DaprComponentResiliencyPolicyHttpRetryBackOffConfiguration + { + InitialDelayInMilliseconds = 2000, + MaxIntervalInMilliseconds = 5500, + }, + }, + CircuitBreakerPolicy = new DaprComponentResiliencyPolicyCircuitBreakerPolicyConfiguration + { + ConsecutiveErrors = 3, + TimeoutInSeconds = 20, + }, + }, + OutboundPolicy = new DaprComponentResiliencyPolicyConfiguration + { + ResponseTimeoutInSeconds = 12, + }, + }; + ArmOperation lro = await daprComponentResiliencyPolicy.UpdateAsync(WaitUntil.Completed, data); + DaprComponentResiliencyPolicyResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + DaprComponentResiliencyPolicyData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } +} diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/tests/Generated/Samples/Sample_DaprSubscriptionCollection.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/tests/Generated/Samples/Sample_DaprSubscriptionCollection.cs new file mode 100644 index 000000000000..21885d4625cd --- /dev/null +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/tests/Generated/Samples/Sample_DaprSubscriptionCollection.cs @@ -0,0 +1,526 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.AppContainers.Models; +using NUnit.Framework; + +namespace Azure.ResourceManager.AppContainers.Samples +{ + public partial class Sample_DaprSubscriptionCollection + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task CreateOrUpdate_CreateOrUpdateDaprSubscriptionWithBulkSubscribeConfigurationAndScopes() + { + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/DaprSubscriptions_CreateOrUpdate_BulkSubscribeAndScopes.json + // this example is just showing the usage of "DaprSubscriptions_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ContainerAppManagedEnvironmentResource created on azure + // for more information of creating ContainerAppManagedEnvironmentResource, please refer to the document of ContainerAppManagedEnvironmentResource + string subscriptionId = "8efdecc5-919e-44eb-b179-915dca89ebf9"; + string resourceGroupName = "examplerg"; + string environmentName = "myenvironment"; + ResourceIdentifier containerAppManagedEnvironmentResourceId = ContainerAppManagedEnvironmentResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, environmentName); + ContainerAppManagedEnvironmentResource containerAppManagedEnvironment = client.GetContainerAppManagedEnvironmentResource(containerAppManagedEnvironmentResourceId); + + // get the collection of this DaprSubscriptionResource + DaprSubscriptionCollection collection = containerAppManagedEnvironment.GetDaprSubscriptions(); + + // invoke the operation + string name = "mysubscription"; + DaprSubscriptionData data = new DaprSubscriptionData + { + PubsubName = "mypubsubcomponent", + Topic = "inventory", + Routes = new DaprSubscriptionRoutes + { + Default = "/products", + }, + Scopes = { "warehouseapp", "customersupportapp" }, + BulkSubscribe = new DaprSubscriptionBulkSubscribeConfig + { + IsEnabled = true, + MaxMessagesCount = 123, + MaxAwaitDurationMs = 500, + }, + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, name, data); + DaprSubscriptionResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + DaprSubscriptionData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task CreateOrUpdate_CreateOrUpdateDaprSubscriptionWithDefaultRouteOnly() + { + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/DaprSubscriptions_CreateOrUpdate_DefaultRoute.json + // this example is just showing the usage of "DaprSubscriptions_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ContainerAppManagedEnvironmentResource created on azure + // for more information of creating ContainerAppManagedEnvironmentResource, please refer to the document of ContainerAppManagedEnvironmentResource + string subscriptionId = "8efdecc5-919e-44eb-b179-915dca89ebf9"; + string resourceGroupName = "examplerg"; + string environmentName = "myenvironment"; + ResourceIdentifier containerAppManagedEnvironmentResourceId = ContainerAppManagedEnvironmentResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, environmentName); + ContainerAppManagedEnvironmentResource containerAppManagedEnvironment = client.GetContainerAppManagedEnvironmentResource(containerAppManagedEnvironmentResourceId); + + // get the collection of this DaprSubscriptionResource + DaprSubscriptionCollection collection = containerAppManagedEnvironment.GetDaprSubscriptions(); + + // invoke the operation + string name = "mysubscription"; + DaprSubscriptionData data = new DaprSubscriptionData + { + PubsubName = "mypubsubcomponent", + Topic = "inventory", + Routes = new DaprSubscriptionRoutes + { + Default = "/products", + }, + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, name, data); + DaprSubscriptionResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + DaprSubscriptionData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task CreateOrUpdate_CreateOrUpdateDaprSubscriptionWithRouteRulesAndMetadata() + { + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/DaprSubscriptions_CreateOrUpdate_RouteRulesAndMetadata.json + // this example is just showing the usage of "DaprSubscriptions_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ContainerAppManagedEnvironmentResource created on azure + // for more information of creating ContainerAppManagedEnvironmentResource, please refer to the document of ContainerAppManagedEnvironmentResource + string subscriptionId = "8efdecc5-919e-44eb-b179-915dca89ebf9"; + string resourceGroupName = "examplerg"; + string environmentName = "myenvironment"; + ResourceIdentifier containerAppManagedEnvironmentResourceId = ContainerAppManagedEnvironmentResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, environmentName); + ContainerAppManagedEnvironmentResource containerAppManagedEnvironment = client.GetContainerAppManagedEnvironmentResource(containerAppManagedEnvironmentResourceId); + + // get the collection of this DaprSubscriptionResource + DaprSubscriptionCollection collection = containerAppManagedEnvironment.GetDaprSubscriptions(); + + // invoke the operation + string name = "mysubscription"; + DaprSubscriptionData data = new DaprSubscriptionData + { + PubsubName = "mypubsubcomponent", + Topic = "inventory", + Routes = new DaprSubscriptionRoutes + { + Rules = {new DaprSubscriptionRouteRule +{ +Match = "event.type == 'widget'", +Path = "/widgets", +}, new DaprSubscriptionRouteRule +{ +Match = "event.type == 'gadget'", +Path = "/gadgets", +}}, + Default = "/products", + }, + Metadata = +{ +["foo"] = "bar", +["hello"] = "world" +}, + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, name, data); + DaprSubscriptionResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + DaprSubscriptionData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_GetDaprSubscriptionWithBulkSubscribeConfigurationAndScopes() + { + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/DaprSubscriptions_Get_DefaultRoute.json + // this example is just showing the usage of "DaprSubscriptions_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ContainerAppManagedEnvironmentResource created on azure + // for more information of creating ContainerAppManagedEnvironmentResource, please refer to the document of ContainerAppManagedEnvironmentResource + string subscriptionId = "8efdecc5-919e-44eb-b179-915dca89ebf9"; + string resourceGroupName = "examplerg"; + string environmentName = "myenvironment"; + ResourceIdentifier containerAppManagedEnvironmentResourceId = ContainerAppManagedEnvironmentResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, environmentName); + ContainerAppManagedEnvironmentResource containerAppManagedEnvironment = client.GetContainerAppManagedEnvironmentResource(containerAppManagedEnvironmentResourceId); + + // get the collection of this DaprSubscriptionResource + DaprSubscriptionCollection collection = containerAppManagedEnvironment.GetDaprSubscriptions(); + + // invoke the operation + string name = "mypubsubcomponent"; + DaprSubscriptionResource result = await collection.GetAsync(name); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + DaprSubscriptionData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_GetDaprSubscriptionWithDefaultRouteOnly() + { + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/DaprSubscriptions_Get_BulkSubscribeAndScopes.json + // this example is just showing the usage of "DaprSubscriptions_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ContainerAppManagedEnvironmentResource created on azure + // for more information of creating ContainerAppManagedEnvironmentResource, please refer to the document of ContainerAppManagedEnvironmentResource + string subscriptionId = "8efdecc5-919e-44eb-b179-915dca89ebf9"; + string resourceGroupName = "examplerg"; + string environmentName = "myenvironment"; + ResourceIdentifier containerAppManagedEnvironmentResourceId = ContainerAppManagedEnvironmentResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, environmentName); + ContainerAppManagedEnvironmentResource containerAppManagedEnvironment = client.GetContainerAppManagedEnvironmentResource(containerAppManagedEnvironmentResourceId); + + // get the collection of this DaprSubscriptionResource + DaprSubscriptionCollection collection = containerAppManagedEnvironment.GetDaprSubscriptions(); + + // invoke the operation + string name = "mypubsubcomponent"; + DaprSubscriptionResource result = await collection.GetAsync(name); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + DaprSubscriptionData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_GetDaprSubscriptionWithRouteRulesAndMetadata() + { + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/DaprSubscriptions_Get_RouteRulesAndMetadata.json + // this example is just showing the usage of "DaprSubscriptions_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ContainerAppManagedEnvironmentResource created on azure + // for more information of creating ContainerAppManagedEnvironmentResource, please refer to the document of ContainerAppManagedEnvironmentResource + string subscriptionId = "8efdecc5-919e-44eb-b179-915dca89ebf9"; + string resourceGroupName = "examplerg"; + string environmentName = "myenvironment"; + ResourceIdentifier containerAppManagedEnvironmentResourceId = ContainerAppManagedEnvironmentResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, environmentName); + ContainerAppManagedEnvironmentResource containerAppManagedEnvironment = client.GetContainerAppManagedEnvironmentResource(containerAppManagedEnvironmentResourceId); + + // get the collection of this DaprSubscriptionResource + DaprSubscriptionCollection collection = containerAppManagedEnvironment.GetDaprSubscriptions(); + + // invoke the operation + string name = "mypubsubcomponent"; + DaprSubscriptionResource result = await collection.GetAsync(name); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + DaprSubscriptionData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetAll_ListDaprSubscriptions() + { + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/DaprSubscriptions_List.json + // this example is just showing the usage of "DaprSubscriptions_List" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ContainerAppManagedEnvironmentResource created on azure + // for more information of creating ContainerAppManagedEnvironmentResource, please refer to the document of ContainerAppManagedEnvironmentResource + string subscriptionId = "8efdecc5-919e-44eb-b179-915dca89ebf9"; + string resourceGroupName = "examplerg"; + string environmentName = "myenvironment"; + ResourceIdentifier containerAppManagedEnvironmentResourceId = ContainerAppManagedEnvironmentResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, environmentName); + ContainerAppManagedEnvironmentResource containerAppManagedEnvironment = client.GetContainerAppManagedEnvironmentResource(containerAppManagedEnvironmentResourceId); + + // get the collection of this DaprSubscriptionResource + DaprSubscriptionCollection collection = containerAppManagedEnvironment.GetDaprSubscriptions(); + + // invoke the operation and iterate over the result + await foreach (DaprSubscriptionResource item in collection.GetAllAsync()) + { + // the variable item is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + DaprSubscriptionData resourceData = item.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Exists_GetDaprSubscriptionWithBulkSubscribeConfigurationAndScopes() + { + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/DaprSubscriptions_Get_DefaultRoute.json + // this example is just showing the usage of "DaprSubscriptions_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ContainerAppManagedEnvironmentResource created on azure + // for more information of creating ContainerAppManagedEnvironmentResource, please refer to the document of ContainerAppManagedEnvironmentResource + string subscriptionId = "8efdecc5-919e-44eb-b179-915dca89ebf9"; + string resourceGroupName = "examplerg"; + string environmentName = "myenvironment"; + ResourceIdentifier containerAppManagedEnvironmentResourceId = ContainerAppManagedEnvironmentResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, environmentName); + ContainerAppManagedEnvironmentResource containerAppManagedEnvironment = client.GetContainerAppManagedEnvironmentResource(containerAppManagedEnvironmentResourceId); + + // get the collection of this DaprSubscriptionResource + DaprSubscriptionCollection collection = containerAppManagedEnvironment.GetDaprSubscriptions(); + + // invoke the operation + string name = "mypubsubcomponent"; + bool result = await collection.ExistsAsync(name); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Exists_GetDaprSubscriptionWithDefaultRouteOnly() + { + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/DaprSubscriptions_Get_BulkSubscribeAndScopes.json + // this example is just showing the usage of "DaprSubscriptions_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ContainerAppManagedEnvironmentResource created on azure + // for more information of creating ContainerAppManagedEnvironmentResource, please refer to the document of ContainerAppManagedEnvironmentResource + string subscriptionId = "8efdecc5-919e-44eb-b179-915dca89ebf9"; + string resourceGroupName = "examplerg"; + string environmentName = "myenvironment"; + ResourceIdentifier containerAppManagedEnvironmentResourceId = ContainerAppManagedEnvironmentResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, environmentName); + ContainerAppManagedEnvironmentResource containerAppManagedEnvironment = client.GetContainerAppManagedEnvironmentResource(containerAppManagedEnvironmentResourceId); + + // get the collection of this DaprSubscriptionResource + DaprSubscriptionCollection collection = containerAppManagedEnvironment.GetDaprSubscriptions(); + + // invoke the operation + string name = "mypubsubcomponent"; + bool result = await collection.ExistsAsync(name); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Exists_GetDaprSubscriptionWithRouteRulesAndMetadata() + { + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/DaprSubscriptions_Get_RouteRulesAndMetadata.json + // this example is just showing the usage of "DaprSubscriptions_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ContainerAppManagedEnvironmentResource created on azure + // for more information of creating ContainerAppManagedEnvironmentResource, please refer to the document of ContainerAppManagedEnvironmentResource + string subscriptionId = "8efdecc5-919e-44eb-b179-915dca89ebf9"; + string resourceGroupName = "examplerg"; + string environmentName = "myenvironment"; + ResourceIdentifier containerAppManagedEnvironmentResourceId = ContainerAppManagedEnvironmentResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, environmentName); + ContainerAppManagedEnvironmentResource containerAppManagedEnvironment = client.GetContainerAppManagedEnvironmentResource(containerAppManagedEnvironmentResourceId); + + // get the collection of this DaprSubscriptionResource + DaprSubscriptionCollection collection = containerAppManagedEnvironment.GetDaprSubscriptions(); + + // invoke the operation + string name = "mypubsubcomponent"; + bool result = await collection.ExistsAsync(name); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetIfExists_GetDaprSubscriptionWithBulkSubscribeConfigurationAndScopes() + { + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/DaprSubscriptions_Get_DefaultRoute.json + // this example is just showing the usage of "DaprSubscriptions_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ContainerAppManagedEnvironmentResource created on azure + // for more information of creating ContainerAppManagedEnvironmentResource, please refer to the document of ContainerAppManagedEnvironmentResource + string subscriptionId = "8efdecc5-919e-44eb-b179-915dca89ebf9"; + string resourceGroupName = "examplerg"; + string environmentName = "myenvironment"; + ResourceIdentifier containerAppManagedEnvironmentResourceId = ContainerAppManagedEnvironmentResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, environmentName); + ContainerAppManagedEnvironmentResource containerAppManagedEnvironment = client.GetContainerAppManagedEnvironmentResource(containerAppManagedEnvironmentResourceId); + + // get the collection of this DaprSubscriptionResource + DaprSubscriptionCollection collection = containerAppManagedEnvironment.GetDaprSubscriptions(); + + // invoke the operation + string name = "mypubsubcomponent"; + NullableResponse response = await collection.GetIfExistsAsync(name); + DaprSubscriptionResource result = response.HasValue ? response.Value : null; + + if (result == null) + { + Console.WriteLine("Succeeded with null as result"); + } + else + { + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + DaprSubscriptionData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetIfExists_GetDaprSubscriptionWithDefaultRouteOnly() + { + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/DaprSubscriptions_Get_BulkSubscribeAndScopes.json + // this example is just showing the usage of "DaprSubscriptions_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ContainerAppManagedEnvironmentResource created on azure + // for more information of creating ContainerAppManagedEnvironmentResource, please refer to the document of ContainerAppManagedEnvironmentResource + string subscriptionId = "8efdecc5-919e-44eb-b179-915dca89ebf9"; + string resourceGroupName = "examplerg"; + string environmentName = "myenvironment"; + ResourceIdentifier containerAppManagedEnvironmentResourceId = ContainerAppManagedEnvironmentResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, environmentName); + ContainerAppManagedEnvironmentResource containerAppManagedEnvironment = client.GetContainerAppManagedEnvironmentResource(containerAppManagedEnvironmentResourceId); + + // get the collection of this DaprSubscriptionResource + DaprSubscriptionCollection collection = containerAppManagedEnvironment.GetDaprSubscriptions(); + + // invoke the operation + string name = "mypubsubcomponent"; + NullableResponse response = await collection.GetIfExistsAsync(name); + DaprSubscriptionResource result = response.HasValue ? response.Value : null; + + if (result == null) + { + Console.WriteLine("Succeeded with null as result"); + } + else + { + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + DaprSubscriptionData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetIfExists_GetDaprSubscriptionWithRouteRulesAndMetadata() + { + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/DaprSubscriptions_Get_RouteRulesAndMetadata.json + // this example is just showing the usage of "DaprSubscriptions_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ContainerAppManagedEnvironmentResource created on azure + // for more information of creating ContainerAppManagedEnvironmentResource, please refer to the document of ContainerAppManagedEnvironmentResource + string subscriptionId = "8efdecc5-919e-44eb-b179-915dca89ebf9"; + string resourceGroupName = "examplerg"; + string environmentName = "myenvironment"; + ResourceIdentifier containerAppManagedEnvironmentResourceId = ContainerAppManagedEnvironmentResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, environmentName); + ContainerAppManagedEnvironmentResource containerAppManagedEnvironment = client.GetContainerAppManagedEnvironmentResource(containerAppManagedEnvironmentResourceId); + + // get the collection of this DaprSubscriptionResource + DaprSubscriptionCollection collection = containerAppManagedEnvironment.GetDaprSubscriptions(); + + // invoke the operation + string name = "mypubsubcomponent"; + NullableResponse response = await collection.GetIfExistsAsync(name); + DaprSubscriptionResource result = response.HasValue ? response.Value : null; + + if (result == null) + { + Console.WriteLine("Succeeded with null as result"); + } + else + { + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + DaprSubscriptionData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + } +} diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/tests/Generated/Samples/Sample_DaprSubscriptionResource.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/tests/Generated/Samples/Sample_DaprSubscriptionResource.cs new file mode 100644 index 000000000000..e28bc6c432b6 --- /dev/null +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/tests/Generated/Samples/Sample_DaprSubscriptionResource.cs @@ -0,0 +1,283 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.AppContainers.Models; +using NUnit.Framework; + +namespace Azure.ResourceManager.AppContainers.Samples +{ + public partial class Sample_DaprSubscriptionResource + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_GetDaprSubscriptionWithBulkSubscribeConfigurationAndScopes() + { + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/DaprSubscriptions_Get_DefaultRoute.json + // this example is just showing the usage of "DaprSubscriptions_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this DaprSubscriptionResource created on azure + // for more information of creating DaprSubscriptionResource, please refer to the document of DaprSubscriptionResource + string subscriptionId = "8efdecc5-919e-44eb-b179-915dca89ebf9"; + string resourceGroupName = "examplerg"; + string environmentName = "myenvironment"; + string name = "mypubsubcomponent"; + ResourceIdentifier daprSubscriptionResourceId = DaprSubscriptionResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, environmentName, name); + DaprSubscriptionResource daprSubscription = client.GetDaprSubscriptionResource(daprSubscriptionResourceId); + + // invoke the operation + DaprSubscriptionResource result = await daprSubscription.GetAsync(); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + DaprSubscriptionData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_GetDaprSubscriptionWithDefaultRouteOnly() + { + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/DaprSubscriptions_Get_BulkSubscribeAndScopes.json + // this example is just showing the usage of "DaprSubscriptions_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this DaprSubscriptionResource created on azure + // for more information of creating DaprSubscriptionResource, please refer to the document of DaprSubscriptionResource + string subscriptionId = "8efdecc5-919e-44eb-b179-915dca89ebf9"; + string resourceGroupName = "examplerg"; + string environmentName = "myenvironment"; + string name = "mypubsubcomponent"; + ResourceIdentifier daprSubscriptionResourceId = DaprSubscriptionResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, environmentName, name); + DaprSubscriptionResource daprSubscription = client.GetDaprSubscriptionResource(daprSubscriptionResourceId); + + // invoke the operation + DaprSubscriptionResource result = await daprSubscription.GetAsync(); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + DaprSubscriptionData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_GetDaprSubscriptionWithRouteRulesAndMetadata() + { + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/DaprSubscriptions_Get_RouteRulesAndMetadata.json + // this example is just showing the usage of "DaprSubscriptions_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this DaprSubscriptionResource created on azure + // for more information of creating DaprSubscriptionResource, please refer to the document of DaprSubscriptionResource + string subscriptionId = "8efdecc5-919e-44eb-b179-915dca89ebf9"; + string resourceGroupName = "examplerg"; + string environmentName = "myenvironment"; + string name = "mypubsubcomponent"; + ResourceIdentifier daprSubscriptionResourceId = DaprSubscriptionResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, environmentName, name); + DaprSubscriptionResource daprSubscription = client.GetDaprSubscriptionResource(daprSubscriptionResourceId); + + // invoke the operation + DaprSubscriptionResource result = await daprSubscription.GetAsync(); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + DaprSubscriptionData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Delete_DeleteDaprSubscription() + { + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/DaprSubscriptions_Delete.json + // this example is just showing the usage of "DaprSubscriptions_Delete" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this DaprSubscriptionResource created on azure + // for more information of creating DaprSubscriptionResource, please refer to the document of DaprSubscriptionResource + string subscriptionId = "8efdecc5-919e-44eb-b179-915dca89ebf9"; + string resourceGroupName = "examplerg"; + string environmentName = "myenvironment"; + string name = "mysubscription"; + ResourceIdentifier daprSubscriptionResourceId = DaprSubscriptionResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, environmentName, name); + DaprSubscriptionResource daprSubscription = client.GetDaprSubscriptionResource(daprSubscriptionResourceId); + + // invoke the operation + await daprSubscription.DeleteAsync(WaitUntil.Completed); + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Update_CreateOrUpdateDaprSubscriptionWithBulkSubscribeConfigurationAndScopes() + { + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/DaprSubscriptions_CreateOrUpdate_BulkSubscribeAndScopes.json + // this example is just showing the usage of "DaprSubscriptions_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this DaprSubscriptionResource created on azure + // for more information of creating DaprSubscriptionResource, please refer to the document of DaprSubscriptionResource + string subscriptionId = "8efdecc5-919e-44eb-b179-915dca89ebf9"; + string resourceGroupName = "examplerg"; + string environmentName = "myenvironment"; + string name = "mysubscription"; + ResourceIdentifier daprSubscriptionResourceId = DaprSubscriptionResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, environmentName, name); + DaprSubscriptionResource daprSubscription = client.GetDaprSubscriptionResource(daprSubscriptionResourceId); + + // invoke the operation + DaprSubscriptionData data = new DaprSubscriptionData + { + PubsubName = "mypubsubcomponent", + Topic = "inventory", + Routes = new DaprSubscriptionRoutes + { + Default = "/products", + }, + Scopes = { "warehouseapp", "customersupportapp" }, + BulkSubscribe = new DaprSubscriptionBulkSubscribeConfig + { + IsEnabled = true, + MaxMessagesCount = 123, + MaxAwaitDurationMs = 500, + }, + }; + ArmOperation lro = await daprSubscription.UpdateAsync(WaitUntil.Completed, data); + DaprSubscriptionResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + DaprSubscriptionData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Update_CreateOrUpdateDaprSubscriptionWithDefaultRouteOnly() + { + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/DaprSubscriptions_CreateOrUpdate_DefaultRoute.json + // this example is just showing the usage of "DaprSubscriptions_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this DaprSubscriptionResource created on azure + // for more information of creating DaprSubscriptionResource, please refer to the document of DaprSubscriptionResource + string subscriptionId = "8efdecc5-919e-44eb-b179-915dca89ebf9"; + string resourceGroupName = "examplerg"; + string environmentName = "myenvironment"; + string name = "mysubscription"; + ResourceIdentifier daprSubscriptionResourceId = DaprSubscriptionResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, environmentName, name); + DaprSubscriptionResource daprSubscription = client.GetDaprSubscriptionResource(daprSubscriptionResourceId); + + // invoke the operation + DaprSubscriptionData data = new DaprSubscriptionData + { + PubsubName = "mypubsubcomponent", + Topic = "inventory", + Routes = new DaprSubscriptionRoutes + { + Default = "/products", + }, + }; + ArmOperation lro = await daprSubscription.UpdateAsync(WaitUntil.Completed, data); + DaprSubscriptionResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + DaprSubscriptionData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Update_CreateOrUpdateDaprSubscriptionWithRouteRulesAndMetadata() + { + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/DaprSubscriptions_CreateOrUpdate_RouteRulesAndMetadata.json + // this example is just showing the usage of "DaprSubscriptions_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this DaprSubscriptionResource created on azure + // for more information of creating DaprSubscriptionResource, please refer to the document of DaprSubscriptionResource + string subscriptionId = "8efdecc5-919e-44eb-b179-915dca89ebf9"; + string resourceGroupName = "examplerg"; + string environmentName = "myenvironment"; + string name = "mysubscription"; + ResourceIdentifier daprSubscriptionResourceId = DaprSubscriptionResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, environmentName, name); + DaprSubscriptionResource daprSubscription = client.GetDaprSubscriptionResource(daprSubscriptionResourceId); + + // invoke the operation + DaprSubscriptionData data = new DaprSubscriptionData + { + PubsubName = "mypubsubcomponent", + Topic = "inventory", + Routes = new DaprSubscriptionRoutes + { + Rules = {new DaprSubscriptionRouteRule +{ +Match = "event.type == 'widget'", +Path = "/widgets", +}, new DaprSubscriptionRouteRule +{ +Match = "event.type == 'gadget'", +Path = "/gadgets", +}}, + Default = "/products", + }, + Metadata = +{ +["foo"] = "bar", +["hello"] = "world" +}, + }; + ArmOperation lro = await daprSubscription.UpdateAsync(WaitUntil.Completed, data); + DaprSubscriptionResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + DaprSubscriptionData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } +} diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/tests/Generated/Samples/Sample_DotNetComponentCollection.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/tests/Generated/Samples/Sample_DotNetComponentCollection.cs new file mode 100644 index 000000000000..674476baf9a8 --- /dev/null +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/tests/Generated/Samples/Sample_DotNetComponentCollection.cs @@ -0,0 +1,396 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.AppContainers.Models; +using NUnit.Framework; + +namespace Azure.ResourceManager.AppContainers.Samples +{ + public partial class Sample_DotNetComponentCollection + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task CreateOrUpdate_CreateOrUpdateNETComponent() + { + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/DotNetComponents_CreateOrUpdate.json + // this example is just showing the usage of "DotNetComponents_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ContainerAppManagedEnvironmentResource created on azure + // for more information of creating ContainerAppManagedEnvironmentResource, please refer to the document of ContainerAppManagedEnvironmentResource + string subscriptionId = "8efdecc5-919e-44eb-b179-915dca89ebf9"; + string resourceGroupName = "examplerg"; + string environmentName = "myenvironment"; + ResourceIdentifier containerAppManagedEnvironmentResourceId = ContainerAppManagedEnvironmentResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, environmentName); + ContainerAppManagedEnvironmentResource containerAppManagedEnvironment = client.GetContainerAppManagedEnvironmentResource(containerAppManagedEnvironmentResourceId); + + // get the collection of this DotNetComponentResource + DotNetComponentCollection collection = containerAppManagedEnvironment.GetDotNetComponents(); + + // invoke the operation + string name = "mydotnetcomponent"; + DotNetComponentData data = new DotNetComponentData + { + ComponentType = DotNetComponentType.AspireDashboard, + Configurations = {new DotNetComponentConfigurationProperty +{ +PropertyName = "dashboard-theme", +Value = "dark", +}}, + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, name, data); + DotNetComponentResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + DotNetComponentData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task CreateOrUpdate_CreateOrUpdateNETComponentWithServiceBinds() + { + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/DotNetComponents_CreateOrUpdate_ServiceBind.json + // this example is just showing the usage of "DotNetComponents_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ContainerAppManagedEnvironmentResource created on azure + // for more information of creating ContainerAppManagedEnvironmentResource, please refer to the document of ContainerAppManagedEnvironmentResource + string subscriptionId = "8efdecc5-919e-44eb-b179-915dca89ebf9"; + string resourceGroupName = "examplerg"; + string environmentName = "myenvironment"; + ResourceIdentifier containerAppManagedEnvironmentResourceId = ContainerAppManagedEnvironmentResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, environmentName); + ContainerAppManagedEnvironmentResource containerAppManagedEnvironment = client.GetContainerAppManagedEnvironmentResource(containerAppManagedEnvironmentResourceId); + + // get the collection of this DotNetComponentResource + DotNetComponentCollection collection = containerAppManagedEnvironment.GetDotNetComponents(); + + // invoke the operation + string name = "mydotnetcomponent"; + DotNetComponentData data = new DotNetComponentData + { + ComponentType = DotNetComponentType.AspireDashboard, + Configurations = {new DotNetComponentConfigurationProperty +{ +PropertyName = "dashboard-theme", +Value = "dark", +}}, + ServiceBinds = {new DotNetComponentServiceBind +{ +Name = "yellowcat", +ServiceId = new ResourceIdentifier("/subscriptions/8efdecc5-919e-44eb-b179-915dca89ebf9/resourceGroups/examplerg/providers/Microsoft.App/managedEnvironments/myenvironment/dotNetComponents/yellowcat"), +}}, + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, name, data); + DotNetComponentResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + DotNetComponentData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_GetNETComponent() + { + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/DotNetComponents_Get.json + // this example is just showing the usage of "DotNetComponents_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ContainerAppManagedEnvironmentResource created on azure + // for more information of creating ContainerAppManagedEnvironmentResource, please refer to the document of ContainerAppManagedEnvironmentResource + string subscriptionId = "8efdecc5-919e-44eb-b179-915dca89ebf9"; + string resourceGroupName = "examplerg"; + string environmentName = "myenvironment"; + ResourceIdentifier containerAppManagedEnvironmentResourceId = ContainerAppManagedEnvironmentResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, environmentName); + ContainerAppManagedEnvironmentResource containerAppManagedEnvironment = client.GetContainerAppManagedEnvironmentResource(containerAppManagedEnvironmentResourceId); + + // get the collection of this DotNetComponentResource + DotNetComponentCollection collection = containerAppManagedEnvironment.GetDotNetComponents(); + + // invoke the operation + string name = "mydotnetcomponent"; + DotNetComponentResource result = await collection.GetAsync(name); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + DotNetComponentData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_GetNETComponentWithServiceBinds() + { + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/DotNetComponents_Get_ServiceBind.json + // this example is just showing the usage of "DotNetComponents_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ContainerAppManagedEnvironmentResource created on azure + // for more information of creating ContainerAppManagedEnvironmentResource, please refer to the document of ContainerAppManagedEnvironmentResource + string subscriptionId = "8efdecc5-919e-44eb-b179-915dca89ebf9"; + string resourceGroupName = "examplerg"; + string environmentName = "myenvironment"; + ResourceIdentifier containerAppManagedEnvironmentResourceId = ContainerAppManagedEnvironmentResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, environmentName); + ContainerAppManagedEnvironmentResource containerAppManagedEnvironment = client.GetContainerAppManagedEnvironmentResource(containerAppManagedEnvironmentResourceId); + + // get the collection of this DotNetComponentResource + DotNetComponentCollection collection = containerAppManagedEnvironment.GetDotNetComponents(); + + // invoke the operation + string name = "mydotnetcomponent"; + DotNetComponentResource result = await collection.GetAsync(name); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + DotNetComponentData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetAll_ListNETComponents() + { + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/DotNetComponents_List.json + // this example is just showing the usage of "DotNetComponents_List" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ContainerAppManagedEnvironmentResource created on azure + // for more information of creating ContainerAppManagedEnvironmentResource, please refer to the document of ContainerAppManagedEnvironmentResource + string subscriptionId = "8efdecc5-919e-44eb-b179-915dca89ebf9"; + string resourceGroupName = "examplerg"; + string environmentName = "myenvironment"; + ResourceIdentifier containerAppManagedEnvironmentResourceId = ContainerAppManagedEnvironmentResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, environmentName); + ContainerAppManagedEnvironmentResource containerAppManagedEnvironment = client.GetContainerAppManagedEnvironmentResource(containerAppManagedEnvironmentResourceId); + + // get the collection of this DotNetComponentResource + DotNetComponentCollection collection = containerAppManagedEnvironment.GetDotNetComponents(); + + // invoke the operation and iterate over the result + await foreach (DotNetComponentResource item in collection.GetAllAsync()) + { + // the variable item is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + DotNetComponentData resourceData = item.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetAll_ListNETComponentsWithServiceBinds() + { + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/DotNetComponents_List_ServiceBind.json + // this example is just showing the usage of "DotNetComponents_List" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ContainerAppManagedEnvironmentResource created on azure + // for more information of creating ContainerAppManagedEnvironmentResource, please refer to the document of ContainerAppManagedEnvironmentResource + string subscriptionId = "8efdecc5-919e-44eb-b179-915dca89ebf9"; + string resourceGroupName = "examplerg"; + string environmentName = "myenvironment"; + ResourceIdentifier containerAppManagedEnvironmentResourceId = ContainerAppManagedEnvironmentResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, environmentName); + ContainerAppManagedEnvironmentResource containerAppManagedEnvironment = client.GetContainerAppManagedEnvironmentResource(containerAppManagedEnvironmentResourceId); + + // get the collection of this DotNetComponentResource + DotNetComponentCollection collection = containerAppManagedEnvironment.GetDotNetComponents(); + + // invoke the operation and iterate over the result + await foreach (DotNetComponentResource item in collection.GetAllAsync()) + { + // the variable item is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + DotNetComponentData resourceData = item.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Exists_GetNETComponent() + { + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/DotNetComponents_Get.json + // this example is just showing the usage of "DotNetComponents_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ContainerAppManagedEnvironmentResource created on azure + // for more information of creating ContainerAppManagedEnvironmentResource, please refer to the document of ContainerAppManagedEnvironmentResource + string subscriptionId = "8efdecc5-919e-44eb-b179-915dca89ebf9"; + string resourceGroupName = "examplerg"; + string environmentName = "myenvironment"; + ResourceIdentifier containerAppManagedEnvironmentResourceId = ContainerAppManagedEnvironmentResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, environmentName); + ContainerAppManagedEnvironmentResource containerAppManagedEnvironment = client.GetContainerAppManagedEnvironmentResource(containerAppManagedEnvironmentResourceId); + + // get the collection of this DotNetComponentResource + DotNetComponentCollection collection = containerAppManagedEnvironment.GetDotNetComponents(); + + // invoke the operation + string name = "mydotnetcomponent"; + bool result = await collection.ExistsAsync(name); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Exists_GetNETComponentWithServiceBinds() + { + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/DotNetComponents_Get_ServiceBind.json + // this example is just showing the usage of "DotNetComponents_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ContainerAppManagedEnvironmentResource created on azure + // for more information of creating ContainerAppManagedEnvironmentResource, please refer to the document of ContainerAppManagedEnvironmentResource + string subscriptionId = "8efdecc5-919e-44eb-b179-915dca89ebf9"; + string resourceGroupName = "examplerg"; + string environmentName = "myenvironment"; + ResourceIdentifier containerAppManagedEnvironmentResourceId = ContainerAppManagedEnvironmentResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, environmentName); + ContainerAppManagedEnvironmentResource containerAppManagedEnvironment = client.GetContainerAppManagedEnvironmentResource(containerAppManagedEnvironmentResourceId); + + // get the collection of this DotNetComponentResource + DotNetComponentCollection collection = containerAppManagedEnvironment.GetDotNetComponents(); + + // invoke the operation + string name = "mydotnetcomponent"; + bool result = await collection.ExistsAsync(name); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetIfExists_GetNETComponent() + { + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/DotNetComponents_Get.json + // this example is just showing the usage of "DotNetComponents_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ContainerAppManagedEnvironmentResource created on azure + // for more information of creating ContainerAppManagedEnvironmentResource, please refer to the document of ContainerAppManagedEnvironmentResource + string subscriptionId = "8efdecc5-919e-44eb-b179-915dca89ebf9"; + string resourceGroupName = "examplerg"; + string environmentName = "myenvironment"; + ResourceIdentifier containerAppManagedEnvironmentResourceId = ContainerAppManagedEnvironmentResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, environmentName); + ContainerAppManagedEnvironmentResource containerAppManagedEnvironment = client.GetContainerAppManagedEnvironmentResource(containerAppManagedEnvironmentResourceId); + + // get the collection of this DotNetComponentResource + DotNetComponentCollection collection = containerAppManagedEnvironment.GetDotNetComponents(); + + // invoke the operation + string name = "mydotnetcomponent"; + NullableResponse response = await collection.GetIfExistsAsync(name); + DotNetComponentResource result = response.HasValue ? response.Value : null; + + if (result == null) + { + Console.WriteLine("Succeeded with null as result"); + } + else + { + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + DotNetComponentData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetIfExists_GetNETComponentWithServiceBinds() + { + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/DotNetComponents_Get_ServiceBind.json + // this example is just showing the usage of "DotNetComponents_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ContainerAppManagedEnvironmentResource created on azure + // for more information of creating ContainerAppManagedEnvironmentResource, please refer to the document of ContainerAppManagedEnvironmentResource + string subscriptionId = "8efdecc5-919e-44eb-b179-915dca89ebf9"; + string resourceGroupName = "examplerg"; + string environmentName = "myenvironment"; + ResourceIdentifier containerAppManagedEnvironmentResourceId = ContainerAppManagedEnvironmentResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, environmentName); + ContainerAppManagedEnvironmentResource containerAppManagedEnvironment = client.GetContainerAppManagedEnvironmentResource(containerAppManagedEnvironmentResourceId); + + // get the collection of this DotNetComponentResource + DotNetComponentCollection collection = containerAppManagedEnvironment.GetDotNetComponents(); + + // invoke the operation + string name = "mydotnetcomponent"; + NullableResponse response = await collection.GetIfExistsAsync(name); + DotNetComponentResource result = response.HasValue ? response.Value : null; + + if (result == null) + { + Console.WriteLine("Succeeded with null as result"); + } + else + { + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + DotNetComponentData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + } +} diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/tests/Generated/Samples/Sample_DotNetComponentResource.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/tests/Generated/Samples/Sample_DotNetComponentResource.cs new file mode 100644 index 000000000000..4f7393128a9f --- /dev/null +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/tests/Generated/Samples/Sample_DotNetComponentResource.cs @@ -0,0 +1,195 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.AppContainers.Models; +using NUnit.Framework; + +namespace Azure.ResourceManager.AppContainers.Samples +{ + public partial class Sample_DotNetComponentResource + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_GetNETComponent() + { + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/DotNetComponents_Get.json + // this example is just showing the usage of "DotNetComponents_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this DotNetComponentResource created on azure + // for more information of creating DotNetComponentResource, please refer to the document of DotNetComponentResource + string subscriptionId = "8efdecc5-919e-44eb-b179-915dca89ebf9"; + string resourceGroupName = "examplerg"; + string environmentName = "myenvironment"; + string name = "mydotnetcomponent"; + ResourceIdentifier dotNetComponentResourceId = DotNetComponentResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, environmentName, name); + DotNetComponentResource dotNetComponent = client.GetDotNetComponentResource(dotNetComponentResourceId); + + // invoke the operation + DotNetComponentResource result = await dotNetComponent.GetAsync(); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + DotNetComponentData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_GetNETComponentWithServiceBinds() + { + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/DotNetComponents_Get_ServiceBind.json + // this example is just showing the usage of "DotNetComponents_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this DotNetComponentResource created on azure + // for more information of creating DotNetComponentResource, please refer to the document of DotNetComponentResource + string subscriptionId = "8efdecc5-919e-44eb-b179-915dca89ebf9"; + string resourceGroupName = "examplerg"; + string environmentName = "myenvironment"; + string name = "mydotnetcomponent"; + ResourceIdentifier dotNetComponentResourceId = DotNetComponentResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, environmentName, name); + DotNetComponentResource dotNetComponent = client.GetDotNetComponentResource(dotNetComponentResourceId); + + // invoke the operation + DotNetComponentResource result = await dotNetComponent.GetAsync(); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + DotNetComponentData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Delete_DeleteNETComponent() + { + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/DotNetComponents_Delete.json + // this example is just showing the usage of "DotNetComponents_Delete" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this DotNetComponentResource created on azure + // for more information of creating DotNetComponentResource, please refer to the document of DotNetComponentResource + string subscriptionId = "8efdecc5-919e-44eb-b179-915dca89ebf9"; + string resourceGroupName = "examplerg"; + string environmentName = "myenvironment"; + string name = "mydotnetcomponent"; + ResourceIdentifier dotNetComponentResourceId = DotNetComponentResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, environmentName, name); + DotNetComponentResource dotNetComponent = client.GetDotNetComponentResource(dotNetComponentResourceId); + + // invoke the operation + await dotNetComponent.DeleteAsync(WaitUntil.Completed); + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Update_PatchNETComponent() + { + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/DotNetComponents_Patch.json + // this example is just showing the usage of "DotNetComponents_Update" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this DotNetComponentResource created on azure + // for more information of creating DotNetComponentResource, please refer to the document of DotNetComponentResource + string subscriptionId = "8efdecc5-919e-44eb-b179-915dca89ebf9"; + string resourceGroupName = "examplerg"; + string environmentName = "myenvironment"; + string name = "mydotnetcomponent"; + ResourceIdentifier dotNetComponentResourceId = DotNetComponentResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, environmentName, name); + DotNetComponentResource dotNetComponent = client.GetDotNetComponentResource(dotNetComponentResourceId); + + // invoke the operation + DotNetComponentData data = new DotNetComponentData + { + ComponentType = DotNetComponentType.AspireDashboard, + Configurations = {new DotNetComponentConfigurationProperty +{ +PropertyName = "dashboard-theme", +Value = "dark", +}}, + }; + ArmOperation lro = await dotNetComponent.UpdateAsync(WaitUntil.Completed, data); + DotNetComponentResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + DotNetComponentData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Update_PatchNETComponentWithServiceBinds() + { + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/DotNetComponents_Patch_ServiceBind.json + // this example is just showing the usage of "DotNetComponents_Update" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this DotNetComponentResource created on azure + // for more information of creating DotNetComponentResource, please refer to the document of DotNetComponentResource + string subscriptionId = "8efdecc5-919e-44eb-b179-915dca89ebf9"; + string resourceGroupName = "examplerg"; + string environmentName = "myenvironment"; + string name = "mydotnetcomponent"; + ResourceIdentifier dotNetComponentResourceId = DotNetComponentResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, environmentName, name); + DotNetComponentResource dotNetComponent = client.GetDotNetComponentResource(dotNetComponentResourceId); + + // invoke the operation + DotNetComponentData data = new DotNetComponentData + { + ComponentType = DotNetComponentType.AspireDashboard, + Configurations = {new DotNetComponentConfigurationProperty +{ +PropertyName = "dashboard-theme", +Value = "dark", +}}, + ServiceBinds = {new DotNetComponentServiceBind +{ +Name = "yellowcat", +ServiceId = new ResourceIdentifier("/subscriptions/8efdecc5-919e-44eb-b179-915dca89ebf9/resourceGroups/examplerg/providers/Microsoft.App/managedEnvironments/myenvironment/dotNetComponents/yellowcat"), +}}, + }; + ArmOperation lro = await dotNetComponent.UpdateAsync(WaitUntil.Completed, data); + DotNetComponentResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + DotNetComponentData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } +} diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/tests/Generated/Samples/Sample_HttpRouteConfigCollection.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/tests/Generated/Samples/Sample_HttpRouteConfigCollection.cs new file mode 100644 index 000000000000..7486873bb65a --- /dev/null +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/tests/Generated/Samples/Sample_HttpRouteConfigCollection.cs @@ -0,0 +1,351 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.AppContainers.Models; +using NUnit.Framework; + +namespace Azure.ResourceManager.AppContainers.Samples +{ + public partial class Sample_HttpRouteConfigCollection + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task CreateOrUpdate_CreateOrUpdateHttpRoute() + { + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/HttpRouteConfig_CreateOrUpdate.json + // this example is just showing the usage of "HttpRouteConfig_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ContainerAppManagedEnvironmentResource created on azure + // for more information of creating ContainerAppManagedEnvironmentResource, please refer to the document of ContainerAppManagedEnvironmentResource + string subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; + string resourceGroupName = "examplerg"; + string environmentName = "testcontainerenv"; + ResourceIdentifier containerAppManagedEnvironmentResourceId = ContainerAppManagedEnvironmentResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, environmentName); + ContainerAppManagedEnvironmentResource containerAppManagedEnvironment = client.GetContainerAppManagedEnvironmentResource(containerAppManagedEnvironmentResourceId); + + // get the collection of this HttpRouteConfigResource + HttpRouteConfigCollection collection = containerAppManagedEnvironment.GetHttpRouteConfigs(); + + // invoke the operation + string httpRouteName = "httproutefriendlyname"; + HttpRouteConfigData data = new HttpRouteConfigData + { + Properties = new HttpRouteConfigProperties + { + CustomDomains = {new ContainerAppCustomDomain("example.com") +{ +BindingType = ContainerAppCustomDomainBindingType.SniEnabled, +CertificateId = new ResourceIdentifier("/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/examplerg/providers/Microsoft.App/managedEnvironments/testcontainerenv/certificates/certificate-1"), +}}, + Rules = {new HttpRouteRule +{ +Targets = {new HttpRouteTarget("capp-1") +{ +Revision = "rev-1", +Weight = 100, +}}, +Routes = {new HttpRoute +{ +Match = new HttpRouteMatch +{ +Path = "/v1", +CaseSensitive = true, +}, +ActionPrefixRewrite = "/v1/api", +}}, +Description = "random-description", +}}, + }, + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, httpRouteName, data); + HttpRouteConfigResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + HttpRouteConfigData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task CreateOrUpdate_CreateOrUpdateHttpRoutePathSeparatedPrefixRule() + { + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/HttpRouteConfig_CreateOrUpdate_PathSepPrefix.json + // this example is just showing the usage of "HttpRouteConfig_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ContainerAppManagedEnvironmentResource created on azure + // for more information of creating ContainerAppManagedEnvironmentResource, please refer to the document of ContainerAppManagedEnvironmentResource + string subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; + string resourceGroupName = "examplerg"; + string environmentName = "testcontainerenv"; + ResourceIdentifier containerAppManagedEnvironmentResourceId = ContainerAppManagedEnvironmentResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, environmentName); + ContainerAppManagedEnvironmentResource containerAppManagedEnvironment = client.GetContainerAppManagedEnvironmentResource(containerAppManagedEnvironmentResourceId); + + // get the collection of this HttpRouteConfigResource + HttpRouteConfigCollection collection = containerAppManagedEnvironment.GetHttpRouteConfigs(); + + // invoke the operation + string httpRouteName = "httproutefriendlyname"; + HttpRouteConfigData data = new HttpRouteConfigData + { + Properties = new HttpRouteConfigProperties + { + CustomDomains = {new ContainerAppCustomDomain("example.com") +{ +BindingType = ContainerAppCustomDomainBindingType.Disabled, +CertificateId = new ResourceIdentifier("/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/examplerg/providers/Microsoft.App/managedEnvironments/testcontainerenv/certificates/certificate-1"), +}}, + Rules = {new HttpRouteRule +{ +Targets = {new HttpRouteTarget("capp-1") +{ +Label = "label-1", +}}, +Routes = {new HttpRoute +{ +Match = new HttpRouteMatch +{ +PathSeparatedPrefix = "/v1", +CaseSensitive = true, +}, +ActionPrefixRewrite = "/v1/api", +}}, +Description = "random-description", +}}, + }, + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, httpRouteName, data); + HttpRouteConfigResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + HttpRouteConfigData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task CreateOrUpdate_CreateOrUpdateHttpRoutePrefixRule() + { + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/HttpRouteConfig_CreateOrUpdatePrefix.json + // this example is just showing the usage of "HttpRouteConfig_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ContainerAppManagedEnvironmentResource created on azure + // for more information of creating ContainerAppManagedEnvironmentResource, please refer to the document of ContainerAppManagedEnvironmentResource + string subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; + string resourceGroupName = "examplerg"; + string environmentName = "testcontainerenv"; + ResourceIdentifier containerAppManagedEnvironmentResourceId = ContainerAppManagedEnvironmentResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, environmentName); + ContainerAppManagedEnvironmentResource containerAppManagedEnvironment = client.GetContainerAppManagedEnvironmentResource(containerAppManagedEnvironmentResourceId); + + // get the collection of this HttpRouteConfigResource + HttpRouteConfigCollection collection = containerAppManagedEnvironment.GetHttpRouteConfigs(); + + // invoke the operation + string httpRouteName = "httproutefriendlyname"; + HttpRouteConfigData data = new HttpRouteConfigData + { + Properties = new HttpRouteConfigProperties + { + CustomDomains = {new ContainerAppCustomDomain("example.com") +{ +BindingType = ContainerAppCustomDomainBindingType.Disabled, +CertificateId = new ResourceIdentifier("/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/examplerg/providers/Microsoft.App/managedEnvironments/testcontainerenv/certificates/certificate-1"), +}}, + Rules = {new HttpRouteRule +{ +Targets = {new HttpRouteTarget("capp-1") +{ +Label = "label-1", +}}, +Routes = {new HttpRoute +{ +Match = new HttpRouteMatch +{ +Prefix = "/v1", +CaseSensitive = true, +}, +ActionPrefixRewrite = "/v1/api", +}}, +Description = "random-description", +}}, + }, + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, httpRouteName, data); + HttpRouteConfigResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + HttpRouteConfigData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_GetHttpRoute() + { + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/HttpRouteConfig_Get.json + // this example is just showing the usage of "HttpRouteConfig_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ContainerAppManagedEnvironmentResource created on azure + // for more information of creating ContainerAppManagedEnvironmentResource, please refer to the document of ContainerAppManagedEnvironmentResource + string subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; + string resourceGroupName = "examplerg"; + string environmentName = "testcontainerenv"; + ResourceIdentifier containerAppManagedEnvironmentResourceId = ContainerAppManagedEnvironmentResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, environmentName); + ContainerAppManagedEnvironmentResource containerAppManagedEnvironment = client.GetContainerAppManagedEnvironmentResource(containerAppManagedEnvironmentResourceId); + + // get the collection of this HttpRouteConfigResource + HttpRouteConfigCollection collection = containerAppManagedEnvironment.GetHttpRouteConfigs(); + + // invoke the operation + string httpRouteName = "httproutefriendlyname"; + HttpRouteConfigResource result = await collection.GetAsync(httpRouteName); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + HttpRouteConfigData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetAll_ListManagedHttpRoutesByManagedEnvironment() + { + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/HttpRouteConfig_ListByManagedEnvironment.json + // this example is just showing the usage of "HttpRouteConfig_List" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ContainerAppManagedEnvironmentResource created on azure + // for more information of creating ContainerAppManagedEnvironmentResource, please refer to the document of ContainerAppManagedEnvironmentResource + string subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; + string resourceGroupName = "examplerg"; + string environmentName = "testcontainerenv"; + ResourceIdentifier containerAppManagedEnvironmentResourceId = ContainerAppManagedEnvironmentResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, environmentName); + ContainerAppManagedEnvironmentResource containerAppManagedEnvironment = client.GetContainerAppManagedEnvironmentResource(containerAppManagedEnvironmentResourceId); + + // get the collection of this HttpRouteConfigResource + HttpRouteConfigCollection collection = containerAppManagedEnvironment.GetHttpRouteConfigs(); + + // invoke the operation and iterate over the result + await foreach (HttpRouteConfigResource item in collection.GetAllAsync()) + { + // the variable item is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + HttpRouteConfigData resourceData = item.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Exists_GetHttpRoute() + { + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/HttpRouteConfig_Get.json + // this example is just showing the usage of "HttpRouteConfig_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ContainerAppManagedEnvironmentResource created on azure + // for more information of creating ContainerAppManagedEnvironmentResource, please refer to the document of ContainerAppManagedEnvironmentResource + string subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; + string resourceGroupName = "examplerg"; + string environmentName = "testcontainerenv"; + ResourceIdentifier containerAppManagedEnvironmentResourceId = ContainerAppManagedEnvironmentResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, environmentName); + ContainerAppManagedEnvironmentResource containerAppManagedEnvironment = client.GetContainerAppManagedEnvironmentResource(containerAppManagedEnvironmentResourceId); + + // get the collection of this HttpRouteConfigResource + HttpRouteConfigCollection collection = containerAppManagedEnvironment.GetHttpRouteConfigs(); + + // invoke the operation + string httpRouteName = "httproutefriendlyname"; + bool result = await collection.ExistsAsync(httpRouteName); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetIfExists_GetHttpRoute() + { + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/HttpRouteConfig_Get.json + // this example is just showing the usage of "HttpRouteConfig_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ContainerAppManagedEnvironmentResource created on azure + // for more information of creating ContainerAppManagedEnvironmentResource, please refer to the document of ContainerAppManagedEnvironmentResource + string subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; + string resourceGroupName = "examplerg"; + string environmentName = "testcontainerenv"; + ResourceIdentifier containerAppManagedEnvironmentResourceId = ContainerAppManagedEnvironmentResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, environmentName); + ContainerAppManagedEnvironmentResource containerAppManagedEnvironment = client.GetContainerAppManagedEnvironmentResource(containerAppManagedEnvironmentResourceId); + + // get the collection of this HttpRouteConfigResource + HttpRouteConfigCollection collection = containerAppManagedEnvironment.GetHttpRouteConfigs(); + + // invoke the operation + string httpRouteName = "httproutefriendlyname"; + NullableResponse response = await collection.GetIfExistsAsync(httpRouteName); + HttpRouteConfigResource result = response.HasValue ? response.Value : null; + + if (result == null) + { + Console.WriteLine("Succeeded with null as result"); + } + else + { + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + HttpRouteConfigData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + } +} diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/tests/Generated/Samples/Sample_HttpRouteConfigResource.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/tests/Generated/Samples/Sample_HttpRouteConfigResource.cs new file mode 100644 index 000000000000..6120df944fb5 --- /dev/null +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/tests/Generated/Samples/Sample_HttpRouteConfigResource.cs @@ -0,0 +1,137 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.AppContainers.Models; +using NUnit.Framework; + +namespace Azure.ResourceManager.AppContainers.Samples +{ + public partial class Sample_HttpRouteConfigResource + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_GetHttpRoute() + { + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/HttpRouteConfig_Get.json + // this example is just showing the usage of "HttpRouteConfig_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this HttpRouteConfigResource created on azure + // for more information of creating HttpRouteConfigResource, please refer to the document of HttpRouteConfigResource + string subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; + string resourceGroupName = "examplerg"; + string environmentName = "testcontainerenv"; + string httpRouteName = "httproutefriendlyname"; + ResourceIdentifier httpRouteConfigResourceId = HttpRouteConfigResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, environmentName, httpRouteName); + HttpRouteConfigResource httpRouteConfig = client.GetHttpRouteConfigResource(httpRouteConfigResourceId); + + // invoke the operation + HttpRouteConfigResource result = await httpRouteConfig.GetAsync(); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + HttpRouteConfigData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Delete_DeleteCertificate() + { + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/HttpRouteConfig_Delete.json + // this example is just showing the usage of "HttpRouteConfig_Delete" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this HttpRouteConfigResource created on azure + // for more information of creating HttpRouteConfigResource, please refer to the document of HttpRouteConfigResource + string subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; + string resourceGroupName = "examplerg"; + string environmentName = "testcontainerenv"; + string httpRouteName = "httproutefriendlyname"; + ResourceIdentifier httpRouteConfigResourceId = HttpRouteConfigResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, environmentName, httpRouteName); + HttpRouteConfigResource httpRouteConfig = client.GetHttpRouteConfigResource(httpRouteConfigResourceId); + + // invoke the operation + await httpRouteConfig.DeleteAsync(WaitUntil.Completed); + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Update_PatchManagedHttpRoute() + { + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/HttpRouteConfig_Patch.json + // this example is just showing the usage of "HttpRouteConfig_Update" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this HttpRouteConfigResource created on azure + // for more information of creating HttpRouteConfigResource, please refer to the document of HttpRouteConfigResource + string subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; + string resourceGroupName = "examplerg"; + string environmentName = "testcontainerenv"; + string httpRouteName = "httproutefriendlyname"; + ResourceIdentifier httpRouteConfigResourceId = HttpRouteConfigResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, environmentName, httpRouteName); + HttpRouteConfigResource httpRouteConfig = client.GetHttpRouteConfigResource(httpRouteConfigResourceId); + + // invoke the operation + HttpRouteConfigData data = new HttpRouteConfigData + { + Properties = new HttpRouteConfigProperties + { + CustomDomains = {new ContainerAppCustomDomain("example.com") +{ +BindingType = ContainerAppCustomDomainBindingType.SniEnabled, +CertificateId = new ResourceIdentifier("/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/examplerg/providers/Microsoft.App/managedEnvironments/testcontainerenv/certificates/certificate-1"), +}}, + Rules = {new HttpRouteRule +{ +Targets = {new HttpRouteTarget("capp-1") +{ +Revision = "rev-1", +Weight = 100, +}}, +Routes = {new HttpRoute +{ +Match = new HttpRouteMatch +{ +Path = "/v1", +CaseSensitive = true, +}, +ActionPrefixRewrite = "/v1/api", +}}, +Description = "random-description", +}}, + }, + }; + HttpRouteConfigResource result = await httpRouteConfig.UpdateAsync(data); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + HttpRouteConfigData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } +} diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/tests/Generated/Samples/Sample_JavaComponentCollection.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/tests/Generated/Samples/Sample_JavaComponentCollection.cs index 44c098173b33..26dcbd152c8a 100644 --- a/sdk/containerapps/Azure.ResourceManager.AppContainers/tests/Generated/Samples/Sample_JavaComponentCollection.cs +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/tests/Generated/Samples/Sample_JavaComponentCollection.cs @@ -20,7 +20,7 @@ public partial class Sample_JavaComponentCollection [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_CreateOrUpdateJavaComponent() { - // Generated from example definition: specification/app/resource-manager/Microsoft.App/stable/2025-01-01/examples/JavaComponents_CreateOrUpdate.json + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/JavaComponents_CreateOrUpdate.json // this example is just showing the usage of "JavaComponents_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -75,7 +75,7 @@ public async Task CreateOrUpdate_CreateOrUpdateJavaComponent() [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_CreateOrUpdateJavaComponentWithServiceBinds() { - // Generated from example definition: specification/app/resource-manager/Microsoft.App/stable/2025-01-01/examples/JavaComponents_CreateOrUpdate_ServiceBind.json + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/JavaComponents_CreateOrUpdate_ServiceBind.json // this example is just showing the usage of "JavaComponents_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -135,7 +135,7 @@ public async Task CreateOrUpdate_CreateOrUpdateJavaComponentWithServiceBinds() [Ignore("Only validating compilation of examples")] public async Task Get_GetJavaComponent() { - // Generated from example definition: specification/app/resource-manager/Microsoft.App/stable/2025-01-01/examples/JavaComponents_Get.json + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/JavaComponents_Get.json // this example is just showing the usage of "JavaComponents_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -169,7 +169,7 @@ public async Task Get_GetJavaComponent() [Ignore("Only validating compilation of examples")] public async Task Get_GetJavaComponentWithServiceBinds() { - // Generated from example definition: specification/app/resource-manager/Microsoft.App/stable/2025-01-01/examples/JavaComponents_Get_ServiceBind.json + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/JavaComponents_Get_ServiceBind.json // this example is just showing the usage of "JavaComponents_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -203,7 +203,7 @@ public async Task Get_GetJavaComponentWithServiceBinds() [Ignore("Only validating compilation of examples")] public async Task GetAll_ListJavaComponents() { - // Generated from example definition: specification/app/resource-manager/Microsoft.App/stable/2025-01-01/examples/JavaComponents_List.json + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/JavaComponents_List.json // this example is just showing the usage of "JavaComponents_List" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -239,7 +239,7 @@ public async Task GetAll_ListJavaComponents() [Ignore("Only validating compilation of examples")] public async Task GetAll_ListJavaComponentsWithServiceBinds() { - // Generated from example definition: specification/app/resource-manager/Microsoft.App/stable/2025-01-01/examples/JavaComponents_List_ServiceBind.json + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/JavaComponents_List_ServiceBind.json // this example is just showing the usage of "JavaComponents_List" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -275,7 +275,7 @@ public async Task GetAll_ListJavaComponentsWithServiceBinds() [Ignore("Only validating compilation of examples")] public async Task Exists_GetJavaComponent() { - // Generated from example definition: specification/app/resource-manager/Microsoft.App/stable/2025-01-01/examples/JavaComponents_Get.json + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/JavaComponents_Get.json // this example is just showing the usage of "JavaComponents_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -305,7 +305,7 @@ public async Task Exists_GetJavaComponent() [Ignore("Only validating compilation of examples")] public async Task Exists_GetJavaComponentWithServiceBinds() { - // Generated from example definition: specification/app/resource-manager/Microsoft.App/stable/2025-01-01/examples/JavaComponents_Get_ServiceBind.json + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/JavaComponents_Get_ServiceBind.json // this example is just showing the usage of "JavaComponents_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -335,7 +335,7 @@ public async Task Exists_GetJavaComponentWithServiceBinds() [Ignore("Only validating compilation of examples")] public async Task GetIfExists_GetJavaComponent() { - // Generated from example definition: specification/app/resource-manager/Microsoft.App/stable/2025-01-01/examples/JavaComponents_Get.json + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/JavaComponents_Get.json // this example is just showing the usage of "JavaComponents_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -377,7 +377,7 @@ public async Task GetIfExists_GetJavaComponent() [Ignore("Only validating compilation of examples")] public async Task GetIfExists_GetJavaComponentWithServiceBinds() { - // Generated from example definition: specification/app/resource-manager/Microsoft.App/stable/2025-01-01/examples/JavaComponents_Get_ServiceBind.json + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/JavaComponents_Get_ServiceBind.json // this example is just showing the usage of "JavaComponents_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/tests/Generated/Samples/Sample_JavaComponentResource.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/tests/Generated/Samples/Sample_JavaComponentResource.cs index 4a6f2f0ce54d..c6d8abc17280 100644 --- a/sdk/containerapps/Azure.ResourceManager.AppContainers/tests/Generated/Samples/Sample_JavaComponentResource.cs +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/tests/Generated/Samples/Sample_JavaComponentResource.cs @@ -20,7 +20,7 @@ public partial class Sample_JavaComponentResource [Ignore("Only validating compilation of examples")] public async Task Get_GetJavaComponent() { - // Generated from example definition: specification/app/resource-manager/Microsoft.App/stable/2025-01-01/examples/JavaComponents_Get.json + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/JavaComponents_Get.json // this example is just showing the usage of "JavaComponents_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -51,7 +51,7 @@ public async Task Get_GetJavaComponent() [Ignore("Only validating compilation of examples")] public async Task Get_GetJavaComponentWithServiceBinds() { - // Generated from example definition: specification/app/resource-manager/Microsoft.App/stable/2025-01-01/examples/JavaComponents_Get_ServiceBind.json + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/JavaComponents_Get_ServiceBind.json // this example is just showing the usage of "JavaComponents_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -82,7 +82,7 @@ public async Task Get_GetJavaComponentWithServiceBinds() [Ignore("Only validating compilation of examples")] public async Task Delete_DeleteJavaComponent() { - // Generated from example definition: specification/app/resource-manager/Microsoft.App/stable/2025-01-01/examples/JavaComponents_Delete.json + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/JavaComponents_Delete.json // this example is just showing the usage of "JavaComponents_Delete" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -109,7 +109,7 @@ public async Task Delete_DeleteJavaComponent() [Ignore("Only validating compilation of examples")] public async Task Update_PatchJavaComponent() { - // Generated from example definition: specification/app/resource-manager/Microsoft.App/stable/2025-01-01/examples/JavaComponents_Patch.json + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/JavaComponents_Patch.json // this example is just showing the usage of "JavaComponents_Update" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -161,7 +161,7 @@ public async Task Update_PatchJavaComponent() [Ignore("Only validating compilation of examples")] public async Task Update_PatchJavaComponentWithServiceBinds() { - // Generated from example definition: specification/app/resource-manager/Microsoft.App/stable/2025-01-01/examples/JavaComponents_Patch_ServiceBind.json + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/JavaComponents_Patch_ServiceBind.json // this example is just showing the usage of "JavaComponents_Update" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/tests/Generated/Samples/Sample_LabelHistoryCollection.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/tests/Generated/Samples/Sample_LabelHistoryCollection.cs new file mode 100644 index 000000000000..0babd914facf --- /dev/null +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/tests/Generated/Samples/Sample_LabelHistoryCollection.cs @@ -0,0 +1,160 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using NUnit.Framework; + +namespace Azure.ResourceManager.AppContainers.Samples +{ + public partial class Sample_LabelHistoryCollection + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_GetContainerAppSSingleLabelHistory() + { + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/LabelHistory_Get.json + // this example is just showing the usage of "ContainerAppsLabelHistory_GetLabelHistory" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ContainerAppResource created on azure + // for more information of creating ContainerAppResource, please refer to the document of ContainerAppResource + string subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; + string resourceGroupName = "rg"; + string containerAppName = "testContainerApp"; + ResourceIdentifier containerAppResourceId = ContainerAppResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, containerAppName); + ContainerAppResource containerApp = client.GetContainerAppResource(containerAppResourceId); + + // get the collection of this LabelHistoryResource + LabelHistoryCollection collection = containerApp.GetLabelHistories(); + + // invoke the operation + string labelName = "dev"; + LabelHistoryResource result = await collection.GetAsync(labelName); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + LabelHistoryData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetAll_ListContainerAppSAllLabelHistory() + { + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/LabelHistory_List.json + // this example is just showing the usage of "ContainerAppsLabelHistory_ListLabelHistory" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ContainerAppResource created on azure + // for more information of creating ContainerAppResource, please refer to the document of ContainerAppResource + string subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; + string resourceGroupName = "rg"; + string containerAppName = "testContainerApp"; + ResourceIdentifier containerAppResourceId = ContainerAppResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, containerAppName); + ContainerAppResource containerApp = client.GetContainerAppResource(containerAppResourceId); + + // get the collection of this LabelHistoryResource + LabelHistoryCollection collection = containerApp.GetLabelHistories(); + + // invoke the operation and iterate over the result + await foreach (LabelHistoryResource item in collection.GetAllAsync()) + { + // the variable item is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + LabelHistoryData resourceData = item.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Exists_GetContainerAppSSingleLabelHistory() + { + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/LabelHistory_Get.json + // this example is just showing the usage of "ContainerAppsLabelHistory_GetLabelHistory" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ContainerAppResource created on azure + // for more information of creating ContainerAppResource, please refer to the document of ContainerAppResource + string subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; + string resourceGroupName = "rg"; + string containerAppName = "testContainerApp"; + ResourceIdentifier containerAppResourceId = ContainerAppResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, containerAppName); + ContainerAppResource containerApp = client.GetContainerAppResource(containerAppResourceId); + + // get the collection of this LabelHistoryResource + LabelHistoryCollection collection = containerApp.GetLabelHistories(); + + // invoke the operation + string labelName = "dev"; + bool result = await collection.ExistsAsync(labelName); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetIfExists_GetContainerAppSSingleLabelHistory() + { + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/LabelHistory_Get.json + // this example is just showing the usage of "ContainerAppsLabelHistory_GetLabelHistory" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ContainerAppResource created on azure + // for more information of creating ContainerAppResource, please refer to the document of ContainerAppResource + string subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; + string resourceGroupName = "rg"; + string containerAppName = "testContainerApp"; + ResourceIdentifier containerAppResourceId = ContainerAppResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, containerAppName); + ContainerAppResource containerApp = client.GetContainerAppResource(containerAppResourceId); + + // get the collection of this LabelHistoryResource + LabelHistoryCollection collection = containerApp.GetLabelHistories(); + + // invoke the operation + string labelName = "dev"; + NullableResponse response = await collection.GetIfExistsAsync(labelName); + LabelHistoryResource result = response.HasValue ? response.Value : null; + + if (result == null) + { + Console.WriteLine("Succeeded with null as result"); + } + else + { + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + LabelHistoryData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + } +} diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/tests/Generated/Samples/Sample_LabelHistoryResource.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/tests/Generated/Samples/Sample_LabelHistoryResource.cs new file mode 100644 index 000000000000..66f6ffbd65f7 --- /dev/null +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/tests/Generated/Samples/Sample_LabelHistoryResource.cs @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using NUnit.Framework; + +namespace Azure.ResourceManager.AppContainers.Samples +{ + public partial class Sample_LabelHistoryResource + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_GetContainerAppSSingleLabelHistory() + { + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/LabelHistory_Get.json + // this example is just showing the usage of "ContainerAppsLabelHistory_GetLabelHistory" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this LabelHistoryResource created on azure + // for more information of creating LabelHistoryResource, please refer to the document of LabelHistoryResource + string subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; + string resourceGroupName = "rg"; + string containerAppName = "testContainerApp"; + string labelName = "dev"; + ResourceIdentifier labelHistoryResourceId = LabelHistoryResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, containerAppName, labelName); + LabelHistoryResource labelHistory = client.GetLabelHistoryResource(labelHistoryResourceId); + + // invoke the operation + LabelHistoryResource result = await labelHistory.GetAsync(); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + LabelHistoryData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Delete_DeleteContainerAppSLabelHistoryForAGivenLabel() + { + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/LabelHistory_Delete.json + // this example is just showing the usage of "ContainerAppsLabelHistory_DeleteLabelHistory" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this LabelHistoryResource created on azure + // for more information of creating LabelHistoryResource, please refer to the document of LabelHistoryResource + string subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; + string resourceGroupName = "rg"; + string containerAppName = "testContainerApp"; + string labelName = "dev"; + ResourceIdentifier labelHistoryResourceId = LabelHistoryResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, containerAppName, labelName); + LabelHistoryResource labelHistory = client.GetLabelHistoryResource(labelHistoryResourceId); + + // invoke the operation + await labelHistory.DeleteAsync(WaitUntil.Completed); + + Console.WriteLine("Succeeded"); + } + } +} diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/tests/Generated/Samples/Sample_LogicAppCollection.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/tests/Generated/Samples/Sample_LogicAppCollection.cs new file mode 100644 index 000000000000..a7da85ad0ba8 --- /dev/null +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/tests/Generated/Samples/Sample_LogicAppCollection.cs @@ -0,0 +1,163 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using NUnit.Framework; + +namespace Azure.ResourceManager.AppContainers.Samples +{ + public partial class Sample_LogicAppCollection + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task CreateOrUpdate_CreateLogicAppExtension() + { + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/LogicApps_Create.json + // this example is just showing the usage of "LogicApps_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ContainerAppResource created on azure + // for more information of creating ContainerAppResource, please refer to the document of ContainerAppResource + string subscriptionId = "8efdecc5-919e-44eb-b179-915dca89ebf9"; + string resourceGroupName = "examplerg"; + string containerAppName = "testcontainerApp0"; + ResourceIdentifier containerAppResourceId = ContainerAppResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, containerAppName); + ContainerAppResource containerApp = client.GetContainerAppResource(containerAppResourceId); + + // get the collection of this LogicAppResource + LogicAppCollection collection = containerApp.GetLogicApps(); + + // invoke the operation + string logicAppName = "testcontainerApp0"; + LogicAppData data = new LogicAppData + { + Properties = BinaryData.FromObjectAsJson(new object()), + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, logicAppName, data); + LogicAppResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + LogicAppData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_GetLogicAppExtensionByName() + { + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/LogicApps_Get.json + // this example is just showing the usage of "LogicApps_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ContainerAppResource created on azure + // for more information of creating ContainerAppResource, please refer to the document of ContainerAppResource + string subscriptionId = "8efdecc5-919e-44eb-b179-915dca89ebf9"; + string resourceGroupName = "examplerg"; + string containerAppName = "testcontainerApp0"; + ResourceIdentifier containerAppResourceId = ContainerAppResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, containerAppName); + ContainerAppResource containerApp = client.GetContainerAppResource(containerAppResourceId); + + // get the collection of this LogicAppResource + LogicAppCollection collection = containerApp.GetLogicApps(); + + // invoke the operation + string logicAppName = "testcontainerApp0"; + LogicAppResource result = await collection.GetAsync(logicAppName); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + LogicAppData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Exists_GetLogicAppExtensionByName() + { + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/LogicApps_Get.json + // this example is just showing the usage of "LogicApps_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ContainerAppResource created on azure + // for more information of creating ContainerAppResource, please refer to the document of ContainerAppResource + string subscriptionId = "8efdecc5-919e-44eb-b179-915dca89ebf9"; + string resourceGroupName = "examplerg"; + string containerAppName = "testcontainerApp0"; + ResourceIdentifier containerAppResourceId = ContainerAppResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, containerAppName); + ContainerAppResource containerApp = client.GetContainerAppResource(containerAppResourceId); + + // get the collection of this LogicAppResource + LogicAppCollection collection = containerApp.GetLogicApps(); + + // invoke the operation + string logicAppName = "testcontainerApp0"; + bool result = await collection.ExistsAsync(logicAppName); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetIfExists_GetLogicAppExtensionByName() + { + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/LogicApps_Get.json + // this example is just showing the usage of "LogicApps_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ContainerAppResource created on azure + // for more information of creating ContainerAppResource, please refer to the document of ContainerAppResource + string subscriptionId = "8efdecc5-919e-44eb-b179-915dca89ebf9"; + string resourceGroupName = "examplerg"; + string containerAppName = "testcontainerApp0"; + ResourceIdentifier containerAppResourceId = ContainerAppResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, containerAppName); + ContainerAppResource containerApp = client.GetContainerAppResource(containerAppResourceId); + + // get the collection of this LogicAppResource + LogicAppCollection collection = containerApp.GetLogicApps(); + + // invoke the operation + string logicAppName = "testcontainerApp0"; + NullableResponse response = await collection.GetIfExistsAsync(logicAppName); + LogicAppResource result = response.HasValue ? response.Value : null; + + if (result == null) + { + Console.WriteLine("Succeeded with null as result"); + } + else + { + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + LogicAppData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + } +} diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/tests/Generated/Samples/Sample_LogicAppResource.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/tests/Generated/Samples/Sample_LogicAppResource.cs new file mode 100644 index 000000000000..9030b0123457 --- /dev/null +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/tests/Generated/Samples/Sample_LogicAppResource.cs @@ -0,0 +1,293 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.AppContainers.Models; +using NUnit.Framework; + +namespace Azure.ResourceManager.AppContainers.Samples +{ + public partial class Sample_LogicAppResource + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_GetLogicAppExtensionByName() + { + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/LogicApps_Get.json + // this example is just showing the usage of "LogicApps_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this LogicAppResource created on azure + // for more information of creating LogicAppResource, please refer to the document of LogicAppResource + string subscriptionId = "8efdecc5-919e-44eb-b179-915dca89ebf9"; + string resourceGroupName = "examplerg"; + string containerAppName = "testcontainerApp0"; + string logicAppName = "testcontainerApp0"; + ResourceIdentifier logicAppResourceId = LogicAppResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, containerAppName, logicAppName); + LogicAppResource logicApp = client.GetLogicAppResource(logicAppResourceId); + + // invoke the operation + LogicAppResource result = await logicApp.GetAsync(); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + LogicAppData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Delete_CreateLogicAppExtension() + { + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/LogicApps_Delete.json + // this example is just showing the usage of "LogicApps_Delete" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this LogicAppResource created on azure + // for more information of creating LogicAppResource, please refer to the document of LogicAppResource + string subscriptionId = "8efdecc5-919e-44eb-b179-915dca89ebf9"; + string resourceGroupName = "examplerg"; + string containerAppName = "testcontainerApp0"; + string logicAppName = "testcontainerApp0"; + ResourceIdentifier logicAppResourceId = LogicAppResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, containerAppName, logicAppName); + LogicAppResource logicApp = client.GetLogicAppResource(logicAppResourceId); + + // invoke the operation + await logicApp.DeleteAsync(WaitUntil.Completed); + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Update_CreateLogicAppExtension() + { + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/LogicApps_Create.json + // this example is just showing the usage of "LogicApps_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this LogicAppResource created on azure + // for more information of creating LogicAppResource, please refer to the document of LogicAppResource + string subscriptionId = "8efdecc5-919e-44eb-b179-915dca89ebf9"; + string resourceGroupName = "examplerg"; + string containerAppName = "testcontainerApp0"; + string logicAppName = "testcontainerApp0"; + ResourceIdentifier logicAppResourceId = LogicAppResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, containerAppName, logicAppName); + LogicAppResource logicApp = client.GetLogicAppResource(logicAppResourceId); + + // invoke the operation + LogicAppData data = new LogicAppData + { + Properties = BinaryData.FromObjectAsJson(new object()), + }; + ArmOperation lro = await logicApp.UpdateAsync(WaitUntil.Completed, data); + LogicAppResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + LogicAppData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task DeployWorkflowArtifacts_DeleteWorkflowArtifacts() + { + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/LogicApps_DeleteDeployWorkflowArtifacts.json + // this example is just showing the usage of "LogicApps_DeployWorkflowArtifacts" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this LogicAppResource created on azure + // for more information of creating LogicAppResource, please refer to the document of LogicAppResource + string subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; + string resourceGroupName = "testrg123"; + string containerAppName = "testapp2"; + string logicAppName = "testapp2"; + ResourceIdentifier logicAppResourceId = LogicAppResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, containerAppName, logicAppName); + LogicAppResource logicApp = client.GetLogicAppResource(logicAppResourceId); + + // invoke the operation + ContainerAppWorkflowArtifacts workflowArtifacts = new ContainerAppWorkflowArtifacts + { + FilesToDelete = { "test/workflow.json", "test/" }, + }; + await logicApp.DeployWorkflowArtifactsAsync(workflowArtifacts: workflowArtifacts); + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task DeployWorkflowArtifacts_DeploysWorkflowArtifacts() + { + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/LogicApps_PostDeployWorkflowArtifacts.json + // this example is just showing the usage of "LogicApps_DeployWorkflowArtifacts" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this LogicAppResource created on azure + // for more information of creating LogicAppResource, please refer to the document of LogicAppResource + string subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; + string resourceGroupName = "testrg123"; + string containerAppName = "testapp2"; + string logicAppName = "testapp2"; + ResourceIdentifier logicAppResourceId = LogicAppResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, containerAppName, logicAppName); + LogicAppResource logicApp = client.GetLogicAppResource(logicAppResourceId); + + // invoke the operation + ContainerAppWorkflowArtifacts workflowArtifacts = new ContainerAppWorkflowArtifacts + { + AppSettings = BinaryData.FromObjectAsJson(new + { + eventHub_connectionString = "Endpoint=sb://example.servicebus.windows.net/;SharedAccessKeyName=RootManageSharedAccessKey;SharedAccessKey=EXAMPLE1a2b3c4d5e6fEXAMPLE=", + }), + Files = BinaryData.FromObjectAsJson(new Dictionary + { + ["connections.json"] = new + { + managedApiConnections = new object(), + serviceProviderConnections = new + { + eventHub = new + { + displayName = "example1", + parameterValues = new + { + connectionString = "@appsetting('eventHub_connectionString')", + }, + serviceProvider = new + { + id = "/serviceProviders/eventHub", + }, + }, + }, + }, + ["test1/workflow.json"] = new + { + definition = new Dictionary + { + ["$schema"] = "https://schema.management.azure.com/providers/Microsoft.Logic/schemas/2016-06-01/workflowdefinition.json#", + ["actions"] = new object(), + ["contentVersion"] = "1.0.0.0", + ["outputs"] = new object(), + ["triggers"] = new + { + When_events_are_available_in_Event_hub = new + { + type = "ServiceProvider", + inputs = new + { + parameters = new + { + eventHubName = "test123", + }, + serviceProviderConfiguration = new + { + operationId = "receiveEvents", + connectionName = "eventHub", + serviceProviderId = "/serviceProviders/eventHub", + }, + }, + splitOn = "@triggerOutputs()?['body']", + }, + } + }, + kind = "Stateful", + } + }), + }; + await logicApp.DeployWorkflowArtifactsAsync(workflowArtifacts: workflowArtifacts); + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetWorkflowsConnections_ListTheWorkflowsConfigurationConnections() + { + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/LogicApps_ListConnections.json + // this example is just showing the usage of "LogicApps_ListWorkflowsConnections" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this LogicAppResource created on azure + // for more information of creating LogicAppResource, please refer to the document of LogicAppResource + string subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; + string resourceGroupName = "testrg123"; + string containerAppName = "testapp2"; + string logicAppName = "testapp2"; + ResourceIdentifier logicAppResourceId = LogicAppResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, containerAppName, logicAppName); + LogicAppResource logicApp = client.GetLogicAppResource(logicAppResourceId); + + // invoke the operation + WorkflowEnvelopeResource result = await logicApp.GetWorkflowsConnectionsAsync(); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + WorkflowEnvelopeData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Invoke_GetWorkflowListCallBackURL() + { + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/LogicApps_ListCallbackURL.json + // this example is just showing the usage of "LogicApps_Invoke" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this LogicAppResource created on azure + // for more information of creating LogicAppResource, please refer to the document of LogicAppResource + string subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; + string resourceGroupName = "testrg123"; + string containerAppName = "testapp2"; + string logicAppName = "testapp2"; + ResourceIdentifier logicAppResourceId = LogicAppResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, containerAppName, logicAppName); + LogicAppResource logicApp = client.GetLogicAppResource(logicAppResourceId); + + // invoke the operation + string xMsLogicAppsProxyPath = null; + LogicAppsProxyMethod xMsLogicAppsProxyMethod = default; + BinaryData result = await logicApp.InvokeAsync(xMsLogicAppsProxyPath, xMsLogicAppsProxyMethod); + + Console.WriteLine($"Succeeded: {result}"); + } + } +} diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/tests/Generated/Samples/Sample_MaintenanceConfigurationResource.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/tests/Generated/Samples/Sample_MaintenanceConfigurationResource.cs new file mode 100644 index 000000000000..126147ccd068 --- /dev/null +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/tests/Generated/Samples/Sample_MaintenanceConfigurationResource.cs @@ -0,0 +1,113 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.AppContainers.Models; +using NUnit.Framework; + +namespace Azure.ResourceManager.AppContainers.Samples +{ + public partial class Sample_MaintenanceConfigurationResource + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_ManagedEnvironmentMaintenanceConfigurationsGet() + { + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/ManagedEnvironment_MaintenanceConfigurations_Get.json + // this example is just showing the usage of "MaintenanceConfigurations_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this MaintenanceConfigurationResource created on azure + // for more information of creating MaintenanceConfigurationResource, please refer to the document of MaintenanceConfigurationResource + string subscriptionId = "8efdecc5-919e-44eb-b179-915dca89ebf9"; + string resourceGroupName = "rg1"; + string environmentName = "managedEnv"; + string configName = "default"; + ResourceIdentifier maintenanceConfigurationResourceId = MaintenanceConfigurationResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, environmentName, configName); + MaintenanceConfigurationResource maintenanceConfigurationResource = client.GetMaintenanceConfigurationResource(maintenanceConfigurationResourceId); + + // invoke the operation + MaintenanceConfigurationResource result = await maintenanceConfigurationResource.GetAsync(); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + MaintenanceConfigurationResourceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Delete_ManagedEnvironmentMaintenanceConfigurationsDelete() + { + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/ManagedEnvironment_MaintenanceConfigurations_Delete.json + // this example is just showing the usage of "MaintenanceConfigurations_Delete" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this MaintenanceConfigurationResource created on azure + // for more information of creating MaintenanceConfigurationResource, please refer to the document of MaintenanceConfigurationResource + string subscriptionId = "8efdecc5-919e-44eb-b179-915dca89ebf9"; + string resourceGroupName = "rg1"; + string environmentName = "managedEnv"; + string configName = "default"; + ResourceIdentifier maintenanceConfigurationResourceId = MaintenanceConfigurationResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, environmentName, configName); + MaintenanceConfigurationResource maintenanceConfigurationResource = client.GetMaintenanceConfigurationResource(maintenanceConfigurationResourceId); + + // invoke the operation + await maintenanceConfigurationResource.DeleteAsync(WaitUntil.Completed); + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Update_ManagedEnvironmentMaintenanceConfigurationsCreateOrUpdate() + { + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/ManagedEnvironment_MaintenanceConfigurations_CreateOrUpdate.json + // this example is just showing the usage of "MaintenanceConfigurations_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this MaintenanceConfigurationResource created on azure + // for more information of creating MaintenanceConfigurationResource, please refer to the document of MaintenanceConfigurationResource + string subscriptionId = "8efdecc5-919e-44eb-b179-915dca89ebf9"; + string resourceGroupName = "rg1"; + string environmentName = "managedEnv"; + string configName = "default"; + ResourceIdentifier maintenanceConfigurationResourceId = MaintenanceConfigurationResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, environmentName, configName); + MaintenanceConfigurationResource maintenanceConfigurationResource = client.GetMaintenanceConfigurationResource(maintenanceConfigurationResourceId); + + // invoke the operation + MaintenanceConfigurationResourceData data = new MaintenanceConfigurationResourceData + { + ScheduledEntries = { new ScheduledEntry(ContainerAppWeekDay.Sunday, 12, 9) }, + }; + ArmOperation lro = await maintenanceConfigurationResource.UpdateAsync(WaitUntil.Completed, data); + MaintenanceConfigurationResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + MaintenanceConfigurationResourceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } +} diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/tests/Generated/Samples/Sample_MaintenanceConfigurationResourceCollection.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/tests/Generated/Samples/Sample_MaintenanceConfigurationResourceCollection.cs new file mode 100644 index 000000000000..f096660a8832 --- /dev/null +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/tests/Generated/Samples/Sample_MaintenanceConfigurationResourceCollection.cs @@ -0,0 +1,200 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.AppContainers.Models; +using NUnit.Framework; + +namespace Azure.ResourceManager.AppContainers.Samples +{ + public partial class Sample_MaintenanceConfigurationResourceCollection + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task CreateOrUpdate_ManagedEnvironmentMaintenanceConfigurationsCreateOrUpdate() + { + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/ManagedEnvironment_MaintenanceConfigurations_CreateOrUpdate.json + // this example is just showing the usage of "MaintenanceConfigurations_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ContainerAppManagedEnvironmentResource created on azure + // for more information of creating ContainerAppManagedEnvironmentResource, please refer to the document of ContainerAppManagedEnvironmentResource + string subscriptionId = "8efdecc5-919e-44eb-b179-915dca89ebf9"; + string resourceGroupName = "rg1"; + string environmentName = "managedEnv"; + ResourceIdentifier containerAppManagedEnvironmentResourceId = ContainerAppManagedEnvironmentResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, environmentName); + ContainerAppManagedEnvironmentResource containerAppManagedEnvironment = client.GetContainerAppManagedEnvironmentResource(containerAppManagedEnvironmentResourceId); + + // get the collection of this MaintenanceConfigurationResource + MaintenanceConfigurationResourceCollection collection = containerAppManagedEnvironment.GetMaintenanceConfigurationResources(); + + // invoke the operation + string configName = "default"; + MaintenanceConfigurationResourceData data = new MaintenanceConfigurationResourceData + { + ScheduledEntries = { new ScheduledEntry(ContainerAppWeekDay.Sunday, 12, 9) }, + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, configName, data); + MaintenanceConfigurationResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + MaintenanceConfigurationResourceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_ManagedEnvironmentMaintenanceConfigurationsGet() + { + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/ManagedEnvironment_MaintenanceConfigurations_Get.json + // this example is just showing the usage of "MaintenanceConfigurations_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ContainerAppManagedEnvironmentResource created on azure + // for more information of creating ContainerAppManagedEnvironmentResource, please refer to the document of ContainerAppManagedEnvironmentResource + string subscriptionId = "8efdecc5-919e-44eb-b179-915dca89ebf9"; + string resourceGroupName = "rg1"; + string environmentName = "managedEnv"; + ResourceIdentifier containerAppManagedEnvironmentResourceId = ContainerAppManagedEnvironmentResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, environmentName); + ContainerAppManagedEnvironmentResource containerAppManagedEnvironment = client.GetContainerAppManagedEnvironmentResource(containerAppManagedEnvironmentResourceId); + + // get the collection of this MaintenanceConfigurationResource + MaintenanceConfigurationResourceCollection collection = containerAppManagedEnvironment.GetMaintenanceConfigurationResources(); + + // invoke the operation + string configName = "default"; + MaintenanceConfigurationResource result = await collection.GetAsync(configName); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + MaintenanceConfigurationResourceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetAll_ManagedEnvironmentMaintenanceConfigurationsList() + { + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/ManagedEnvironment_MaintenanceConfigurations_List.json + // this example is just showing the usage of "MaintenanceConfigurations_List" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ContainerAppManagedEnvironmentResource created on azure + // for more information of creating ContainerAppManagedEnvironmentResource, please refer to the document of ContainerAppManagedEnvironmentResource + string subscriptionId = "8efdecc5-919e-44eb-b179-915dca89ebf9"; + string resourceGroupName = "rg1"; + string environmentName = "managedEnv"; + ResourceIdentifier containerAppManagedEnvironmentResourceId = ContainerAppManagedEnvironmentResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, environmentName); + ContainerAppManagedEnvironmentResource containerAppManagedEnvironment = client.GetContainerAppManagedEnvironmentResource(containerAppManagedEnvironmentResourceId); + + // get the collection of this MaintenanceConfigurationResource + MaintenanceConfigurationResourceCollection collection = containerAppManagedEnvironment.GetMaintenanceConfigurationResources(); + + // invoke the operation and iterate over the result + await foreach (MaintenanceConfigurationResource item in collection.GetAllAsync()) + { + // the variable item is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + MaintenanceConfigurationResourceData resourceData = item.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Exists_ManagedEnvironmentMaintenanceConfigurationsGet() + { + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/ManagedEnvironment_MaintenanceConfigurations_Get.json + // this example is just showing the usage of "MaintenanceConfigurations_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ContainerAppManagedEnvironmentResource created on azure + // for more information of creating ContainerAppManagedEnvironmentResource, please refer to the document of ContainerAppManagedEnvironmentResource + string subscriptionId = "8efdecc5-919e-44eb-b179-915dca89ebf9"; + string resourceGroupName = "rg1"; + string environmentName = "managedEnv"; + ResourceIdentifier containerAppManagedEnvironmentResourceId = ContainerAppManagedEnvironmentResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, environmentName); + ContainerAppManagedEnvironmentResource containerAppManagedEnvironment = client.GetContainerAppManagedEnvironmentResource(containerAppManagedEnvironmentResourceId); + + // get the collection of this MaintenanceConfigurationResource + MaintenanceConfigurationResourceCollection collection = containerAppManagedEnvironment.GetMaintenanceConfigurationResources(); + + // invoke the operation + string configName = "default"; + bool result = await collection.ExistsAsync(configName); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetIfExists_ManagedEnvironmentMaintenanceConfigurationsGet() + { + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/ManagedEnvironment_MaintenanceConfigurations_Get.json + // this example is just showing the usage of "MaintenanceConfigurations_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ContainerAppManagedEnvironmentResource created on azure + // for more information of creating ContainerAppManagedEnvironmentResource, please refer to the document of ContainerAppManagedEnvironmentResource + string subscriptionId = "8efdecc5-919e-44eb-b179-915dca89ebf9"; + string resourceGroupName = "rg1"; + string environmentName = "managedEnv"; + ResourceIdentifier containerAppManagedEnvironmentResourceId = ContainerAppManagedEnvironmentResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, environmentName); + ContainerAppManagedEnvironmentResource containerAppManagedEnvironment = client.GetContainerAppManagedEnvironmentResource(containerAppManagedEnvironmentResourceId); + + // get the collection of this MaintenanceConfigurationResource + MaintenanceConfigurationResourceCollection collection = containerAppManagedEnvironment.GetMaintenanceConfigurationResources(); + + // invoke the operation + string configName = "default"; + NullableResponse response = await collection.GetIfExistsAsync(configName); + MaintenanceConfigurationResource result = response.HasValue ? response.Value : null; + + if (result == null) + { + Console.WriteLine("Succeeded with null as result"); + } + else + { + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + MaintenanceConfigurationResourceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + } +} diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/tests/Generated/Samples/Sample_SessionPoolCollection.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/tests/Generated/Samples/Sample_SessionPoolCollection.cs index d12367543878..ebd0937fcb74 100644 --- a/sdk/containerapps/Azure.ResourceManager.AppContainers/tests/Generated/Samples/Sample_SessionPoolCollection.cs +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/tests/Generated/Samples/Sample_SessionPoolCollection.cs @@ -22,7 +22,7 @@ public partial class Sample_SessionPoolCollection [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_CreateOrUpdateSessionPoolWithLifecycleOnContainerExitTimed() { - // Generated from example definition: specification/app/resource-manager/Microsoft.App/stable/2025-01-01/examples/SessionPools_LifecycleOnContainerExit_CreateOrUpdate.json + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/SessionPools_LifecycleOnContainerExit_CreateOrUpdate.json // this example is just showing the usage of "ContainerAppsSessionPools_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -99,7 +99,7 @@ public async Task CreateOrUpdate_CreateOrUpdateSessionPoolWithLifecycleOnContain [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_CreateOrUpdateSessionPoolWithLifecycleTypeTimed() { - // Generated from example definition: specification/app/resource-manager/Microsoft.App/stable/2025-01-01/examples/SessionPools_LifecycleTimed_CreateOrUpdate.json + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/SessionPools_LifecycleTimed_CreateOrUpdate.json // this example is just showing the usage of "ContainerAppsSessionPools_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -132,8 +132,8 @@ public async Task CreateOrUpdate_CreateOrUpdateSessionPoolWithLifecycleTypeTimed }, DynamicPoolLifecycleConfiguration = new SessionPoolLifecycleConfiguration { - LifecycleType = SessionPoolLifecycleType.OnContainerExit, - MaxAlivePeriodInSeconds = 86400, + LifecycleType = SessionPoolLifecycleType.Timed, + CooldownPeriodInSeconds = 600, }, CustomContainerTemplate = new CustomContainerTemplate { @@ -176,7 +176,7 @@ public async Task CreateOrUpdate_CreateOrUpdateSessionPoolWithLifecycleTypeTimed [Ignore("Only validating compilation of examples")] public async Task Get_GetSessionPool() { - // Generated from example definition: specification/app/resource-manager/Microsoft.App/stable/2025-01-01/examples/SessionPools_Get.json + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/SessionPools_Get.json // this example is just showing the usage of "ContainerAppsSessionPools_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -209,7 +209,7 @@ public async Task Get_GetSessionPool() [Ignore("Only validating compilation of examples")] public async Task GetAll_ListSessionPoolsByResourceGroup() { - // Generated from example definition: specification/app/resource-manager/Microsoft.App/stable/2025-01-01/examples/SessionPools_ListByResourceGroup.json + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/SessionPools_ListByResourceGroup.json // this example is just showing the usage of "ContainerAppsSessionPools_ListByResourceGroup" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -244,7 +244,7 @@ public async Task GetAll_ListSessionPoolsByResourceGroup() [Ignore("Only validating compilation of examples")] public async Task Exists_GetSessionPool() { - // Generated from example definition: specification/app/resource-manager/Microsoft.App/stable/2025-01-01/examples/SessionPools_Get.json + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/SessionPools_Get.json // this example is just showing the usage of "ContainerAppsSessionPools_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -273,7 +273,7 @@ public async Task Exists_GetSessionPool() [Ignore("Only validating compilation of examples")] public async Task GetIfExists_GetSessionPool() { - // Generated from example definition: specification/app/resource-manager/Microsoft.App/stable/2025-01-01/examples/SessionPools_Get.json + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/SessionPools_Get.json // this example is just showing the usage of "ContainerAppsSessionPools_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/tests/Generated/Samples/Sample_SessionPoolResource.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/tests/Generated/Samples/Sample_SessionPoolResource.cs index 238a64f1f7bd..5e483c7fc2ab 100644 --- a/sdk/containerapps/Azure.ResourceManager.AppContainers/tests/Generated/Samples/Sample_SessionPoolResource.cs +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/tests/Generated/Samples/Sample_SessionPoolResource.cs @@ -20,7 +20,7 @@ public partial class Sample_SessionPoolResource [Ignore("Only validating compilation of examples")] public async Task Get_GetSessionPool() { - // Generated from example definition: specification/app/resource-manager/Microsoft.App/stable/2025-01-01/examples/SessionPools_Get.json + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/SessionPools_Get.json // this example is just showing the usage of "ContainerAppsSessionPools_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -50,7 +50,7 @@ public async Task Get_GetSessionPool() [Ignore("Only validating compilation of examples")] public async Task Delete_DeleteSessionPool() { - // Generated from example definition: specification/app/resource-manager/Microsoft.App/stable/2025-01-01/examples/SessionPools_Delete.json + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/SessionPools_Delete.json // this example is just showing the usage of "ContainerAppsSessionPools_Delete" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -76,7 +76,7 @@ public async Task Delete_DeleteSessionPool() [Ignore("Only validating compilation of examples")] public async Task Update_UpdateSessionPool() { - // Generated from example definition: specification/app/resource-manager/Microsoft.App/stable/2025-01-01/examples/SessionPools_Patch.json + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/SessionPools_Patch.json // this example is just showing the usage of "ContainerAppsSessionPools_Update" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -100,6 +100,11 @@ public async Task Update_UpdateSessionPool() MaxConcurrentSessions = 500, ReadySessionInstances = 100, }, + DynamicPoolLifecycleConfiguration = new SessionPoolLifecycleConfiguration + { + LifecycleType = SessionPoolLifecycleType.Timed, + CooldownPeriodInSeconds = 600, + }, CustomContainerTemplate = new CustomContainerTemplate { Containers = {new SessionContainer diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/tests/Generated/Samples/Sample_SubscriptionResourceExtensions.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/tests/Generated/Samples/Sample_SubscriptionResourceExtensions.cs index bf06d8f7b726..074b4229c290 100644 --- a/sdk/containerapps/Azure.ResourceManager.AppContainers/tests/Generated/Samples/Sample_SubscriptionResourceExtensions.cs +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/tests/Generated/Samples/Sample_SubscriptionResourceExtensions.cs @@ -21,7 +21,7 @@ public partial class Sample_SubscriptionResourceExtensions [Ignore("Only validating compilation of examples")] public async Task GetAvailableWorkloadProfiles_BillingMetersGet() { - // Generated from example definition: specification/app/resource-manager/Microsoft.App/stable/2025-01-01/examples/AvailableWorkloadProfiles_Get.json + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/AvailableWorkloadProfiles_Get.json // this example is just showing the usage of "AvailableWorkloadProfiles_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -49,7 +49,7 @@ public async Task GetAvailableWorkloadProfiles_BillingMetersGet() [Ignore("Only validating compilation of examples")] public async Task GetBillingMeters_BillingMetersGet() { - // Generated from example definition: specification/app/resource-manager/Microsoft.App/stable/2025-01-01/examples/BillingMeters_Get.json + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/BillingMeters_Get.json // this example is just showing the usage of "BillingMeters_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -73,11 +73,42 @@ public async Task GetBillingMeters_BillingMetersGet() Console.WriteLine("Succeeded"); } + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetBuilderResources_BuildersListBySubscription0() + { + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/Builders_ListBySubscription.json + // this example is just showing the usage of "Builders_ListBySubscription" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this SubscriptionResource created on azure + // for more information of creating SubscriptionResource, please refer to the document of SubscriptionResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + ResourceIdentifier subscriptionResourceId = SubscriptionResource.CreateResourceIdentifier(subscriptionId); + SubscriptionResource subscriptionResource = client.GetSubscriptionResource(subscriptionResourceId); + + // invoke the operation and iterate over the result + await foreach (BuilderResource item in subscriptionResource.GetBuilderResourcesAsync()) + { + // the variable item is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + BuilderResourceData resourceData = item.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + Console.WriteLine("Succeeded"); + } + [Test] [Ignore("Only validating compilation of examples")] public async Task GetContainerAppConnectedEnvironments_ListConnectedEnvironmentsBySubscription() { - // Generated from example definition: specification/app/resource-manager/Microsoft.App/stable/2025-01-01/examples/ConnectedEnvironments_ListBySubscription.json + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/ConnectedEnvironments_ListBySubscription.json // this example is just showing the usage of "ConnectedEnvironments_ListBySubscription" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -108,7 +139,7 @@ public async Task GetContainerAppConnectedEnvironments_ListConnectedEnvironments [Ignore("Only validating compilation of examples")] public async Task GetContainerApps_ListContainerAppsBySubscription() { - // Generated from example definition: specification/app/resource-manager/Microsoft.App/stable/2025-01-01/examples/ContainerApps_ListBySubscription.json + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/ContainerApps_ListBySubscription.json // this example is just showing the usage of "ContainerApps_ListBySubscription" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -139,7 +170,7 @@ public async Task GetContainerApps_ListContainerAppsBySubscription() [Ignore("Only validating compilation of examples")] public async Task GetContainerAppJobs_ListContainerAppsJobsBySubscription() { - // Generated from example definition: specification/app/resource-manager/Microsoft.App/stable/2025-01-01/examples/Jobs_ListBySubscription.json + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/Jobs_ListBySubscription.json // this example is just showing the usage of "Jobs_ListBySubscription" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -170,7 +201,7 @@ public async Task GetContainerAppJobs_ListContainerAppsJobsBySubscription() [Ignore("Only validating compilation of examples")] public async Task GetCustomDomainVerificationId_ListAllOperations() { - // Generated from example definition: specification/app/resource-manager/Microsoft.App/stable/2025-01-01/examples/Subscriptions_GetCustomDomainVerificationId.json + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/Subscriptions_GetCustomDomainVerificationId.json // this example is just showing the usage of "GetCustomDomainVerificationId" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -194,7 +225,7 @@ public async Task GetCustomDomainVerificationId_ListAllOperations() [Ignore("Only validating compilation of examples")] public async Task GetContainerAppManagedEnvironments_ListEnvironmentsBySubscription() { - // Generated from example definition: specification/app/resource-manager/Microsoft.App/stable/2025-01-01/examples/ManagedEnvironments_ListBySubscription.json + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/ManagedEnvironments_ListBySubscription.json // this example is just showing the usage of "ManagedEnvironments_ListBySubscription" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -225,7 +256,7 @@ public async Task GetContainerAppManagedEnvironments_ListEnvironmentsBySubscript [Ignore("Only validating compilation of examples")] public async Task GetSessionPools_ListSessionPoolsBySubscription() { - // Generated from example definition: specification/app/resource-manager/Microsoft.App/stable/2025-01-01/examples/SessionPools_ListBySubscription.json + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/SessionPools_ListBySubscription.json // this example is just showing the usage of "ContainerAppsSessionPools_ListBySubscription" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -256,7 +287,7 @@ public async Task GetSessionPools_ListSessionPoolsBySubscription() [Ignore("Only validating compilation of examples")] public async Task GetUsages_ListUsages() { - // Generated from example definition: specification/app/resource-manager/Microsoft.App/stable/2025-01-01/examples/Usages_List.json + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/Usages_List.json // this example is just showing the usage of "Usages_List" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/tests/Generated/Samples/Sample_WorkflowEnvelopeCollection.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/tests/Generated/Samples/Sample_WorkflowEnvelopeCollection.cs new file mode 100644 index 000000000000..2f74ed0c9d91 --- /dev/null +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/tests/Generated/Samples/Sample_WorkflowEnvelopeCollection.cs @@ -0,0 +1,164 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using NUnit.Framework; + +namespace Azure.ResourceManager.AppContainers.Samples +{ + public partial class Sample_WorkflowEnvelopeCollection + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_GETAWorkflow() + { + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/LogicApps_GetWorkflow.json + // this example is just showing the usage of "LogicApps_GetWorkflow" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this LogicAppResource created on azure + // for more information of creating LogicAppResource, please refer to the document of LogicAppResource + string subscriptionId = "8efdecc5-919e-44eb-b179-915dca89ebf9"; + string resourceGroupName = "examplerg"; + string containerAppName = "testcontainerApp0"; + string logicAppName = "testcontainerApp0"; + ResourceIdentifier logicAppResourceId = LogicAppResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, containerAppName, logicAppName); + LogicAppResource logicApp = client.GetLogicAppResource(logicAppResourceId); + + // get the collection of this WorkflowEnvelopeResource + WorkflowEnvelopeCollection collection = logicApp.GetWorkflowEnvelopes(); + + // invoke the operation + string workflowName = "stateful1"; + WorkflowEnvelopeResource result = await collection.GetAsync(workflowName); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + WorkflowEnvelopeData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetAll_ListTheWorkflows() + { + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/LogicApps_ListWorkflows.json + // this example is just showing the usage of "LogicApps_ListWorkflows" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this LogicAppResource created on azure + // for more information of creating LogicAppResource, please refer to the document of LogicAppResource + string subscriptionId = "8efdecc5-919e-44eb-b179-915dca89ebf9"; + string resourceGroupName = "examplerg"; + string containerAppName = "testcontainerApp0"; + string logicAppName = "testcontainerApp0"; + ResourceIdentifier logicAppResourceId = LogicAppResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, containerAppName, logicAppName); + LogicAppResource logicApp = client.GetLogicAppResource(logicAppResourceId); + + // get the collection of this WorkflowEnvelopeResource + WorkflowEnvelopeCollection collection = logicApp.GetWorkflowEnvelopes(); + + // invoke the operation and iterate over the result + await foreach (WorkflowEnvelopeResource item in collection.GetAllAsync()) + { + // the variable item is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + WorkflowEnvelopeData resourceData = item.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Exists_GETAWorkflow() + { + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/LogicApps_GetWorkflow.json + // this example is just showing the usage of "LogicApps_GetWorkflow" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this LogicAppResource created on azure + // for more information of creating LogicAppResource, please refer to the document of LogicAppResource + string subscriptionId = "8efdecc5-919e-44eb-b179-915dca89ebf9"; + string resourceGroupName = "examplerg"; + string containerAppName = "testcontainerApp0"; + string logicAppName = "testcontainerApp0"; + ResourceIdentifier logicAppResourceId = LogicAppResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, containerAppName, logicAppName); + LogicAppResource logicApp = client.GetLogicAppResource(logicAppResourceId); + + // get the collection of this WorkflowEnvelopeResource + WorkflowEnvelopeCollection collection = logicApp.GetWorkflowEnvelopes(); + + // invoke the operation + string workflowName = "stateful1"; + bool result = await collection.ExistsAsync(workflowName); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetIfExists_GETAWorkflow() + { + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/LogicApps_GetWorkflow.json + // this example is just showing the usage of "LogicApps_GetWorkflow" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this LogicAppResource created on azure + // for more information of creating LogicAppResource, please refer to the document of LogicAppResource + string subscriptionId = "8efdecc5-919e-44eb-b179-915dca89ebf9"; + string resourceGroupName = "examplerg"; + string containerAppName = "testcontainerApp0"; + string logicAppName = "testcontainerApp0"; + ResourceIdentifier logicAppResourceId = LogicAppResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, containerAppName, logicAppName); + LogicAppResource logicApp = client.GetLogicAppResource(logicAppResourceId); + + // get the collection of this WorkflowEnvelopeResource + WorkflowEnvelopeCollection collection = logicApp.GetWorkflowEnvelopes(); + + // invoke the operation + string workflowName = "stateful1"; + NullableResponse response = await collection.GetIfExistsAsync(workflowName); + WorkflowEnvelopeResource result = response.HasValue ? response.Value : null; + + if (result == null) + { + Console.WriteLine("Succeeded with null as result"); + } + else + { + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + WorkflowEnvelopeData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + } +} diff --git a/sdk/containerapps/Azure.ResourceManager.AppContainers/tests/Generated/Samples/Sample_WorkflowEnvelopeResource.cs b/sdk/containerapps/Azure.ResourceManager.AppContainers/tests/Generated/Samples/Sample_WorkflowEnvelopeResource.cs new file mode 100644 index 000000000000..421b592bace4 --- /dev/null +++ b/sdk/containerapps/Azure.ResourceManager.AppContainers/tests/Generated/Samples/Sample_WorkflowEnvelopeResource.cs @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using NUnit.Framework; + +namespace Azure.ResourceManager.AppContainers.Samples +{ + public partial class Sample_WorkflowEnvelopeResource + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_GETAWorkflow() + { + // Generated from example definition: specification/app/resource-manager/Microsoft.App/preview/2025-02-02-preview/examples/LogicApps_GetWorkflow.json + // this example is just showing the usage of "LogicApps_GetWorkflow" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this WorkflowEnvelopeResource created on azure + // for more information of creating WorkflowEnvelopeResource, please refer to the document of WorkflowEnvelopeResource + string subscriptionId = "8efdecc5-919e-44eb-b179-915dca89ebf9"; + string resourceGroupName = "examplerg"; + string containerAppName = "testcontainerApp0"; + string logicAppName = "testcontainerApp0"; + string workflowName = "stateful1"; + ResourceIdentifier workflowEnvelopeResourceId = WorkflowEnvelopeResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, containerAppName, logicAppName, workflowName); + WorkflowEnvelopeResource workflowEnvelope = client.GetWorkflowEnvelopeResource(workflowEnvelopeResourceId); + + // invoke the operation + WorkflowEnvelopeResource result = await workflowEnvelope.GetAsync(); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + WorkflowEnvelopeData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } +}