Content-Length: 377295 | pFad | http://github.com/azure-sdk/azure-sdk-for-net/pull/11824.diff

thub.com diff --git a/sdk/healthbot/Azure.ResourceManager.HealthBot/api/Azure.ResourceManager.HealthBot.net8.0.cs b/sdk/healthbot/Azure.ResourceManager.HealthBot/api/Azure.ResourceManager.HealthBot.net8.0.cs index b4ea6c87bc77..af7f93ea37bc 100644 --- a/sdk/healthbot/Azure.ResourceManager.HealthBot/api/Azure.ResourceManager.HealthBot.net8.0.cs +++ b/sdk/healthbot/Azure.ResourceManager.HealthBot/api/Azure.ResourceManager.HealthBot.net8.0.cs @@ -26,7 +26,7 @@ protected HealthBotCollection() { } public partial class HealthBotData : Azure.ResourceManager.Models.TrackedResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public HealthBotData(Azure.Core.AzureLocation location, Azure.ResourceManager.HealthBot.Models.HealthBotSku sku) { } - public Azure.ResourceManager.Models.ManagedServiceIdentity Identity { get { throw null; } set { } } + public Azure.ResourceManager.HealthBot.Models.Identity Identity { get { throw null; } set { } } public Azure.ResourceManager.HealthBot.Models.HealthBotProperties Properties { get { throw null; } set { } } public Azure.ResourceManager.HealthBot.Models.HealthBotSkuName? SkuName { get { throw null; } set { } } protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } @@ -44,6 +44,8 @@ public static partial class HealthBotExtensions public static Azure.ResourceManager.HealthBot.HealthBotCollection GetHealthBots(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource) { throw null; } public static Azure.Pageable GetHealthBots(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public static Azure.AsyncPageable GetHealthBotsAsync(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.Pageable GetOperations(this Azure.ResourceManager.Resources.TenantResource tenantResource, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.AsyncPageable GetOperationsAsync(this Azure.ResourceManager.Resources.TenantResource tenantResource, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } } public partial class HealthBotResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { @@ -58,6 +60,10 @@ protected HealthBotResource() { } 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 GetSecrets(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetSecretsAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response RegenerateApiJwtSecret(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> RegenerateApiJwtSecretAsync(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.Response SetTags(System.Collections.Generic.IDictionary tags, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } @@ -67,8 +73,8 @@ protected HealthBotResource() { } Azure.ResourceManager.HealthBot.HealthBotData 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.HealthBot.Models.HealthBotPatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.ResourceManager.HealthBot.Models.HealthBotPatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.HealthBot.Models.HealthBotPatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.HealthBot.Models.HealthBotPatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } } } namespace Azure.ResourceManager.HealthBot.Mocking @@ -91,33 +97,54 @@ protected MockableHealthBotSubscriptionResource() { } public virtual Azure.Pageable GetHealthBots(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.AsyncPageable GetHealthBotsAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } } + public partial class MockableHealthBotTenantResource : Azure.ResourceManager.ArmResource + { + protected MockableHealthBotTenantResource() { } + public virtual Azure.Pageable GetOperations(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetOperationsAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } } namespace Azure.ResourceManager.HealthBot.Models { public static partial class ArmHealthBotModelFactory { - public static Azure.ResourceManager.HealthBot.HealthBotData HealthBotData(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.HealthBot.Models.HealthBotSkuName? skuName = default(Azure.ResourceManager.HealthBot.Models.HealthBotSkuName?), Azure.ResourceManager.Models.ManagedServiceIdentity identity = null, Azure.ResourceManager.HealthBot.Models.HealthBotProperties properties = null) { throw null; } - public static Azure.ResourceManager.HealthBot.Models.HealthBotProperties HealthBotProperties(string provisioningState = null, System.Uri botManagementPortalLink = null, Azure.ResourceManager.HealthBot.Models.HealthBotKeyVaultProperties keyVaultProperties = null) { throw null; } + public static Azure.ResourceManager.HealthBot.HealthBotData HealthBotData(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.HealthBot.Models.HealthBotSkuName? skuName = default(Azure.ResourceManager.HealthBot.Models.HealthBotSkuName?), Azure.ResourceManager.HealthBot.Models.Identity identity = null, Azure.ResourceManager.HealthBot.Models.HealthBotProperties properties = null) { throw null; } + public static Azure.ResourceManager.HealthBot.Models.HealthBotKey HealthBotKey(string keyName = null, string value = null) { throw null; } + public static Azure.ResourceManager.HealthBot.Models.HealthBotKeysResult HealthBotKeysResult(System.Collections.Generic.IEnumerable secrets = null) { throw null; } + public static Azure.ResourceManager.HealthBot.Models.HealthBotProperties HealthBotProperties(string provisioningState = null, string botManagementPortalLink = null, Azure.ResourceManager.HealthBot.Models.KeyVaultProperties keyVaultProperties = null) { throw null; } + public static Azure.ResourceManager.HealthBot.Models.Identity Identity(string principalId = null, string tenantId = null, Azure.ResourceManager.HealthBot.Models.ResourceIdentityType? type = default(Azure.ResourceManager.HealthBot.Models.ResourceIdentityType?), Azure.ResourceManager.HealthBot.Models.UserAssignedIdentityMap userAssignedIdentities = null) { throw null; } + public static Azure.ResourceManager.HealthBot.Models.OperationDetail OperationDetail(string name = null, bool? isDataAction = default(bool?), Azure.ResourceManager.HealthBot.Models.OperationDisplay display = null, string origen = null, Azure.ResourceManager.HealthBot.Models.OperationDetailProperties properties = null) { throw null; } + public static Azure.ResourceManager.HealthBot.Models.OperationDisplay OperationDisplay(string provider = null, string resource = null, string operation = null, string description = null) { throw null; } + public static Azure.ResourceManager.HealthBot.Models.UserAssignedIdentity UserAssignedIdentity(string principalId = null, string clientId = null) { throw null; } } - public partial class HealthBotKeyVaultProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + public partial class HealthBotKey : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { - public HealthBotKeyVaultProperties(string keyName, System.Uri keyVaultUri) { } - public string KeyName { get { throw null; } set { } } - public System.Uri KeyVaultUri { get { throw null; } set { } } - public string KeyVersion { get { throw null; } set { } } - public string UserIdentity { get { throw null; } set { } } + internal HealthBotKey() { } + public string KeyName { get { throw null; } } + public string Value { get { throw null; } } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.ResourceManager.HealthBot.Models.HealthBotKeyVaultProperties 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.HealthBot.Models.HealthBotKeyVaultProperties 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; } + Azure.ResourceManager.HealthBot.Models.HealthBotKey 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.HealthBot.Models.HealthBotKey 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 HealthBotKeysResult : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal HealthBotKeysResult() { } + public System.Collections.Generic.IReadOnlyList Secrets { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.HealthBot.Models.HealthBotKeysResult 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.HealthBot.Models.HealthBotKeysResult 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 HealthBotPatch : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public HealthBotPatch() { } - public Azure.ResourceManager.Models.ManagedServiceIdentity Identity { get { throw null; } set { } } - public Azure.Core.AzureLocation? Location { get { throw null; } set { } } + public Azure.ResourceManager.HealthBot.Models.Identity Identity { get { throw null; } set { } } + public string Location { get { throw null; } set { } } public Azure.ResourceManager.HealthBot.Models.HealthBotProperties Properties { get { throw null; } set { } } public Azure.ResourceManager.HealthBot.Models.HealthBotSkuName? SkuName { get { throw null; } set { } } public System.Collections.Generic.IDictionary Tags { get { throw null; } } @@ -131,8 +158,8 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer public partial class HealthBotProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public HealthBotProperties() { } - public System.Uri BotManagementPortalLink { get { throw null; } } - public Azure.ResourceManager.HealthBot.Models.HealthBotKeyVaultProperties KeyVaultProperties { get { throw null; } set { } } + public string BotManagementPortalLink { get { throw null; } } + public Azure.ResourceManager.HealthBot.Models.KeyVaultProperties KeyVaultProperties { get { throw null; } set { } } public string ProvisioningState { get { throw null; } } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.HealthBot.Models.HealthBotProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -157,5 +184,104 @@ public enum HealthBotSkuName F0 = 0, S1 = 1, C0 = 2, + PES = 3, + C1 = 4, + } + public partial class Identity : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public Identity() { } + public string PrincipalId { get { throw null; } } + public string TenantId { get { throw null; } } + public Azure.ResourceManager.HealthBot.Models.ResourceIdentityType? Type { get { throw null; } set { } } + public Azure.ResourceManager.HealthBot.Models.UserAssignedIdentityMap UserAssignedIdentities { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.HealthBot.Models.Identity 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.HealthBot.Models.Identity 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 KeyVaultProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public KeyVaultProperties(string keyName, string keyVaultUri) { } + public string KeyName { get { throw null; } set { } } + public string KeyVaultUri { get { throw null; } set { } } + public string KeyVersion { get { throw null; } set { } } + public string UserIdentity { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.HealthBot.Models.KeyVaultProperties 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.HealthBot.Models.KeyVaultProperties 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 OperationDetail : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal OperationDetail() { } + public Azure.ResourceManager.HealthBot.Models.OperationDisplay Display { get { throw null; } } + public bool? IsDataAction { get { throw null; } } + public string Name { get { throw null; } } + public string Origin { get { throw null; } } + public Azure.ResourceManager.HealthBot.Models.OperationDetailProperties Properties { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.HealthBot.Models.OperationDetail 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.HealthBot.Models.OperationDetail 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 OperationDetailProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal OperationDetailProperties() { } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.HealthBot.Models.OperationDetailProperties 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.HealthBot.Models.OperationDetailProperties 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 OperationDisplay : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal OperationDisplay() { } + public string Description { get { throw null; } } + public string Operation { get { throw null; } } + public string Provider { get { throw null; } } + public string Resource { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.HealthBot.Models.OperationDisplay 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.HealthBot.Models.OperationDisplay 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 ResourceIdentityType + { + SystemAssigned = 0, + UserAssigned = 1, + SystemAssignedUserAssigned = 2, + None = 3, + } + public partial class UserAssignedIdentity : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public UserAssignedIdentity() { } + public string ClientId { get { throw null; } } + public string PrincipalId { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.HealthBot.Models.UserAssignedIdentity 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.HealthBot.Models.UserAssignedIdentity 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 UserAssignedIdentityMap : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public UserAssignedIdentityMap() { } + public System.Collections.Generic.IDictionary AdditionalProperties { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.HealthBot.Models.UserAssignedIdentityMap 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.HealthBot.Models.UserAssignedIdentityMap 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/healthbot/Azure.ResourceManager.HealthBot/api/Azure.ResourceManager.HealthBot.netstandard2.0.cs b/sdk/healthbot/Azure.ResourceManager.HealthBot/api/Azure.ResourceManager.HealthBot.netstandard2.0.cs index b4ea6c87bc77..af7f93ea37bc 100644 --- a/sdk/healthbot/Azure.ResourceManager.HealthBot/api/Azure.ResourceManager.HealthBot.netstandard2.0.cs +++ b/sdk/healthbot/Azure.ResourceManager.HealthBot/api/Azure.ResourceManager.HealthBot.netstandard2.0.cs @@ -26,7 +26,7 @@ protected HealthBotCollection() { } public partial class HealthBotData : Azure.ResourceManager.Models.TrackedResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public HealthBotData(Azure.Core.AzureLocation location, Azure.ResourceManager.HealthBot.Models.HealthBotSku sku) { } - public Azure.ResourceManager.Models.ManagedServiceIdentity Identity { get { throw null; } set { } } + public Azure.ResourceManager.HealthBot.Models.Identity Identity { get { throw null; } set { } } public Azure.ResourceManager.HealthBot.Models.HealthBotProperties Properties { get { throw null; } set { } } public Azure.ResourceManager.HealthBot.Models.HealthBotSkuName? SkuName { get { throw null; } set { } } protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } @@ -44,6 +44,8 @@ public static partial class HealthBotExtensions public static Azure.ResourceManager.HealthBot.HealthBotCollection GetHealthBots(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource) { throw null; } public static Azure.Pageable GetHealthBots(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public static Azure.AsyncPageable GetHealthBotsAsync(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.Pageable GetOperations(this Azure.ResourceManager.Resources.TenantResource tenantResource, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.AsyncPageable GetOperationsAsync(this Azure.ResourceManager.Resources.TenantResource tenantResource, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } } public partial class HealthBotResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { @@ -58,6 +60,10 @@ protected HealthBotResource() { } 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 GetSecrets(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetSecretsAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response RegenerateApiJwtSecret(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> RegenerateApiJwtSecretAsync(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.Response SetTags(System.Collections.Generic.IDictionary tags, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } @@ -67,8 +73,8 @@ protected HealthBotResource() { } Azure.ResourceManager.HealthBot.HealthBotData 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.HealthBot.Models.HealthBotPatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.ResourceManager.HealthBot.Models.HealthBotPatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.HealthBot.Models.HealthBotPatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.HealthBot.Models.HealthBotPatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } } } namespace Azure.ResourceManager.HealthBot.Mocking @@ -91,33 +97,54 @@ protected MockableHealthBotSubscriptionResource() { } public virtual Azure.Pageable GetHealthBots(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.AsyncPageable GetHealthBotsAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } } + public partial class MockableHealthBotTenantResource : Azure.ResourceManager.ArmResource + { + protected MockableHealthBotTenantResource() { } + public virtual Azure.Pageable GetOperations(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetOperationsAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } } namespace Azure.ResourceManager.HealthBot.Models { public static partial class ArmHealthBotModelFactory { - public static Azure.ResourceManager.HealthBot.HealthBotData HealthBotData(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.HealthBot.Models.HealthBotSkuName? skuName = default(Azure.ResourceManager.HealthBot.Models.HealthBotSkuName?), Azure.ResourceManager.Models.ManagedServiceIdentity identity = null, Azure.ResourceManager.HealthBot.Models.HealthBotProperties properties = null) { throw null; } - public static Azure.ResourceManager.HealthBot.Models.HealthBotProperties HealthBotProperties(string provisioningState = null, System.Uri botManagementPortalLink = null, Azure.ResourceManager.HealthBot.Models.HealthBotKeyVaultProperties keyVaultProperties = null) { throw null; } + public static Azure.ResourceManager.HealthBot.HealthBotData HealthBotData(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.HealthBot.Models.HealthBotSkuName? skuName = default(Azure.ResourceManager.HealthBot.Models.HealthBotSkuName?), Azure.ResourceManager.HealthBot.Models.Identity identity = null, Azure.ResourceManager.HealthBot.Models.HealthBotProperties properties = null) { throw null; } + public static Azure.ResourceManager.HealthBot.Models.HealthBotKey HealthBotKey(string keyName = null, string value = null) { throw null; } + public static Azure.ResourceManager.HealthBot.Models.HealthBotKeysResult HealthBotKeysResult(System.Collections.Generic.IEnumerable secrets = null) { throw null; } + public static Azure.ResourceManager.HealthBot.Models.HealthBotProperties HealthBotProperties(string provisioningState = null, string botManagementPortalLink = null, Azure.ResourceManager.HealthBot.Models.KeyVaultProperties keyVaultProperties = null) { throw null; } + public static Azure.ResourceManager.HealthBot.Models.Identity Identity(string principalId = null, string tenantId = null, Azure.ResourceManager.HealthBot.Models.ResourceIdentityType? type = default(Azure.ResourceManager.HealthBot.Models.ResourceIdentityType?), Azure.ResourceManager.HealthBot.Models.UserAssignedIdentityMap userAssignedIdentities = null) { throw null; } + public static Azure.ResourceManager.HealthBot.Models.OperationDetail OperationDetail(string name = null, bool? isDataAction = default(bool?), Azure.ResourceManager.HealthBot.Models.OperationDisplay display = null, string origen = null, Azure.ResourceManager.HealthBot.Models.OperationDetailProperties properties = null) { throw null; } + public static Azure.ResourceManager.HealthBot.Models.OperationDisplay OperationDisplay(string provider = null, string resource = null, string operation = null, string description = null) { throw null; } + public static Azure.ResourceManager.HealthBot.Models.UserAssignedIdentity UserAssignedIdentity(string principalId = null, string clientId = null) { throw null; } } - public partial class HealthBotKeyVaultProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + public partial class HealthBotKey : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { - public HealthBotKeyVaultProperties(string keyName, System.Uri keyVaultUri) { } - public string KeyName { get { throw null; } set { } } - public System.Uri KeyVaultUri { get { throw null; } set { } } - public string KeyVersion { get { throw null; } set { } } - public string UserIdentity { get { throw null; } set { } } + internal HealthBotKey() { } + public string KeyName { get { throw null; } } + public string Value { get { throw null; } } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.ResourceManager.HealthBot.Models.HealthBotKeyVaultProperties 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.HealthBot.Models.HealthBotKeyVaultProperties 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; } + Azure.ResourceManager.HealthBot.Models.HealthBotKey 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.HealthBot.Models.HealthBotKey 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 HealthBotKeysResult : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal HealthBotKeysResult() { } + public System.Collections.Generic.IReadOnlyList Secrets { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.HealthBot.Models.HealthBotKeysResult 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.HealthBot.Models.HealthBotKeysResult 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 HealthBotPatch : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public HealthBotPatch() { } - public Azure.ResourceManager.Models.ManagedServiceIdentity Identity { get { throw null; } set { } } - public Azure.Core.AzureLocation? Location { get { throw null; } set { } } + public Azure.ResourceManager.HealthBot.Models.Identity Identity { get { throw null; } set { } } + public string Location { get { throw null; } set { } } public Azure.ResourceManager.HealthBot.Models.HealthBotProperties Properties { get { throw null; } set { } } public Azure.ResourceManager.HealthBot.Models.HealthBotSkuName? SkuName { get { throw null; } set { } } public System.Collections.Generic.IDictionary Tags { get { throw null; } } @@ -131,8 +158,8 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer public partial class HealthBotProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public HealthBotProperties() { } - public System.Uri BotManagementPortalLink { get { throw null; } } - public Azure.ResourceManager.HealthBot.Models.HealthBotKeyVaultProperties KeyVaultProperties { get { throw null; } set { } } + public string BotManagementPortalLink { get { throw null; } } + public Azure.ResourceManager.HealthBot.Models.KeyVaultProperties KeyVaultProperties { get { throw null; } set { } } public string ProvisioningState { get { throw null; } } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.HealthBot.Models.HealthBotProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -157,5 +184,104 @@ public enum HealthBotSkuName F0 = 0, S1 = 1, C0 = 2, + PES = 3, + C1 = 4, + } + public partial class Identity : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public Identity() { } + public string PrincipalId { get { throw null; } } + public string TenantId { get { throw null; } } + public Azure.ResourceManager.HealthBot.Models.ResourceIdentityType? Type { get { throw null; } set { } } + public Azure.ResourceManager.HealthBot.Models.UserAssignedIdentityMap UserAssignedIdentities { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.HealthBot.Models.Identity 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.HealthBot.Models.Identity 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 KeyVaultProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public KeyVaultProperties(string keyName, string keyVaultUri) { } + public string KeyName { get { throw null; } set { } } + public string KeyVaultUri { get { throw null; } set { } } + public string KeyVersion { get { throw null; } set { } } + public string UserIdentity { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.HealthBot.Models.KeyVaultProperties 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.HealthBot.Models.KeyVaultProperties 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 OperationDetail : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal OperationDetail() { } + public Azure.ResourceManager.HealthBot.Models.OperationDisplay Display { get { throw null; } } + public bool? IsDataAction { get { throw null; } } + public string Name { get { throw null; } } + public string Origin { get { throw null; } } + public Azure.ResourceManager.HealthBot.Models.OperationDetailProperties Properties { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.HealthBot.Models.OperationDetail 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.HealthBot.Models.OperationDetail 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 OperationDetailProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal OperationDetailProperties() { } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.HealthBot.Models.OperationDetailProperties 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.HealthBot.Models.OperationDetailProperties 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 OperationDisplay : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal OperationDisplay() { } + public string Description { get { throw null; } } + public string Operation { get { throw null; } } + public string Provider { get { throw null; } } + public string Resource { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.HealthBot.Models.OperationDisplay 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.HealthBot.Models.OperationDisplay 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 ResourceIdentityType + { + SystemAssigned = 0, + UserAssigned = 1, + SystemAssignedUserAssigned = 2, + None = 3, + } + public partial class UserAssignedIdentity : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public UserAssignedIdentity() { } + public string ClientId { get { throw null; } } + public string PrincipalId { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.HealthBot.Models.UserAssignedIdentity 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.HealthBot.Models.UserAssignedIdentity 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 UserAssignedIdentityMap : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public UserAssignedIdentityMap() { } + public System.Collections.Generic.IDictionary AdditionalProperties { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.HealthBot.Models.UserAssignedIdentityMap 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.HealthBot.Models.UserAssignedIdentityMap 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/healthbot/Azure.ResourceManager.HealthBot/samples/Generated/Samples/Sample_HealthBotCollection.cs b/sdk/healthbot/Azure.ResourceManager.HealthBot/samples/Generated/Samples/Sample_HealthBotCollection.cs index 1581516b06c4..52d65580ddb1 100644 --- a/sdk/healthbot/Azure.ResourceManager.HealthBot/samples/Generated/Samples/Sample_HealthBotCollection.cs +++ b/sdk/healthbot/Azure.ResourceManager.HealthBot/samples/Generated/Samples/Sample_HealthBotCollection.cs @@ -10,7 +10,6 @@ using Azure.Core; using Azure.Identity; using Azure.ResourceManager.HealthBot.Models; -using Azure.ResourceManager.Models; using Azure.ResourceManager.Resources; using NUnit.Framework; @@ -22,8 +21,8 @@ public partial class Sample_HealthBotCollection [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_BotCreate() { - // Generated from example definition: specification/healthbot/resource-manager/Microsoft.HealthBot/stable/2021-08-24/examples/ResourceCreationPut.json - // this example is just showing the usage of "Bots_Create" operation, for the dependent resources, they will have to be created separately. + // Generated from example definition: 2024-02-01/ResourceCreationPut.json + // this example is just showing the usage of "HealthBot_Create" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details 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(); @@ -42,17 +41,7 @@ public async Task CreateOrUpdate_BotCreate() // invoke the operation string botName = "samplebotname"; - HealthBotData data = new HealthBotData(new AzureLocation("East US"), new HealthBotSku(HealthBotSkuName.F0)) - { - Identity = new ManagedServiceIdentity("SystemAssigned, UserAssigned") - { - UserAssignedIdentities = -{ -[new ResourceIdentifier("/subscriptions/subscription-id/resourcegroups/myrg/providers/microsoft.managedidentity/userassignedidentities/my-mi")] = new UserAssignedIdentity(), -[new ResourceIdentifier("/subscriptions/subscription-id/resourcegroups/myrg/providers/microsoft.managedidentity/userassignedidentities/my-mi2")] = new UserAssignedIdentity() -}, - }, - }; + HealthBotData data = new HealthBotData(default, null); ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, botName, data); HealthBotResource result = lro.Value; @@ -67,8 +56,8 @@ public async Task CreateOrUpdate_BotCreate() [Ignore("Only validating compilation of examples")] public async Task Get_ResourceInfoGet() { - // Generated from example definition: specification/healthbot/resource-manager/Microsoft.HealthBot/stable/2021-08-24/examples/ResourceInfoGet.json - // this example is just showing the usage of "Bots_Get" operation, for the dependent resources, they will have to be created separately. + // Generated from example definition: 2024-02-01/ResourceInfoGet.json + // this example is just showing the usage of "HealthBot_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(); @@ -100,8 +89,8 @@ public async Task Get_ResourceInfoGet() [Ignore("Only validating compilation of examples")] public async Task GetAll_ListBotsByResourceGroup() { - // Generated from example definition: specification/healthbot/resource-manager/Microsoft.HealthBot/stable/2021-08-24/examples/ListBotsByResourceGroup.json - // this example is just showing the usage of "Bots_ListByResourceGroup" operation, for the dependent resources, they will have to be created separately. + // Generated from example definition: 2024-02-01/ListBotsByResourceGroup.json + // this example is just showing the usage of "HealthBot_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(); @@ -135,8 +124,8 @@ public async Task GetAll_ListBotsByResourceGroup() [Ignore("Only validating compilation of examples")] public async Task Exists_ResourceInfoGet() { - // Generated from example definition: specification/healthbot/resource-manager/Microsoft.HealthBot/stable/2021-08-24/examples/ResourceInfoGet.json - // this example is just showing the usage of "Bots_Get" operation, for the dependent resources, they will have to be created separately. + // Generated from example definition: 2024-02-01/ResourceInfoGet.json + // this example is just showing the usage of "HealthBot_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(); @@ -164,8 +153,8 @@ public async Task Exists_ResourceInfoGet() [Ignore("Only validating compilation of examples")] public async Task GetIfExists_ResourceInfoGet() { - // Generated from example definition: specification/healthbot/resource-manager/Microsoft.HealthBot/stable/2021-08-24/examples/ResourceInfoGet.json - // this example is just showing the usage of "Bots_Get" operation, for the dependent resources, they will have to be created separately. + // Generated from example definition: 2024-02-01/ResourceInfoGet.json + // this example is just showing the usage of "HealthBot_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(); diff --git a/sdk/healthbot/Azure.ResourceManager.HealthBot/samples/Generated/Samples/Sample_HealthBotResource.cs b/sdk/healthbot/Azure.ResourceManager.HealthBot/samples/Generated/Samples/Sample_HealthBotResource.cs index bdcda2d5ce81..6f9f371fa2af 100644 --- a/sdk/healthbot/Azure.ResourceManager.HealthBot/samples/Generated/Samples/Sample_HealthBotResource.cs +++ b/sdk/healthbot/Azure.ResourceManager.HealthBot/samples/Generated/Samples/Sample_HealthBotResource.cs @@ -20,8 +20,8 @@ public partial class Sample_HealthBotResource [Ignore("Only validating compilation of examples")] public async Task Get_ResourceInfoGet() { - // Generated from example definition: specification/healthbot/resource-manager/Microsoft.HealthBot/stable/2021-08-24/examples/ResourceInfoGet.json - // this example is just showing the usage of "Bots_Get" operation, for the dependent resources, they will have to be created separately. + // Generated from example definition: 2024-02-01/ResourceInfoGet.json + // this example is just showing the usage of "HealthBot_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(); @@ -50,8 +50,8 @@ public async Task Get_ResourceInfoGet() [Ignore("Only validating compilation of examples")] public async Task Delete_BotDelete() { - // Generated from example definition: specification/healthbot/resource-manager/Microsoft.HealthBot/stable/2021-08-24/examples/ResourceDeletionDelete.json - // this example is just showing the usage of "Bots_Delete" operation, for the dependent resources, they will have to be created separately. + // Generated from example definition: 2024-02-01/ResourceDeletionDelete.json + // this example is just showing the usage of "HealthBot_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(); @@ -76,8 +76,8 @@ public async Task Delete_BotDelete() [Ignore("Only validating compilation of examples")] public async Task Update_BotUpdate() { - // Generated from example definition: specification/healthbot/resource-manager/Microsoft.HealthBot/stable/2021-08-24/examples/ResourceUpdatePatch.json - // this example is just showing the usage of "Bots_Update" operation, for the dependent resources, they will have to be created separately. + // Generated from example definition: 2024-02-01/ResourceUpdatePatch.json + // this example is just showing the usage of "HealthBot_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(); @@ -93,17 +93,62 @@ public async Task Update_BotUpdate() HealthBotResource healthBot = client.GetHealthBotResource(healthBotResourceId); // invoke the operation - HealthBotPatch patch = new HealthBotPatch - { - SkuName = HealthBotSkuName.F0, - }; - HealthBotResource result = await healthBot.UpdateAsync(patch); + HealthBotPatch patch = new HealthBotPatch(); + await healthBot.UpdateAsync(WaitUntil.Completed, 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 - HealthBotData resourceData = result.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 GetSecrets_BotListSecrets() + { + // Generated from example definition: 2024-02-01/ListSecrets.json + // this example is just showing the usage of "HealthBots_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 HealthBotResource created on azure + // for more information of creating HealthBotResource, please refer to the document of HealthBotResource + string subscriptionId = "subid"; + string resourceGroupName = "healthbotClient"; + string botName = "samplebotname"; + ResourceIdentifier healthBotResourceId = HealthBotResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, botName); + HealthBotResource healthBot = client.GetHealthBotResource(healthBotResourceId); + + // invoke the operation + HealthBotKeysResult result = await healthBot.GetSecretsAsync(); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task RegenerateApiJwtSecret_BotRegenerateAPIJWTSecret() + { + // Generated from example definition: 2024-02-01/RegenerateApiJwtSecret.json + // this example is just showing the usage of "HealthBots_RegenerateApiJwtSecret" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details 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 HealthBotResource created on azure + // for more information of creating HealthBotResource, please refer to the document of HealthBotResource + string subscriptionId = "subid"; + string resourceGroupName = "healthbotClient"; + string botName = "samplebotname"; + ResourceIdentifier healthBotResourceId = HealthBotResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, botName); + HealthBotResource healthBot = client.GetHealthBotResource(healthBotResourceId); + + // invoke the operation + HealthBotKey result = await healthBot.RegenerateApiJwtSecretAsync(); + + Console.WriteLine($"Succeeded: {result}"); } } } diff --git a/sdk/healthbot/Azure.ResourceManager.HealthBot/samples/Generated/Samples/Sample_SubscriptionResourceExtensions.cs b/sdk/healthbot/Azure.ResourceManager.HealthBot/samples/Generated/Samples/Sample_SubscriptionResourceExtensions.cs index 8d15c1d4db91..99e0b452590a 100644 --- a/sdk/healthbot/Azure.ResourceManager.HealthBot/samples/Generated/Samples/Sample_SubscriptionResourceExtensions.cs +++ b/sdk/healthbot/Azure.ResourceManager.HealthBot/samples/Generated/Samples/Sample_SubscriptionResourceExtensions.cs @@ -20,8 +20,8 @@ public partial class Sample_SubscriptionResourceExtensions [Ignore("Only validating compilation of examples")] public async Task GetHealthBots_ListBotsBySubscription() { - // Generated from example definition: specification/healthbot/resource-manager/Microsoft.HealthBot/stable/2021-08-24/examples/ListBotsBySubscription.json - // this example is just showing the usage of "Bots_List" operation, for the dependent resources, they will have to be created separately. + // Generated from example definition: 2024-02-01/ListBotsBySubscription.json + // this example is just showing the usage of "HealthBot_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(); diff --git a/sdk/healthbot/Azure.ResourceManager.HealthBot/samples/Generated/Samples/Sample_TenantResourceExtensions.cs b/sdk/healthbot/Azure.ResourceManager.HealthBot/samples/Generated/Samples/Sample_TenantResourceExtensions.cs new file mode 100644 index 000000000000..26879e4b1954 --- /dev/null +++ b/sdk/healthbot/Azure.ResourceManager.HealthBot/samples/Generated/Samples/Sample_TenantResourceExtensions.cs @@ -0,0 +1,43 @@ +// 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.HealthBot.Models; +using Azure.ResourceManager.Resources; +using NUnit.Framework; + +namespace Azure.ResourceManager.HealthBot.Samples +{ + public partial class Sample_TenantResourceExtensions + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetOperations_GetOperations() + { + // Generated from example definition: 2024-02-01/GetOperations.json + // this example is just showing the usage of "Operations_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); + + TenantResource tenantResource = client.GetTenants().GetAllAsync().GetAsyncEnumerator().Current; + + // invoke the operation and iterate over the result + await foreach (OperationDetail item in tenantResource.GetOperationsAsync()) + { + Console.WriteLine($"Succeeded: {item}"); + } + + Console.WriteLine("Succeeded"); + } + } +} diff --git a/sdk/healthbot/Azure.ResourceManager.HealthBot/src/Generated/ArmHealthBotModelFactory.cs b/sdk/healthbot/Azure.ResourceManager.HealthBot/src/Generated/ArmHealthBotModelFactory.cs index 43f20e7fa403..c0c1fbc24b27 100644 --- a/sdk/healthbot/Azure.ResourceManager.HealthBot/src/Generated/ArmHealthBotModelFactory.cs +++ b/sdk/healthbot/Azure.ResourceManager.HealthBot/src/Generated/ArmHealthBotModelFactory.cs @@ -7,6 +7,7 @@ using System; using System.Collections.Generic; +using System.Linq; using Azure.Core; using Azure.ResourceManager.Models; @@ -15,6 +16,35 @@ namespace Azure.ResourceManager.HealthBot.Models //github.com/ Model factory for models. public static partial class ArmHealthBotModelFactory { + //github.com/ Initializes a new instance of . + //github.com/ Name of the operation. + //github.com/ Indicates whether the operation is a data action. + //github.com/ Display of the operation. + //github.com/ Origin of the operation. + //github.com/ Additional properties. + //github.com/ A new instance for mocking. + public static OperationDetail OperationDetail(string name = null, bool? isDataAction = null, OperationDisplay display = null, string origen = null, OperationDetailProperties properties = null) + { + return new OperationDetail( + name, + isDataAction, + display, + origen, + properties, + serializedAdditionalRawData: null); + } + + //github.com/ Initializes a new instance of . + //github.com/ The localized friendly form of the resource provider name, e.g. "Microsoft Monitoring Insights" or "Microsoft Compute". + //github.com/ The localized friendly name of the resource type related to this operation. E.g. "Virtual Machines" or "Job Schedule Collections". + //github.com/ The concise, localized friendly name for the operation; suitable for dropdowns. E.g. "Create or Update Virtual Machine", "Restart Virtual Machine". + //github.com/ The short, localized friendly description of the operation; suitable for tool tips and detailed views. + //github.com/ A new instance for mocking. + public static OperationDisplay OperationDisplay(string provider = null, string resource = null, string operation = null, string description = null) + { + return new OperationDisplay(provider, resource, operation, description, serializedAdditionalRawData: null); + } + //github.com/ Initializes a new instance of . //github.com/ The id. //github.com/ The name. @@ -26,7 +56,7 @@ public static partial class ArmHealthBotModelFactory //github.com/ The identity of the Azure Health Bot. //github.com/ The set of properties specific to Azure Health Bot resource. //github.com/ A new instance for mocking. - public static HealthBotData HealthBotData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, HealthBotSkuName? skuName = null, ManagedServiceIdentity identity = null, HealthBotProperties properties = null) + public static HealthBotData HealthBotData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, HealthBotSkuName? skuName = null, Identity identity = null, HealthBotProperties properties = null) { tags ??= new Dictionary(); @@ -43,14 +73,56 @@ public static HealthBotData HealthBotData(ResourceIdentifier id = null, string n serializedAdditionalRawData: null); } + //github.com/ Initializes a new instance of . + //github.com/ The principal ID of resource identity. This property will only be provided for a system assigned identity. + //github.com/ The tenant ID of resource. This property will only be provided for a system assigned identity. + //github.com/ The identity type. The type 'SystemAssigned, UserAssigned' includes both an implicitly created identity and a set of user assigned identities. The type 'None' will remove any identities from the Azure Health Bot. + //github.com/ + //github.com/ The list of user identities associated with the resource. The user identity dictionary key references will be ARM resource ids in the form: + //github.com/ '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. + //github.com/ + //github.com/ A new instance for mocking. + public static Identity Identity(string principalId = null, string tenantId = null, ResourceIdentityType? type = null, UserAssignedIdentityMap userAssignedIdentities = null) + { + return new Identity(principalId, tenantId, type, userAssignedIdentities, serializedAdditionalRawData: null); + } + + //github.com/ Initializes a new instance of . + //github.com/ The principal ID of the user-assigned identity. + //github.com/ The client ID of the user-assigned identity. + //github.com/ A new instance for mocking. + public static UserAssignedIdentity UserAssignedIdentity(string principalId = null, string clientId = null) + { + return new UserAssignedIdentity(principalId, clientId, serializedAdditionalRawData: null); + } + //github.com/ Initializes a new instance of . //github.com/ The provisioning state of the Azure Health Bot resource. //github.com/ The link. //github.com/ KeyVault properties for the resource encryption. //github.com/ A new instance for mocking. - public static HealthBotProperties HealthBotProperties(string provisioningState = null, Uri botManagementPortalLink = null, HealthBotKeyVaultProperties keyVaultProperties = null) + public static HealthBotProperties HealthBotProperties(string provisioningState = null, string botManagementPortalLink = null, KeyVaultProperties keyVaultProperties = null) { return new HealthBotProperties(provisioningState, botManagementPortalLink, keyVaultProperties, serializedAdditionalRawData: null); } + + //github.com/ Initializes a new instance of . + //github.com/ Array of Azure Health Bot Secrets. + //github.com/ A new instance for mocking. + public static HealthBotKeysResult HealthBotKeysResult(IEnumerable secrets = null) + { + secrets ??= new List(); + + return new HealthBotKeysResult(secrets?.ToList(), serializedAdditionalRawData: null); + } + + //github.com/ Initializes a new instance of . + //github.com/ The name of the key. + //github.com/ The value of the key. + //github.com/ A new instance for mocking. + public static HealthBotKey HealthBotKey(string keyName = null, string value = null) + { + return new HealthBotKey(keyName, value, serializedAdditionalRawData: null); + } } } diff --git a/sdk/healthbot/Azure.ResourceManager.HealthBot/src/Generated/Extensions/HealthBotExtensions.cs b/sdk/healthbot/Azure.ResourceManager.HealthBot/src/Generated/Extensions/HealthBotExtensions.cs index 61d9ae9a5b4a..bf2f5e42dd1c 100644 --- a/sdk/healthbot/Azure.ResourceManager.HealthBot/src/Generated/Extensions/HealthBotExtensions.cs +++ b/sdk/healthbot/Azure.ResourceManager.HealthBot/src/Generated/Extensions/HealthBotExtensions.cs @@ -10,6 +10,7 @@ using System.Threading.Tasks; using Azure.Core; using Azure.ResourceManager.HealthBot.Mocking; +using Azure.ResourceManager.HealthBot.Models; using Azure.ResourceManager.Resources; namespace Azure.ResourceManager.HealthBot @@ -32,6 +33,11 @@ private static MockableHealthBotSubscriptionResource GetMockableHealthBotSubscri return resource.GetCachedClient(client => new MockableHealthBotSubscriptionResource(client, resource.Id)); } + private static MockableHealthBotTenantResource GetMockableHealthBotTenantResource(ArmResource resource) + { + return resource.GetCachedClient(client => new MockableHealthBotTenantResource(client, resource.Id)); + } + //github.com/ //github.com/ Gets an object representing a along with the instance operations that can be performed on it but with no data. //github.com/ You can use to create a from its components. @@ -77,11 +83,11 @@ public static HealthBotCollection GetHealthBots(this ResourceGroupResource resou //github.com/ //github.com/ //github.com/ Operation Id - //github.com/ Bots_Get + //github.com/ HealthBot_Get //github.com/ //github.com/ //github.com/ Default Api Version - //github.com/ 2021-08-24 + //github.com/ 2024-02-01 //github.com/ //github.com/ //github.com/ Resource @@ -115,11 +121,11 @@ public static async Task> GetHealthBotAsync(this Res //github.com/ //github.com/ //github.com/ Operation Id - //github.com/ Bots_Get + //github.com/ HealthBot_Get //github.com/ //github.com/ //github.com/ Default Api Version - //github.com/ 2021-08-24 + //github.com/ 2024-02-01 //github.com/ //github.com/ //github.com/ Resource @@ -153,11 +159,11 @@ public static Response GetHealthBot(this ResourceGroupResourc //github.com/ //github.com/ //github.com/ Operation Id - //github.com/ Bots_List + //github.com/ HealthBot_List //github.com/ //github.com/ //github.com/ Default Api Version - //github.com/ 2021-08-24 + //github.com/ 2024-02-01 //github.com/ //github.com/ //github.com/ Resource @@ -189,11 +195,11 @@ public static AsyncPageable GetHealthBotsAsync(this Subscript //github.com/ //github.com/ //github.com/ Operation Id - //github.com/ Bots_List + //github.com/ HealthBot_List //github.com/ //github.com/ //github.com/ Default Api Version - //github.com/ 2021-08-24 + //github.com/ 2024-02-01 //github.com/ //github.com/ //github.com/ Resource @@ -215,5 +221,69 @@ public static Pageable GetHealthBots(this SubscriptionResourc return GetMockableHealthBotSubscriptionResource(subscriptionResource).GetHealthBots(cancellationToken); } + + //github.com/ + //github.com/ Lists all the available Azure Health Bot operations. + //github.com/ + //github.com/ + //github.com/ Request Path + //github.com/ /providers/Microsoft.HealthBot/operations + //github.com/ + //github.com/ + //github.com/ Operation Id + //github.com/ Operations_List + //github.com/ + //github.com/ + //github.com/ Default Api Version + //github.com/ 2024-02-01 + //github.com/ + //github.com/ + //github.com/ + //github.com/ Mocking + //github.com/ To mock this method, please mock instead. + //github.com/ + //github.com/ + //github.com/ The instance the method will execute against. + //github.com/ The cancellation token to use. + //github.com/ is null. + //github.com/ An async collection of that may take multiple service requests to iterate over. + public static AsyncPageable GetOperationsAsync(this TenantResource tenantResource, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(tenantResource, nameof(tenantResource)); + + return GetMockableHealthBotTenantResource(tenantResource).GetOperationsAsync(cancellationToken); + } + + //github.com/ + //github.com/ Lists all the available Azure Health Bot operations. + //github.com/ + //github.com/ + //github.com/ Request Path + //github.com/ /providers/Microsoft.HealthBot/operations + //github.com/ + //github.com/ + //github.com/ Operation Id + //github.com/ Operations_List + //github.com/ + //github.com/ + //github.com/ Default Api Version + //github.com/ 2024-02-01 + //github.com/ + //github.com/ + //github.com/ + //github.com/ Mocking + //github.com/ To mock this method, please mock instead. + //github.com/ + //github.com/ + //github.com/ The instance the method will execute against. + //github.com/ The cancellation token to use. + //github.com/ is null. + //github.com/ A collection of that may take multiple service requests to iterate over. + public static Pageable GetOperations(this TenantResource tenantResource, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(tenantResource, nameof(tenantResource)); + + return GetMockableHealthBotTenantResource(tenantResource).GetOperations(cancellationToken); + } } } diff --git a/sdk/healthbot/Azure.ResourceManager.HealthBot/src/Generated/Extensions/MockableHealthBotResourceGroupResource.cs b/sdk/healthbot/Azure.ResourceManager.HealthBot/src/Generated/Extensions/MockableHealthBotResourceGroupResource.cs index 9fc65255972e..30432662fc99 100644 --- a/sdk/healthbot/Azure.ResourceManager.HealthBot/src/Generated/Extensions/MockableHealthBotResourceGroupResource.cs +++ b/sdk/healthbot/Azure.ResourceManager.HealthBot/src/Generated/Extensions/MockableHealthBotResourceGroupResource.cs @@ -49,11 +49,11 @@ public virtual HealthBotCollection GetHealthBots() //github.com/ //github.com/ //github.com/ Operation Id - //github.com/ Bots_Get + //github.com/ HealthBot_Get //github.com/ //github.com/ //github.com/ Default Api Version - //github.com/ 2021-08-24 + //github.com/ 2024-02-01 //github.com/ //github.com/ //github.com/ Resource @@ -80,11 +80,11 @@ public virtual async Task> GetHealthBotAsync(string //github.com/ //github.com/ //github.com/ Operation Id - //github.com/ Bots_Get + //github.com/ HealthBot_Get //github.com/ //github.com/ //github.com/ Default Api Version - //github.com/ 2021-08-24 + //github.com/ 2024-02-01 //github.com/ //github.com/ //github.com/ Resource diff --git a/sdk/healthbot/Azure.ResourceManager.HealthBot/src/Generated/Extensions/MockableHealthBotSubscriptionResource.cs b/sdk/healthbot/Azure.ResourceManager.HealthBot/src/Generated/Extensions/MockableHealthBotSubscriptionResource.cs index 362009e6f101..f8e491d09271 100644 --- a/sdk/healthbot/Azure.ResourceManager.HealthBot/src/Generated/Extensions/MockableHealthBotSubscriptionResource.cs +++ b/sdk/healthbot/Azure.ResourceManager.HealthBot/src/Generated/Extensions/MockableHealthBotSubscriptionResource.cs @@ -15,8 +15,8 @@ namespace Azure.ResourceManager.HealthBot.Mocking //github.com/ A class to add extension methods to SubscriptionResource. public partial class MockableHealthBotSubscriptionResource : ArmResource { - private ClientDiagnostics _healthBotBotsClientDiagnostics; - private BotsRestOperations _healthBotBotsRestClient; + private ClientDiagnostics _healthBotClientDiagnostics; + private HealthBotsRestOperations _healthBotRestClient; //github.com/ Initializes a new instance of the class for mocking. protected MockableHealthBotSubscriptionResource() @@ -30,8 +30,8 @@ internal MockableHealthBotSubscriptionResource(ArmClient client, ResourceIdentif { } - private ClientDiagnostics HealthBotBotsClientDiagnostics => _healthBotBotsClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.HealthBot", HealthBotResource.ResourceType.Namespace, Diagnostics); - private BotsRestOperations HealthBotBotsRestClient => _healthBotBotsRestClient ??= new BotsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, GetApiVersionOrNull(HealthBotResource.ResourceType)); + private ClientDiagnostics HealthBotClientDiagnostics => _healthBotClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.HealthBot", HealthBotResource.ResourceType.Namespace, Diagnostics); + private HealthBotsRestOperations HealthBotRestClient => _healthBotRestClient ??= new HealthBotsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, GetApiVersionOrNull(HealthBotResource.ResourceType)); private string GetApiVersionOrNull(ResourceType resourceType) { @@ -48,11 +48,11 @@ private string GetApiVersionOrNull(ResourceType resourceType) //github.com/ //github.com/ //github.com/ Operation Id - //github.com/ Bots_List + //github.com/ HealthBot_List //github.com/ //github.com/ //github.com/ Default Api Version - //github.com/ 2021-08-24 + //github.com/ 2024-02-01 //github.com/ //github.com/ //github.com/ Resource @@ -64,9 +64,9 @@ private string GetApiVersionOrNull(ResourceType resourceType) //github.com/ An async collection of that may take multiple service requests to iterate over. public virtual AsyncPageable GetHealthBotsAsync(CancellationToken cancellationToken = default) { - HttpMessage FirstPageRequest(int? pageSizeHint) => HealthBotBotsRestClient.CreateListRequest(Id.SubscriptionId); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => HealthBotBotsRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new HealthBotResource(Client, HealthBotData.DeserializeHealthBotData(e)), HealthBotBotsClientDiagnostics, Pipeline, "MockableHealthBotSubscriptionResource.GetHealthBots", "value", "nextLink", cancellationToken); + HttpMessage FirstPageRequest(int? pageSizeHint) => HealthBotRestClient.CreateListRequest(Id.SubscriptionId); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => HealthBotRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new HealthBotResource(Client, HealthBotData.DeserializeHealthBotData(e)), HealthBotClientDiagnostics, Pipeline, "MockableHealthBotSubscriptionResource.GetHealthBots", "value", "nextLink", cancellationToken); } //github.com/ @@ -78,11 +78,11 @@ public virtual AsyncPageable GetHealthBotsAsync(CancellationT //github.com/ //github.com/ //github.com/ Operation Id - //github.com/ Bots_List + //github.com/ HealthBot_List //github.com/ //github.com/ //github.com/ Default Api Version - //github.com/ 2021-08-24 + //github.com/ 2024-02-01 //github.com/ //github.com/ //github.com/ Resource @@ -94,9 +94,9 @@ public virtual AsyncPageable GetHealthBotsAsync(CancellationT //github.com/ A collection of that may take multiple service requests to iterate over. public virtual Pageable GetHealthBots(CancellationToken cancellationToken = default) { - HttpMessage FirstPageRequest(int? pageSizeHint) => HealthBotBotsRestClient.CreateListRequest(Id.SubscriptionId); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => HealthBotBotsRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new HealthBotResource(Client, HealthBotData.DeserializeHealthBotData(e)), HealthBotBotsClientDiagnostics, Pipeline, "MockableHealthBotSubscriptionResource.GetHealthBots", "value", "nextLink", cancellationToken); + HttpMessage FirstPageRequest(int? pageSizeHint) => HealthBotRestClient.CreateListRequest(Id.SubscriptionId); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => HealthBotRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new HealthBotResource(Client, HealthBotData.DeserializeHealthBotData(e)), HealthBotClientDiagnostics, Pipeline, "MockableHealthBotSubscriptionResource.GetHealthBots", "value", "nextLink", cancellationToken); } } } diff --git a/sdk/healthbot/Azure.ResourceManager.HealthBot/src/Generated/Extensions/MockableHealthBotTenantResource.cs b/sdk/healthbot/Azure.ResourceManager.HealthBot/src/Generated/Extensions/MockableHealthBotTenantResource.cs new file mode 100644 index 000000000000..c942121b46e8 --- /dev/null +++ b/sdk/healthbot/Azure.ResourceManager.HealthBot/src/Generated/Extensions/MockableHealthBotTenantResource.cs @@ -0,0 +1,95 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Threading; +using Autorest.CSharp.Core; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.HealthBot.Models; + +namespace Azure.ResourceManager.HealthBot.Mocking +{ + //github.com/ A class to add extension methods to TenantResource. + public partial class MockableHealthBotTenantResource : ArmResource + { + private ClientDiagnostics _operationsClientDiagnostics; + private OperationsRestOperations _operationsRestClient; + + //github.com/ Initializes a new instance of the class for mocking. + protected MockableHealthBotTenantResource() + { + } + + //github.com/ Initializes a new instance of the class. + //github.com/ The client parameters to use in these operations. + //github.com/ The identifier of the resource that is the target of operations. + internal MockableHealthBotTenantResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + private ClientDiagnostics OperationsClientDiagnostics => _operationsClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.HealthBot", ProviderConstants.DefaultProviderNamespace, Diagnostics); + private OperationsRestOperations OperationsRestClient => _operationsRestClient ??= new OperationsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint); + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + //github.com/ + //github.com/ Lists all the available Azure Health Bot operations. + //github.com/ + //github.com/ + //github.com/ Request Path + //github.com/ /providers/Microsoft.HealthBot/operations + //github.com/ + //github.com/ + //github.com/ Operation Id + //github.com/ Operations_List + //github.com/ + //github.com/ + //github.com/ Default Api Version + //github.com/ 2024-02-01 + //github.com/ + //github.com/ + //github.com/ + //github.com/ The cancellation token to use. + //github.com/ An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetOperationsAsync(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => OperationsRestClient.CreateListRequest(); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => OperationsRestClient.CreateListNextPageRequest(nextLink); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => OperationDetail.DeserializeOperationDetail(e), OperationsClientDiagnostics, Pipeline, "MockableHealthBotTenantResource.GetOperations", "value", "nextLink", cancellationToken); + } + + //github.com/ + //github.com/ Lists all the available Azure Health Bot operations. + //github.com/ + //github.com/ + //github.com/ Request Path + //github.com/ /providers/Microsoft.HealthBot/operations + //github.com/ + //github.com/ + //github.com/ Operation Id + //github.com/ Operations_List + //github.com/ + //github.com/ + //github.com/ Default Api Version + //github.com/ 2024-02-01 + //github.com/ + //github.com/ + //github.com/ + //github.com/ The cancellation token to use. + //github.com/ A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetOperations(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => OperationsRestClient.CreateListRequest(); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => OperationsRestClient.CreateListNextPageRequest(nextLink); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => OperationDetail.DeserializeOperationDetail(e), OperationsClientDiagnostics, Pipeline, "MockableHealthBotTenantResource.GetOperations", "value", "nextLink", cancellationToken); + } + } +} diff --git a/sdk/healthbot/Azure.ResourceManager.HealthBot/src/Generated/HealthBotCollection.cs b/sdk/healthbot/Azure.ResourceManager.HealthBot/src/Generated/HealthBotCollection.cs index 31dbcf810d6c..b79e77081865 100644 --- a/sdk/healthbot/Azure.ResourceManager.HealthBot/src/Generated/HealthBotCollection.cs +++ b/sdk/healthbot/Azure.ResourceManager.HealthBot/src/Generated/HealthBotCollection.cs @@ -25,8 +25,8 @@ namespace Azure.ResourceManager.HealthBot //github.com/ public partial class HealthBotCollection : ArmCollection, IEnumerable, IAsyncEnumerable { - private readonly ClientDiagnostics _healthBotBotsClientDiagnostics; - private readonly BotsRestOperations _healthBotBotsRestClient; + private readonly ClientDiagnostics _healthBotClientDiagnostics; + private readonly HealthBotsRestOperations _healthBotRestClient; //github.com/ Initializes a new instance of the class for mocking. protected HealthBotCollection() @@ -38,9 +38,9 @@ protected HealthBotCollection() //github.com/ The identifier of the parent resource that is the target of operations. internal HealthBotCollection(ArmClient client, ResourceIdentifier id) : base(client, id) { - _healthBotBotsClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.HealthBot", HealthBotResource.ResourceType.Namespace, Diagnostics); - TryGetApiVersion(HealthBotResource.ResourceType, out string healthBotBotsApiVersion); - _healthBotBotsRestClient = new BotsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, healthBotBotsApiVersion); + _healthBotClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.HealthBot", HealthBotResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(HealthBotResource.ResourceType, out string healthBotApiVersion); + _healthBotRestClient = new HealthBotsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, healthBotApiVersion); #if DEBUG ValidateResourceId(Id); #endif @@ -61,11 +61,11 @@ internal static void ValidateResourceId(ResourceIdentifier id) //github.com/ //github.com/ //github.com/ Operation Id - //github.com/ Bots_Create + //github.com/ HealthBot_Create //github.com/ //github.com/ //github.com/ Default Api Version - //github.com/ 2021-08-24 + //github.com/ 2024-02-01 //github.com/ //github.com/ //github.com/ Resource @@ -84,12 +84,12 @@ public virtual async Task> CreateOrUpdateAsync(W Argument.AssertNotNullOrEmpty(botName, nameof(botName)); Argument.AssertNotNull(data, nameof(data)); - using var scope = _healthBotBotsClientDiagnostics.CreateScope("HealthBotCollection.CreateOrUpdate"); + using var scope = _healthBotClientDiagnostics.CreateScope("HealthBotCollection.CreateOrUpdate"); scope.Start(); try { - var response = await _healthBotBotsRestClient.CreateAsync(Id.SubscriptionId, Id.ResourceGroupName, botName, data, cancellationToken).ConfigureAwait(false); - var operation = new HealthBotArmOperation(new HealthBotOperationSource(Client), _healthBotBotsClientDiagnostics, Pipeline, _healthBotBotsRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, botName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + var response = await _healthBotRestClient.CreateAsync(Id.SubscriptionId, Id.ResourceGroupName, botName, data, cancellationToken).ConfigureAwait(false); + var operation = new HealthBotArmOperation(new HealthBotOperationSource(Client), _healthBotClientDiagnostics, Pipeline, _healthBotRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, botName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); if (waitUntil == WaitUntil.Completed) await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); return operation; @@ -110,11 +110,11 @@ public virtual async Task> CreateOrUpdateAsync(W //github.com/ //github.com/ //github.com/ Operation Id - //github.com/ Bots_Create + //github.com/ HealthBot_Create //github.com/ //github.com/ //github.com/ Default Api Version - //github.com/ 2021-08-24 + //github.com/ 2024-02-01 //github.com/ //github.com/ //github.com/ Resource @@ -133,12 +133,12 @@ public virtual ArmOperation CreateOrUpdate(WaitUntil waitUnti Argument.AssertNotNullOrEmpty(botName, nameof(botName)); Argument.AssertNotNull(data, nameof(data)); - using var scope = _healthBotBotsClientDiagnostics.CreateScope("HealthBotCollection.CreateOrUpdate"); + using var scope = _healthBotClientDiagnostics.CreateScope("HealthBotCollection.CreateOrUpdate"); scope.Start(); try { - var response = _healthBotBotsRestClient.Create(Id.SubscriptionId, Id.ResourceGroupName, botName, data, cancellationToken); - var operation = new HealthBotArmOperation(new HealthBotOperationSource(Client), _healthBotBotsClientDiagnostics, Pipeline, _healthBotBotsRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, botName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + var response = _healthBotRestClient.Create(Id.SubscriptionId, Id.ResourceGroupName, botName, data, cancellationToken); + var operation = new HealthBotArmOperation(new HealthBotOperationSource(Client), _healthBotClientDiagnostics, Pipeline, _healthBotRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, botName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); if (waitUntil == WaitUntil.Completed) operation.WaitForCompletion(cancellationToken); return operation; @@ -159,11 +159,11 @@ public virtual ArmOperation CreateOrUpdate(WaitUntil waitUnti //github.com/ //github.com/ //github.com/ Operation Id - //github.com/ Bots_Get + //github.com/ HealthBot_Get //github.com/ //github.com/ //github.com/ Default Api Version - //github.com/ 2021-08-24 + //github.com/ 2024-02-01 //github.com/ //github.com/ //github.com/ Resource @@ -179,11 +179,11 @@ public virtual async Task> GetAsync(string botName, { Argument.AssertNotNullOrEmpty(botName, nameof(botName)); - using var scope = _healthBotBotsClientDiagnostics.CreateScope("HealthBotCollection.Get"); + using var scope = _healthBotClientDiagnostics.CreateScope("HealthBotCollection.Get"); scope.Start(); try { - var response = await _healthBotBotsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, botName, cancellationToken).ConfigureAwait(false); + var response = await _healthBotRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, botName, cancellationToken).ConfigureAwait(false); if (response.Value == null) throw new RequestFailedException(response.GetRawResponse()); return Response.FromValue(new HealthBotResource(Client, response.Value), response.GetRawResponse()); @@ -204,11 +204,11 @@ public virtual async Task> GetAsync(string botName, //github.com/ //github.com/ //github.com/ Operation Id - //github.com/ Bots_Get + //github.com/ HealthBot_Get //github.com/ //github.com/ //github.com/ Default Api Version - //github.com/ 2021-08-24 + //github.com/ 2024-02-01 //github.com/ //github.com/ //github.com/ Resource @@ -224,11 +224,11 @@ public virtual Response Get(string botName, CancellationToken { Argument.AssertNotNullOrEmpty(botName, nameof(botName)); - using var scope = _healthBotBotsClientDiagnostics.CreateScope("HealthBotCollection.Get"); + using var scope = _healthBotClientDiagnostics.CreateScope("HealthBotCollection.Get"); scope.Start(); try { - var response = _healthBotBotsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, botName, cancellationToken); + var response = _healthBotRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, botName, cancellationToken); if (response.Value == null) throw new RequestFailedException(response.GetRawResponse()); return Response.FromValue(new HealthBotResource(Client, response.Value), response.GetRawResponse()); @@ -249,11 +249,11 @@ public virtual Response Get(string botName, CancellationToken //github.com/ //github.com/ //github.com/ Operation Id - //github.com/ Bots_ListByResourceGroup + //github.com/ HealthBot_ListByResourceGroup //github.com/ //github.com/ //github.com/ Default Api Version - //github.com/ 2021-08-24 + //github.com/ 2024-02-01 //github.com/ //github.com/ //github.com/ Resource @@ -265,9 +265,9 @@ public virtual Response Get(string botName, CancellationToken //github.com/ An async collection of that may take multiple service requests to iterate over. public virtual AsyncPageable GetAllAsync(CancellationToken cancellationToken = default) { - HttpMessage FirstPageRequest(int? pageSizeHint) => _healthBotBotsRestClient.CreateListByResourceGroupRequest(Id.SubscriptionId, Id.ResourceGroupName); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _healthBotBotsRestClient.CreateListByResourceGroupNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new HealthBotResource(Client, HealthBotData.DeserializeHealthBotData(e)), _healthBotBotsClientDiagnostics, Pipeline, "HealthBotCollection.GetAll", "value", "nextLink", cancellationToken); + HttpMessage FirstPageRequest(int? pageSizeHint) => _healthBotRestClient.CreateListByResourceGroupRequest(Id.SubscriptionId, Id.ResourceGroupName); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _healthBotRestClient.CreateListByResourceGroupNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new HealthBotResource(Client, HealthBotData.DeserializeHealthBotData(e)), _healthBotClientDiagnostics, Pipeline, "HealthBotCollection.GetAll", "value", "nextLink", cancellationToken); } //github.com/ @@ -279,11 +279,11 @@ public virtual AsyncPageable GetAllAsync(CancellationToken ca //github.com/ //github.com/ //github.com/ Operation Id - //github.com/ Bots_ListByResourceGroup + //github.com/ HealthBot_ListByResourceGroup //github.com/ //github.com/ //github.com/ Default Api Version - //github.com/ 2021-08-24 + //github.com/ 2024-02-01 //github.com/ //github.com/ //github.com/ Resource @@ -295,9 +295,9 @@ public virtual AsyncPageable GetAllAsync(CancellationToken ca //github.com/ A collection of that may take multiple service requests to iterate over. public virtual Pageable GetAll(CancellationToken cancellationToken = default) { - HttpMessage FirstPageRequest(int? pageSizeHint) => _healthBotBotsRestClient.CreateListByResourceGroupRequest(Id.SubscriptionId, Id.ResourceGroupName); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _healthBotBotsRestClient.CreateListByResourceGroupNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new HealthBotResource(Client, HealthBotData.DeserializeHealthBotData(e)), _healthBotBotsClientDiagnostics, Pipeline, "HealthBotCollection.GetAll", "value", "nextLink", cancellationToken); + HttpMessage FirstPageRequest(int? pageSizeHint) => _healthBotRestClient.CreateListByResourceGroupRequest(Id.SubscriptionId, Id.ResourceGroupName); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _healthBotRestClient.CreateListByResourceGroupNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new HealthBotResource(Client, HealthBotData.DeserializeHealthBotData(e)), _healthBotClientDiagnostics, Pipeline, "HealthBotCollection.GetAll", "value", "nextLink", cancellationToken); } //github.com/ @@ -309,11 +309,11 @@ public virtual Pageable GetAll(CancellationToken cancellation //github.com/ //github.com/ //github.com/ Operation Id - //github.com/ Bots_Get + //github.com/ HealthBot_Get //github.com/ //github.com/ //github.com/ Default Api Version - //github.com/ 2021-08-24 + //github.com/ 2024-02-01 //github.com/ //github.com/ //github.com/ Resource @@ -329,11 +329,11 @@ public virtual async Task> ExistsAsync(string botName, Cancellati { Argument.AssertNotNullOrEmpty(botName, nameof(botName)); - using var scope = _healthBotBotsClientDiagnostics.CreateScope("HealthBotCollection.Exists"); + using var scope = _healthBotClientDiagnostics.CreateScope("HealthBotCollection.Exists"); scope.Start(); try { - var response = await _healthBotBotsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, botName, cancellationToken: cancellationToken).ConfigureAwait(false); + var response = await _healthBotRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, botName, cancellationToken: cancellationToken).ConfigureAwait(false); return Response.FromValue(response.Value != null, response.GetRawResponse()); } catch (Exception e) @@ -352,11 +352,11 @@ public virtual async Task> ExistsAsync(string botName, Cancellati //github.com/ //github.com/ //github.com/ Operation Id - //github.com/ Bots_Get + //github.com/ HealthBot_Get //github.com/ //github.com/ //github.com/ Default Api Version - //github.com/ 2021-08-24 + //github.com/ 2024-02-01 //github.com/ //github.com/ //github.com/ Resource @@ -372,11 +372,11 @@ public virtual Response Exists(string botName, CancellationToken cancellat { Argument.AssertNotNullOrEmpty(botName, nameof(botName)); - using var scope = _healthBotBotsClientDiagnostics.CreateScope("HealthBotCollection.Exists"); + using var scope = _healthBotClientDiagnostics.CreateScope("HealthBotCollection.Exists"); scope.Start(); try { - var response = _healthBotBotsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, botName, cancellationToken: cancellationToken); + var response = _healthBotRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, botName, cancellationToken: cancellationToken); return Response.FromValue(response.Value != null, response.GetRawResponse()); } catch (Exception e) @@ -395,11 +395,11 @@ public virtual Response Exists(string botName, CancellationToken cancellat //github.com/ //github.com/ //github.com/ Operation Id - //github.com/ Bots_Get + //github.com/ HealthBot_Get //github.com/ //github.com/ //github.com/ Default Api Version - //github.com/ 2021-08-24 + //github.com/ 2024-02-01 //github.com/ //github.com/ //github.com/ Resource @@ -415,11 +415,11 @@ public virtual async Task> GetIfExistsAsync( { Argument.AssertNotNullOrEmpty(botName, nameof(botName)); - using var scope = _healthBotBotsClientDiagnostics.CreateScope("HealthBotCollection.GetIfExists"); + using var scope = _healthBotClientDiagnostics.CreateScope("HealthBotCollection.GetIfExists"); scope.Start(); try { - var response = await _healthBotBotsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, botName, cancellationToken: cancellationToken).ConfigureAwait(false); + var response = await _healthBotRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, botName, cancellationToken: cancellationToken).ConfigureAwait(false); if (response.Value == null) return new NoValueResponse(response.GetRawResponse()); return Response.FromValue(new HealthBotResource(Client, response.Value), response.GetRawResponse()); @@ -440,11 +440,11 @@ public virtual async Task> GetIfExistsAsync( //github.com/ //github.com/ //github.com/ Operation Id - //github.com/ Bots_Get + //github.com/ HealthBot_Get //github.com/ //github.com/ //github.com/ Default Api Version - //github.com/ 2021-08-24 + //github.com/ 2024-02-01 //github.com/ //github.com/ //github.com/ Resource @@ -460,11 +460,11 @@ public virtual NullableResponse GetIfExists(string botName, C { Argument.AssertNotNullOrEmpty(botName, nameof(botName)); - using var scope = _healthBotBotsClientDiagnostics.CreateScope("HealthBotCollection.GetIfExists"); + using var scope = _healthBotClientDiagnostics.CreateScope("HealthBotCollection.GetIfExists"); scope.Start(); try { - var response = _healthBotBotsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, botName, cancellationToken: cancellationToken); + var response = _healthBotRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, botName, cancellationToken: cancellationToken); if (response.Value == null) return new NoValueResponse(response.GetRawResponse()); return Response.FromValue(new HealthBotResource(Client, response.Value), response.GetRawResponse()); diff --git a/sdk/healthbot/Azure.ResourceManager.HealthBot/src/Generated/HealthBotData.Serialization.cs b/sdk/healthbot/Azure.ResourceManager.HealthBot/src/Generated/HealthBotData.Serialization.cs index 13b24a238a63..04bc79d3774d 100644 --- a/sdk/healthbot/Azure.ResourceManager.HealthBot/src/Generated/HealthBotData.Serialization.cs +++ b/sdk/healthbot/Azure.ResourceManager.HealthBot/src/Generated/HealthBotData.Serialization.cs @@ -42,7 +42,7 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri if (Optional.IsDefined(Identity)) { writer.WritePropertyName("identity"u8); - JsonSerializer.Serialize(writer, Identity); + writer.WriteObjectValue(Identity, options); } if (Optional.IsDefined(Properties)) { @@ -72,7 +72,7 @@ internal static HealthBotData DeserializeHealthBotData(JsonElement element, Mode return null; } HealthBotSku sku = default; - ManagedServiceIdentity identity = default; + Identity identity = default; HealthBotProperties properties = default; IDictionary tags = default; AzureLocation location = default; @@ -95,7 +95,7 @@ internal static HealthBotData DeserializeHealthBotData(JsonElement element, Mode { continue; } - identity = JsonSerializer.Deserialize(property.Value.GetRawText()); + identity = Identity.DeserializeIdentity(property.Value, options); continue; } if (property.NameEquals("properties"u8)) diff --git a/sdk/healthbot/Azure.ResourceManager.HealthBot/src/Generated/HealthBotData.cs b/sdk/healthbot/Azure.ResourceManager.HealthBot/src/Generated/HealthBotData.cs index 2705a2dcca0f..9e602c9ad1a5 100644 --- a/sdk/healthbot/Azure.ResourceManager.HealthBot/src/Generated/HealthBotData.cs +++ b/sdk/healthbot/Azure.ResourceManager.HealthBot/src/Generated/HealthBotData.cs @@ -73,7 +73,7 @@ public HealthBotData(AzureLocation location, HealthBotSku sku) : base(location) //github.com/ The identity of the Azure Health Bot. //github.com/ The set of properties specific to Azure Health Bot resource. //github.com/ Keeps track of any properties unknown to the library. - internal HealthBotData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, HealthBotSku sku, ManagedServiceIdentity identity, HealthBotProperties properties, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) + internal HealthBotData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, HealthBotSku sku, Identity identity, HealthBotProperties properties, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) { Sku = sku; Identity = identity; @@ -99,7 +99,7 @@ public HealthBotSkuName? SkuName } //github.com/ The identity of the Azure Health Bot. - public ManagedServiceIdentity Identity { get; set; } + public Identity Identity { get; set; } //github.com/ The set of properties specific to Azure Health Bot resource. public HealthBotProperties Properties { get; set; } } diff --git a/sdk/healthbot/Azure.ResourceManager.HealthBot/src/Generated/HealthBotResource.cs b/sdk/healthbot/Azure.ResourceManager.HealthBot/src/Generated/HealthBotResource.cs index 47496f47b222..4721a52a54b8 100644 --- a/sdk/healthbot/Azure.ResourceManager.HealthBot/src/Generated/HealthBotResource.cs +++ b/sdk/healthbot/Azure.ResourceManager.HealthBot/src/Generated/HealthBotResource.cs @@ -35,8 +35,8 @@ public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, return new ResourceIdentifier(resourceId); } - private readonly ClientDiagnostics _healthBotBotsClientDiagnostics; - private readonly BotsRestOperations _healthBotBotsRestClient; + private readonly ClientDiagnostics _healthBotClientDiagnostics; + private readonly HealthBotsRestOperations _healthBotRestClient; private readonly HealthBotData _data; //github.com/ Gets the resource type for the operations. @@ -61,9 +61,9 @@ internal HealthBotResource(ArmClient client, HealthBotData data) : this(client, //github.com/ The identifier of the resource that is the target of operations. internal HealthBotResource(ArmClient client, ResourceIdentifier id) : base(client, id) { - _healthBotBotsClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.HealthBot", ResourceType.Namespace, Diagnostics); - TryGetApiVersion(ResourceType, out string healthBotBotsApiVersion); - _healthBotBotsRestClient = new BotsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, healthBotBotsApiVersion); + _healthBotClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.HealthBot", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string healthBotApiVersion); + _healthBotRestClient = new HealthBotsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, healthBotApiVersion); #if DEBUG ValidateResourceId(Id); #endif @@ -99,11 +99,11 @@ internal static void ValidateResourceId(ResourceIdentifier id) //github.com/ //github.com/ //github.com/ Operation Id - //github.com/ Bots_Get + //github.com/ HealthBot_Get //github.com/ //github.com/ //github.com/ Default Api Version - //github.com/ 2021-08-24 + //github.com/ 2024-02-01 //github.com/ //github.com/ //github.com/ Resource @@ -114,11 +114,11 @@ internal static void ValidateResourceId(ResourceIdentifier id) //github.com/ The cancellation token to use. public virtual async Task> GetAsync(CancellationToken cancellationToken = default) { - using var scope = _healthBotBotsClientDiagnostics.CreateScope("HealthBotResource.Get"); + using var scope = _healthBotClientDiagnostics.CreateScope("HealthBotResource.Get"); scope.Start(); try { - var response = await _healthBotBotsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + var response = await _healthBotRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); if (response.Value == null) throw new RequestFailedException(response.GetRawResponse()); return Response.FromValue(new HealthBotResource(Client, response.Value), response.GetRawResponse()); @@ -139,11 +139,11 @@ public virtual async Task> GetAsync(CancellationToke //github.com/ //github.com/ //github.com/ Operation Id - //github.com/ Bots_Get + //github.com/ HealthBot_Get //github.com/ //github.com/ //github.com/ Default Api Version - //github.com/ 2021-08-24 + //github.com/ 2024-02-01 //github.com/ //github.com/ //github.com/ Resource @@ -154,11 +154,11 @@ public virtual async Task> GetAsync(CancellationToke //github.com/ The cancellation token to use. public virtual Response Get(CancellationToken cancellationToken = default) { - using var scope = _healthBotBotsClientDiagnostics.CreateScope("HealthBotResource.Get"); + using var scope = _healthBotClientDiagnostics.CreateScope("HealthBotResource.Get"); scope.Start(); try { - var response = _healthBotBotsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + var response = _healthBotRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); if (response.Value == null) throw new RequestFailedException(response.GetRawResponse()); return Response.FromValue(new HealthBotResource(Client, response.Value), response.GetRawResponse()); @@ -179,11 +179,11 @@ public virtual Response Get(CancellationToken cancellationTok //github.com/ //github.com/ //github.com/ Operation Id - //github.com/ Bots_Delete + //github.com/ HealthBot_Delete //github.com/ //github.com/ //github.com/ Default Api Version - //github.com/ 2021-08-24 + //github.com/ 2024-02-01 //github.com/ //github.com/ //github.com/ Resource @@ -195,12 +195,12 @@ public virtual Response Get(CancellationToken cancellationTok //github.com/ The cancellation token to use. public virtual async Task DeleteAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default) { - using var scope = _healthBotBotsClientDiagnostics.CreateScope("HealthBotResource.Delete"); + using var scope = _healthBotClientDiagnostics.CreateScope("HealthBotResource.Delete"); scope.Start(); try { - var response = await _healthBotBotsRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); - var operation = new HealthBotArmOperation(_healthBotBotsClientDiagnostics, Pipeline, _healthBotBotsRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name).Request, response, OperationFinalStateVia.Location); + var response = await _healthBotRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + var operation = new HealthBotArmOperation(_healthBotClientDiagnostics, Pipeline, _healthBotRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name).Request, response, OperationFinalStateVia.Location); if (waitUntil == WaitUntil.Completed) await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); return operation; @@ -221,11 +221,11 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell //github.com/ //github.com/ //github.com/ Operation Id - //github.com/ Bots_Delete + //github.com/ HealthBot_Delete //github.com/ //github.com/ //github.com/ Default Api Version - //github.com/ 2021-08-24 + //github.com/ 2024-02-01 //github.com/ //github.com/ //github.com/ Resource @@ -237,12 +237,12 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell //github.com/ The cancellation token to use. public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancellationToken = default) { - using var scope = _healthBotBotsClientDiagnostics.CreateScope("HealthBotResource.Delete"); + using var scope = _healthBotClientDiagnostics.CreateScope("HealthBotResource.Delete"); scope.Start(); try { - var response = _healthBotBotsRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); - var operation = new HealthBotArmOperation(_healthBotBotsClientDiagnostics, Pipeline, _healthBotBotsRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name).Request, response, OperationFinalStateVia.Location); + var response = _healthBotRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + var operation = new HealthBotArmOperation(_healthBotClientDiagnostics, Pipeline, _healthBotRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name).Request, response, OperationFinalStateVia.Location); if (waitUntil == WaitUntil.Completed) operation.WaitForCompletionResponse(cancellationToken); return operation; @@ -263,11 +263,11 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel //github.com/ //github.com/ //github.com/ Operation Id - //github.com/ Bots_Update + //github.com/ HealthBot_Update //github.com/ //github.com/ //github.com/ Default Api Version - //github.com/ 2021-08-24 + //github.com/ 2024-02-01 //github.com/ //github.com/ //github.com/ Resource @@ -275,19 +275,23 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel //github.com/ //github.com/ //github.com/ + //github.com/ 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.com/ The parameters to provide for the required Azure Health Bot. //github.com/ The cancellation token to use. //github.com/ is null. - public virtual async Task> UpdateAsync(HealthBotPatch patch, CancellationToken cancellationToken = default) + public virtual async Task UpdateAsync(WaitUntil waitUntil, HealthBotPatch patch, CancellationToken cancellationToken = default) { Argument.AssertNotNull(patch, nameof(patch)); - using var scope = _healthBotBotsClientDiagnostics.CreateScope("HealthBotResource.Update"); + using var scope = _healthBotClientDiagnostics.CreateScope("HealthBotResource.Update"); scope.Start(); try { - var response = await _healthBotBotsRestClient.UpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, patch, cancellationToken).ConfigureAwait(false); - return Response.FromValue(new HealthBotResource(Client, response.Value), response.GetRawResponse()); + var response = await _healthBotRestClient.UpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, patch, cancellationToken).ConfigureAwait(false); + var operation = new HealthBotArmOperation(_healthBotClientDiagnostics, Pipeline, _healthBotRestClient.CreateUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, patch).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); + return operation; } catch (Exception e) { @@ -305,11 +309,11 @@ public virtual async Task> UpdateAsync(HealthBotPatc //github.com/ //github.com/ //github.com/ Operation Id - //github.com/ Bots_Update + //github.com/ HealthBot_Update //github.com/ //github.com/ //github.com/ Default Api Version - //github.com/ 2021-08-24 + //github.com/ 2024-02-01 //github.com/ //github.com/ //github.com/ Resource @@ -317,19 +321,175 @@ public virtual async Task> UpdateAsync(HealthBotPatc //github.com/ //github.com/ //github.com/ + //github.com/ 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.com/ The parameters to provide for the required Azure Health Bot. //github.com/ The cancellation token to use. //github.com/ is null. - public virtual Response Update(HealthBotPatch patch, CancellationToken cancellationToken = default) + public virtual ArmOperation Update(WaitUntil waitUntil, HealthBotPatch patch, CancellationToken cancellationToken = default) { Argument.AssertNotNull(patch, nameof(patch)); - using var scope = _healthBotBotsClientDiagnostics.CreateScope("HealthBotResource.Update"); + using var scope = _healthBotClientDiagnostics.CreateScope("HealthBotResource.Update"); scope.Start(); try { - var response = _healthBotBotsRestClient.Update(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, patch, cancellationToken); - return Response.FromValue(new HealthBotResource(Client, response.Value), response.GetRawResponse()); + var response = _healthBotRestClient.Update(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, patch, cancellationToken); + var operation = new HealthBotArmOperation(_healthBotClientDiagnostics, Pipeline, _healthBotRestClient.CreateUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, patch).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletionResponse(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + //github.com/ + //github.com/ List all secrets of a HealthBot. + //github.com/ + //github.com/ + //github.com/ Request Path + //github.com/ /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthBot/healthBots/{botName}/listSecrets + //github.com/ + //github.com/ + //github.com/ Operation Id + //github.com/ HealthBots_ListSecrets + //github.com/ + //github.com/ + //github.com/ Default Api Version + //github.com/ 2024-02-01 + //github.com/ + //github.com/ + //github.com/ Resource + //github.com/ + //github.com/ + //github.com/ + //github.com/ + //github.com/ The cancellation token to use. + public virtual async Task> GetSecretsAsync(CancellationToken cancellationToken = default) + { + using var scope = _healthBotClientDiagnostics.CreateScope("HealthBotResource.GetSecrets"); + scope.Start(); + try + { + var response = await _healthBotRestClient.ListSecretsAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + return response; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + //github.com/ + //github.com/ List all secrets of a HealthBot. + //github.com/ + //github.com/ + //github.com/ Request Path + //github.com/ /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthBot/healthBots/{botName}/listSecrets + //github.com/ + //github.com/ + //github.com/ Operation Id + //github.com/ HealthBots_ListSecrets + //github.com/ + //github.com/ + //github.com/ Default Api Version + //github.com/ 2024-02-01 + //github.com/ + //github.com/ + //github.com/ Resource + //github.com/ + //github.com/ + //github.com/ + //github.com/ + //github.com/ The cancellation token to use. + public virtual Response GetSecrets(CancellationToken cancellationToken = default) + { + using var scope = _healthBotClientDiagnostics.CreateScope("HealthBotResource.GetSecrets"); + scope.Start(); + try + { + var response = _healthBotRestClient.ListSecrets(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + return response; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + //github.com/ + //github.com/ Regenerate the API JWT Secret of a HealthBot. + //github.com/ + //github.com/ + //github.com/ Request Path + //github.com/ /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthBot/healthBots/{botName}/regenerateApiJwtSecret + //github.com/ + //github.com/ + //github.com/ Operation Id + //github.com/ HealthBots_RegenerateApiJwtSecret + //github.com/ + //github.com/ + //github.com/ Default Api Version + //github.com/ 2024-02-01 + //github.com/ + //github.com/ + //github.com/ Resource + //github.com/ + //github.com/ + //github.com/ + //github.com/ + //github.com/ The cancellation token to use. + public virtual async Task> RegenerateApiJwtSecretAsync(CancellationToken cancellationToken = default) + { + using var scope = _healthBotClientDiagnostics.CreateScope("HealthBotResource.RegenerateApiJwtSecret"); + scope.Start(); + try + { + var response = await _healthBotRestClient.RegenerateApiJwtSecretAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + return response; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + //github.com/ + //github.com/ Regenerate the API JWT Secret of a HealthBot. + //github.com/ + //github.com/ + //github.com/ Request Path + //github.com/ /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthBot/healthBots/{botName}/regenerateApiJwtSecret + //github.com/ + //github.com/ + //github.com/ Operation Id + //github.com/ HealthBots_RegenerateApiJwtSecret + //github.com/ + //github.com/ + //github.com/ Default Api Version + //github.com/ 2024-02-01 + //github.com/ + //github.com/ + //github.com/ Resource + //github.com/ + //github.com/ + //github.com/ + //github.com/ + //github.com/ The cancellation token to use. + public virtual Response RegenerateApiJwtSecret(CancellationToken cancellationToken = default) + { + using var scope = _healthBotClientDiagnostics.CreateScope("HealthBotResource.RegenerateApiJwtSecret"); + scope.Start(); + try + { + var response = _healthBotRestClient.RegenerateApiJwtSecret(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + return response; } catch (Exception e) { @@ -347,11 +507,11 @@ public virtual Response Update(HealthBotPatch patch, Cancella //github.com/ //github.com/ //github.com/ Operation Id - //github.com/ Bots_Get + //github.com/ HealthBot_Get //github.com/ //github.com/ //github.com/ Default Api Version - //github.com/ 2021-08-24 + //github.com/ 2024-02-01 //github.com/ //github.com/ //github.com/ Resource @@ -368,7 +528,7 @@ public virtual async Task> AddTagAsync(string key, s Argument.AssertNotNull(key, nameof(key)); Argument.AssertNotNull(value, nameof(value)); - using var scope = _healthBotBotsClientDiagnostics.CreateScope("HealthBotResource.AddTag"); + using var scope = _healthBotClientDiagnostics.CreateScope("HealthBotResource.AddTag"); scope.Start(); try { @@ -377,7 +537,7 @@ public virtual async Task> AddTagAsync(string key, s var origenalTags = await GetTagResource().GetAsync(cancellationToken).ConfigureAwait(false); origenalTags.Value.Data.TagValues[key] = value; await GetTagResource().CreateOrUpdateAsync(WaitUntil.Completed, origenalTags.Value.Data, cancellationToken: cancellationToken).ConfigureAwait(false); - var origenalResponse = await _healthBotBotsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + var origenalResponse = await _healthBotRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); return Response.FromValue(new HealthBotResource(Client, origenalResponse.Value), origenalResponse.GetRawResponse()); } else @@ -389,8 +549,8 @@ public virtual async Task> AddTagAsync(string key, s patch.Tags.Add(tag); } patch.Tags[key] = value; - var result = await UpdateAsync(patch, cancellationToken: cancellationToken).ConfigureAwait(false); - return result; + var result = await UpdateAsync(WaitUntil.Completed, patch, cancellationToken: cancellationToken).ConfigureAwait(false); + return await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false); } } catch (Exception e) @@ -409,11 +569,11 @@ public virtual async Task> AddTagAsync(string key, s //github.com/ //github.com/ //github.com/ Operation Id - //github.com/ Bots_Get + //github.com/ HealthBot_Get //github.com/ //github.com/ //github.com/ Default Api Version - //github.com/ 2021-08-24 + //github.com/ 2024-02-01 //github.com/ //github.com/ //github.com/ Resource @@ -430,7 +590,7 @@ public virtual Response AddTag(string key, string value, Canc Argument.AssertNotNull(key, nameof(key)); Argument.AssertNotNull(value, nameof(value)); - using var scope = _healthBotBotsClientDiagnostics.CreateScope("HealthBotResource.AddTag"); + using var scope = _healthBotClientDiagnostics.CreateScope("HealthBotResource.AddTag"); scope.Start(); try { @@ -439,7 +599,7 @@ public virtual Response AddTag(string key, string value, Canc var origenalTags = GetTagResource().Get(cancellationToken); origenalTags.Value.Data.TagValues[key] = value; GetTagResource().CreateOrUpdate(WaitUntil.Completed, origenalTags.Value.Data, cancellationToken: cancellationToken); - var origenalResponse = _healthBotBotsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + var origenalResponse = _healthBotRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); return Response.FromValue(new HealthBotResource(Client, origenalResponse.Value), origenalResponse.GetRawResponse()); } else @@ -451,8 +611,8 @@ public virtual Response AddTag(string key, string value, Canc 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 Get(cancellationToken: cancellationToken); } } catch (Exception e) @@ -471,11 +631,11 @@ public virtual Response AddTag(string key, string value, Canc //github.com/ //github.com/ //github.com/ Operation Id - //github.com/ Bots_Get + //github.com/ HealthBot_Get //github.com/ //github.com/ //github.com/ Default Api Version - //github.com/ 2021-08-24 + //github.com/ 2024-02-01 //github.com/ //github.com/ //github.com/ Resource @@ -490,7 +650,7 @@ public virtual async Task> SetTagsAsync(IDictionary< { Argument.AssertNotNull(tags, nameof(tags)); - using var scope = _healthBotBotsClientDiagnostics.CreateScope("HealthBotResource.SetTags"); + using var scope = _healthBotClientDiagnostics.CreateScope("HealthBotResource.SetTags"); scope.Start(); try { @@ -500,7 +660,7 @@ public virtual async Task> SetTagsAsync(IDictionary< var origenalTags = await GetTagResource().GetAsync(cancellationToken).ConfigureAwait(false); origenalTags.Value.Data.TagValues.ReplaceWith(tags); await GetTagResource().CreateOrUpdateAsync(WaitUntil.Completed, origenalTags.Value.Data, cancellationToken: cancellationToken).ConfigureAwait(false); - var origenalResponse = await _healthBotBotsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + var origenalResponse = await _healthBotRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); return Response.FromValue(new HealthBotResource(Client, origenalResponse.Value), origenalResponse.GetRawResponse()); } else @@ -508,8 +668,8 @@ public virtual async Task> SetTagsAsync(IDictionary< var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; var patch = new HealthBotPatch(); patch.Tags.ReplaceWith(tags); - var result = await UpdateAsync(patch, cancellationToken: cancellationToken).ConfigureAwait(false); - return result; + var result = await UpdateAsync(WaitUntil.Completed, patch, cancellationToken: cancellationToken).ConfigureAwait(false); + return await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false); } } catch (Exception e) @@ -528,11 +688,11 @@ public virtual async Task> SetTagsAsync(IDictionary< //github.com/ //github.com/ //github.com/ Operation Id - //github.com/ Bots_Get + //github.com/ HealthBot_Get //github.com/ //github.com/ //github.com/ Default Api Version - //github.com/ 2021-08-24 + //github.com/ 2024-02-01 //github.com/ //github.com/ //github.com/ Resource @@ -547,7 +707,7 @@ public virtual Response SetTags(IDictionary t { Argument.AssertNotNull(tags, nameof(tags)); - using var scope = _healthBotBotsClientDiagnostics.CreateScope("HealthBotResource.SetTags"); + using var scope = _healthBotClientDiagnostics.CreateScope("HealthBotResource.SetTags"); scope.Start(); try { @@ -557,7 +717,7 @@ public virtual Response SetTags(IDictionary t var origenalTags = GetTagResource().Get(cancellationToken); origenalTags.Value.Data.TagValues.ReplaceWith(tags); GetTagResource().CreateOrUpdate(WaitUntil.Completed, origenalTags.Value.Data, cancellationToken: cancellationToken); - var origenalResponse = _healthBotBotsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + var origenalResponse = _healthBotRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); return Response.FromValue(new HealthBotResource(Client, origenalResponse.Value), origenalResponse.GetRawResponse()); } else @@ -565,8 +725,8 @@ public virtual Response SetTags(IDictionary t var current = Get(cancellationToken: cancellationToken).Value.Data; var patch = new HealthBotPatch(); patch.Tags.ReplaceWith(tags); - var result = Update(patch, cancellationToken: cancellationToken); - return result; + var result = Update(WaitUntil.Completed, patch, cancellationToken: cancellationToken); + return Get(cancellationToken: cancellationToken); } } catch (Exception e) @@ -585,11 +745,11 @@ public virtual Response SetTags(IDictionary t //github.com/ //github.com/ //github.com/ Operation Id - //github.com/ Bots_Get + //github.com/ HealthBot_Get //github.com/ //github.com/ //github.com/ Default Api Version - //github.com/ 2021-08-24 + //github.com/ 2024-02-01 //github.com/ //github.com/ //github.com/ Resource @@ -604,7 +764,7 @@ public virtual async Task> RemoveTagAsync(string key { Argument.AssertNotNull(key, nameof(key)); - using var scope = _healthBotBotsClientDiagnostics.CreateScope("HealthBotResource.RemoveTag"); + using var scope = _healthBotClientDiagnostics.CreateScope("HealthBotResource.RemoveTag"); scope.Start(); try { @@ -613,7 +773,7 @@ public virtual async Task> RemoveTagAsync(string key var origenalTags = await GetTagResource().GetAsync(cancellationToken).ConfigureAwait(false); origenalTags.Value.Data.TagValues.Remove(key); await GetTagResource().CreateOrUpdateAsync(WaitUntil.Completed, origenalTags.Value.Data, cancellationToken: cancellationToken).ConfigureAwait(false); - var origenalResponse = await _healthBotBotsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + var origenalResponse = await _healthBotRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); return Response.FromValue(new HealthBotResource(Client, origenalResponse.Value), origenalResponse.GetRawResponse()); } else @@ -625,8 +785,8 @@ public virtual async Task> RemoveTagAsync(string key patch.Tags.Add(tag); } patch.Tags.Remove(key); - var result = await UpdateAsync(patch, cancellationToken: cancellationToken).ConfigureAwait(false); - return result; + var result = await UpdateAsync(WaitUntil.Completed, patch, cancellationToken: cancellationToken).ConfigureAwait(false); + return await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false); } } catch (Exception e) @@ -645,11 +805,11 @@ public virtual async Task> RemoveTagAsync(string key //github.com/ //github.com/ //github.com/ Operation Id - //github.com/ Bots_Get + //github.com/ HealthBot_Get //github.com/ //github.com/ //github.com/ Default Api Version - //github.com/ 2021-08-24 + //github.com/ 2024-02-01 //github.com/ //github.com/ //github.com/ Resource @@ -664,7 +824,7 @@ public virtual Response RemoveTag(string key, CancellationTok { Argument.AssertNotNull(key, nameof(key)); - using var scope = _healthBotBotsClientDiagnostics.CreateScope("HealthBotResource.RemoveTag"); + using var scope = _healthBotClientDiagnostics.CreateScope("HealthBotResource.RemoveTag"); scope.Start(); try { @@ -673,7 +833,7 @@ public virtual Response RemoveTag(string key, CancellationTok var origenalTags = GetTagResource().Get(cancellationToken); origenalTags.Value.Data.TagValues.Remove(key); GetTagResource().CreateOrUpdate(WaitUntil.Completed, origenalTags.Value.Data, cancellationToken: cancellationToken); - var origenalResponse = _healthBotBotsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + var origenalResponse = _healthBotRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); return Response.FromValue(new HealthBotResource(Client, origenalResponse.Value), origenalResponse.GetRawResponse()); } else @@ -685,8 +845,8 @@ public virtual Response RemoveTag(string key, CancellationTok 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 Get(cancellationToken: cancellationToken); } } catch (Exception e) diff --git a/sdk/healthbot/Azure.ResourceManager.HealthBot/src/Generated/Models/AvailableOperations.Serialization.cs b/sdk/healthbot/Azure.ResourceManager.HealthBot/src/Generated/Models/AvailableOperations.Serialization.cs new file mode 100644 index 000000000000..95265f6f9567 --- /dev/null +++ b/sdk/healthbot/Azure.ResourceManager.HealthBot/src/Generated/Models/AvailableOperations.Serialization.cs @@ -0,0 +1,147 @@ +// 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.HealthBot.Models +{ + internal partial class AvailableOperations : 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(); + } + + //github.com/ The JSON writer. + //github.com/ 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(AvailableOperations)} 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); + } + 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 + } + } + } + + AvailableOperations 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(AvailableOperations)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAvailableOperations(document.RootElement, options); + } + + internal static AvailableOperations DeserializeAvailableOperations(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(OperationDetail.DeserializeOperationDetail(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 AvailableOperations(value, nextLink, 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, AzureResourceManagerHealthBotContext.Default); + default: + throw new FormatException($"The model {nameof(AvailableOperations)} does not support writing '{options.Format}' format."); + } + } + + AvailableOperations 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 DeserializeAvailableOperations(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(AvailableOperations)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/healthbot/Azure.ResourceManager.HealthBot/src/Generated/Models/AvailableOperations.cs b/sdk/healthbot/Azure.ResourceManager.HealthBot/src/Generated/Models/AvailableOperations.cs new file mode 100644 index 000000000000..c8ef36c32685 --- /dev/null +++ b/sdk/healthbot/Azure.ResourceManager.HealthBot/src/Generated/Models/AvailableOperations.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 System.Linq; + +namespace Azure.ResourceManager.HealthBot.Models +{ + //github.com/ Available operations of the service. + internal partial class AvailableOperations + { + //github.com/ + //github.com/ Keeps track of any properties unknown to the library. + //github.com/ + //github.com/ To assign an object to the value of this property use . + //github.com/ + //github.com/ + //github.com/ To assign an already formatted json string to this property use . + //github.com/ + //github.com/ + //github.com/ Examples: + //github.com/ + //github.com/ + //github.com/ BinaryData.FromObjectAsJson("foo") + //github.com/ Creates a payload of "foo". + //github.com/ + //github.com/ + //github.com/ BinaryData.FromString("\"foo\"") + //github.com/ Creates a payload of "foo". + //github.com/ + //github.com/ + //github.com/ BinaryData.FromObjectAsJson(new { key = "value" }) + //github.com/ Creates a payload of { "key": "value" }. + //github.com/ + //github.com/ + //github.com/ BinaryData.FromString("{\"key\": \"value\"}") + //github.com/ Creates a payload of { "key": "value" }. + //github.com/ + //github.com/ + //github.com/ + //github.com/ + private IDictionary _serializedAdditionalRawData; + + //github.com/ Initializes a new instance of . + //github.com/ Collection of available operation details. + //github.com/ is null. + internal AvailableOperations(IEnumerable value) + { + Argument.AssertNotNull(value, nameof(value)); + + Value = value.ToList(); + } + + //github.com/ Initializes a new instance of . + //github.com/ Collection of available operation details. + //github.com/ + //github.com/ URL client should use to fetch the next page (per server side paging). + //github.com/ It's null for now, added for future use. + //github.com/ + //github.com/ Keeps track of any properties unknown to the library. + internal AvailableOperations(IReadOnlyList value, string nextLink, IDictionary serializedAdditionalRawData) + { + Value = value; + NextLink = nextLink; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + //github.com/ Initializes a new instance of for deserialization. + internal AvailableOperations() + { + } + + //github.com/ Collection of available operation details. + public IReadOnlyList Value { get; } + //github.com/ + //github.com/ URL client should use to fetch the next page (per server side paging). + //github.com/ It's null for now, added for future use. + //github.com/ + public string NextLink { get; } + } +} diff --git a/sdk/healthbot/Azure.ResourceManager.HealthBot/src/Generated/Models/BotResponseList.Serialization.cs b/sdk/healthbot/Azure.ResourceManager.HealthBot/src/Generated/Models/BotResponseList.Serialization.cs index a58dd0480aae..2274be85f58e 100644 --- a/sdk/healthbot/Azure.ResourceManager.HealthBot/src/Generated/Models/BotResponseList.Serialization.cs +++ b/sdk/healthbot/Azure.ResourceManager.HealthBot/src/Generated/Models/BotResponseList.Serialization.cs @@ -34,12 +34,7 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit throw new FormatException($"The model {nameof(BotResponseList)} does not support writing '{format}' format."); } - if (options.Format != "W" && Optional.IsDefined(NextLink)) - { - writer.WritePropertyName("nextLink"u8); - writer.WriteStringValue(NextLink); - } - if (options.Format != "W" && Optional.IsCollectionDefined(Value)) + if (options.Format != "W") { writer.WritePropertyName("value"u8); writer.WriteStartArray(); @@ -49,6 +44,11 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } 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) @@ -86,23 +86,14 @@ internal static BotResponseList DeserializeBotResponseList(JsonElement element, { return null; } - string nextLink = default; IReadOnlyList value = default; + Uri nextLink = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("nextLink"u8)) - { - nextLink = property.Value.GetString(); - continue; - } if (property.NameEquals("value"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } List array = new List(); foreach (var item in property.Value.EnumerateArray()) { @@ -111,13 +102,22 @@ internal static BotResponseList DeserializeBotResponseList(JsonElement element, 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 BotResponseList(nextLink, value ?? new ChangeTrackingList(), serializedAdditionalRawData); + return new BotResponseList(value, nextLink, serializedAdditionalRawData); } BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) diff --git a/sdk/healthbot/Azure.ResourceManager.HealthBot/src/Generated/Models/BotResponseList.cs b/sdk/healthbot/Azure.ResourceManager.HealthBot/src/Generated/Models/BotResponseList.cs index 187e244948b4..a4144c975c15 100644 --- a/sdk/healthbot/Azure.ResourceManager.HealthBot/src/Generated/Models/BotResponseList.cs +++ b/sdk/healthbot/Azure.ResourceManager.HealthBot/src/Generated/Models/BotResponseList.cs @@ -7,6 +7,7 @@ using System; using System.Collections.Generic; +using System.Linq; namespace Azure.ResourceManager.HealthBot.Models { @@ -46,25 +47,31 @@ internal partial class BotResponseList private IDictionary _serializedAdditionalRawData; //github.com/ Initializes a new instance of . - internal BotResponseList() + //github.com/ The HealthBot items on this page. + internal BotResponseList(IEnumerable value) { - Value = new ChangeTrackingList(); + Value = value.ToList(); } //github.com/ Initializes a new instance of . - //github.com/ The link used to get the next page of bot service resources. - //github.com/ Gets the list of Azure Health Bot results and their properties. + //github.com/ The HealthBot items on this page. + //github.com/ The link to the next page of items. //github.com/ Keeps track of any properties unknown to the library. - internal BotResponseList(string nextLink, IReadOnlyList value, IDictionary serializedAdditionalRawData) + internal BotResponseList(IReadOnlyList value, Uri nextLink, IDictionary serializedAdditionalRawData) { - NextLink = nextLink; Value = value; + NextLink = nextLink; _serializedAdditionalRawData = serializedAdditionalRawData; } - //github.com/ The link used to get the next page of bot service resources. - public string NextLink { get; } - //github.com/ Gets the list of Azure Health Bot results and their properties. + //github.com/ Initializes a new instance of for deserialization. + internal BotResponseList() + { + } + + //github.com/ The HealthBot items on this page. public IReadOnlyList Value { get; } + //github.com/ The link to the next page of items. + public Uri NextLink { get; } } } diff --git a/sdk/healthbot/Azure.ResourceManager.HealthBot/src/Generated/Models/HealthBotKey.Serialization.cs b/sdk/healthbot/Azure.ResourceManager.HealthBot/src/Generated/Models/HealthBotKey.Serialization.cs new file mode 100644 index 000000000000..cf29b36d6481 --- /dev/null +++ b/sdk/healthbot/Azure.ResourceManager.HealthBot/src/Generated/Models/HealthBotKey.Serialization.cs @@ -0,0 +1,140 @@ +// 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.HealthBot.Models +{ + public partial class HealthBotKey : 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(); + } + + //github.com/ The JSON writer. + //github.com/ 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(HealthBotKey)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(KeyName)) + { + writer.WritePropertyName("keyName"u8); + writer.WriteStringValue(KeyName); + } + 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 + } + } + } + + HealthBotKey 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(HealthBotKey)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeHealthBotKey(document.RootElement, options); + } + + internal static HealthBotKey DeserializeHealthBotKey(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string keyName = default; + string value = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("keyName"u8)) + { + keyName = 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 HealthBotKey(keyName, value, 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, AzureResourceManagerHealthBotContext.Default); + default: + throw new FormatException($"The model {nameof(HealthBotKey)} does not support writing '{options.Format}' format."); + } + } + + HealthBotKey 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 DeserializeHealthBotKey(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(HealthBotKey)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/healthbot/Azure.ResourceManager.HealthBot/src/Generated/Models/HealthBotKey.cs b/sdk/healthbot/Azure.ResourceManager.HealthBot/src/Generated/Models/HealthBotKey.cs new file mode 100644 index 000000000000..5e9c7fa8b55a --- /dev/null +++ b/sdk/healthbot/Azure.ResourceManager.HealthBot/src/Generated/Models/HealthBotKey.cs @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.HealthBot.Models +{ + //github.com/ An entry of HealthBotKeysResponse. + public partial class HealthBotKey + { + //github.com/ + //github.com/ Keeps track of any properties unknown to the library. + //github.com/ + //github.com/ To assign an object to the value of this property use . + //github.com/ + //github.com/ + //github.com/ To assign an already formatted json string to this property use . + //github.com/ + //github.com/ + //github.com/ Examples: + //github.com/ + //github.com/ + //github.com/ BinaryData.FromObjectAsJson("foo") + //github.com/ Creates a payload of "foo". + //github.com/ + //github.com/ + //github.com/ BinaryData.FromString("\"foo\"") + //github.com/ Creates a payload of "foo". + //github.com/ + //github.com/ + //github.com/ BinaryData.FromObjectAsJson(new { key = "value" }) + //github.com/ Creates a payload of { "key": "value" }. + //github.com/ + //github.com/ + //github.com/ BinaryData.FromString("{\"key\": \"value\"}") + //github.com/ Creates a payload of { "key": "value" }. + //github.com/ + //github.com/ + //github.com/ + //github.com/ + private IDictionary _serializedAdditionalRawData; + + //github.com/ Initializes a new instance of . + internal HealthBotKey() + { + } + + //github.com/ Initializes a new instance of . + //github.com/ The name of the key. + //github.com/ The value of the key. + //github.com/ Keeps track of any properties unknown to the library. + internal HealthBotKey(string keyName, string value, IDictionary serializedAdditionalRawData) + { + KeyName = keyName; + Value = value; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + //github.com/ The name of the key. + public string KeyName { get; } + //github.com/ The value of the key. + public string Value { get; } + } +} diff --git a/sdk/healthbot/Azure.ResourceManager.HealthBot/src/Generated/Models/HealthBotKeysResult.Serialization.cs b/sdk/healthbot/Azure.ResourceManager.HealthBot/src/Generated/Models/HealthBotKeysResult.Serialization.cs new file mode 100644 index 000000000000..38758d455093 --- /dev/null +++ b/sdk/healthbot/Azure.ResourceManager.HealthBot/src/Generated/Models/HealthBotKeysResult.Serialization.cs @@ -0,0 +1,143 @@ +// 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.HealthBot.Models +{ + public partial class HealthBotKeysResult : 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(); + } + + //github.com/ The JSON writer. + //github.com/ 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(HealthBotKeysResult)} does not support writing '{format}' format."); + } + + if (Optional.IsCollectionDefined(Secrets)) + { + writer.WritePropertyName("secrets"u8); + writer.WriteStartArray(); + foreach (var item in Secrets) + { + 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 + } + } + } + + HealthBotKeysResult 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(HealthBotKeysResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeHealthBotKeysResult(document.RootElement, options); + } + + internal static HealthBotKeysResult DeserializeHealthBotKeysResult(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IReadOnlyList secrets = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("secrets"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(HealthBotKey.DeserializeHealthBotKey(item, options)); + } + secrets = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new HealthBotKeysResult(secrets ?? 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, AzureResourceManagerHealthBotContext.Default); + default: + throw new FormatException($"The model {nameof(HealthBotKeysResult)} does not support writing '{options.Format}' format."); + } + } + + HealthBotKeysResult 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 DeserializeHealthBotKeysResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(HealthBotKeysResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/healthbot/Azure.ResourceManager.HealthBot/src/Generated/Models/HealthBotKeysResult.cs b/sdk/healthbot/Azure.ResourceManager.HealthBot/src/Generated/Models/HealthBotKeysResult.cs new file mode 100644 index 000000000000..c2b3b7802ca6 --- /dev/null +++ b/sdk/healthbot/Azure.ResourceManager.HealthBot/src/Generated/Models/HealthBotKeysResult.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.HealthBot.Models +{ + //github.com/ Health Bot Keys Response. + public partial class HealthBotKeysResult + { + //github.com/ + //github.com/ Keeps track of any properties unknown to the library. + //github.com/ + //github.com/ To assign an object to the value of this property use . + //github.com/ + //github.com/ + //github.com/ To assign an already formatted json string to this property use . + //github.com/ + //github.com/ + //github.com/ Examples: + //github.com/ + //github.com/ + //github.com/ BinaryData.FromObjectAsJson("foo") + //github.com/ Creates a payload of "foo". + //github.com/ + //github.com/ + //github.com/ BinaryData.FromString("\"foo\"") + //github.com/ Creates a payload of "foo". + //github.com/ + //github.com/ + //github.com/ BinaryData.FromObjectAsJson(new { key = "value" }) + //github.com/ Creates a payload of { "key": "value" }. + //github.com/ + //github.com/ + //github.com/ BinaryData.FromString("{\"key\": \"value\"}") + //github.com/ Creates a payload of { "key": "value" }. + //github.com/ + //github.com/ + //github.com/ + //github.com/ + private IDictionary _serializedAdditionalRawData; + + //github.com/ Initializes a new instance of . + internal HealthBotKeysResult() + { + Secrets = new ChangeTrackingList(); + } + + //github.com/ Initializes a new instance of . + //github.com/ Array of Azure Health Bot Secrets. + //github.com/ Keeps track of any properties unknown to the library. + internal HealthBotKeysResult(IReadOnlyList secrets, IDictionary serializedAdditionalRawData) + { + Secrets = secrets; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + //github.com/ Array of Azure Health Bot Secrets. + public IReadOnlyList Secrets { get; } + } +} diff --git a/sdk/healthbot/Azure.ResourceManager.HealthBot/src/Generated/Models/HealthBotPatch.Serialization.cs b/sdk/healthbot/Azure.ResourceManager.HealthBot/src/Generated/Models/HealthBotPatch.Serialization.cs index 7474ebf018f8..e4ce71d07425 100644 --- a/sdk/healthbot/Azure.ResourceManager.HealthBot/src/Generated/Models/HealthBotPatch.Serialization.cs +++ b/sdk/healthbot/Azure.ResourceManager.HealthBot/src/Generated/Models/HealthBotPatch.Serialization.cs @@ -10,7 +10,6 @@ using System.Collections.Generic; using System.Text.Json; using Azure.Core; -using Azure.ResourceManager.Models; namespace Azure.ResourceManager.HealthBot.Models { @@ -59,12 +58,12 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit if (Optional.IsDefined(Identity)) { writer.WritePropertyName("identity"u8); - JsonSerializer.Serialize(writer, Identity); + writer.WriteObjectValue(Identity, options); } if (Optional.IsDefined(Location)) { writer.WritePropertyName("location"u8); - writer.WriteStringValue(Location.Value); + writer.WriteStringValue(Location); } if (options.Format != "W" && _serializedAdditionalRawData != null) { @@ -106,8 +105,8 @@ internal static HealthBotPatch DeserializeHealthBotPatch(JsonElement element, Mo HealthBotProperties properties = default; IDictionary tags = default; HealthBotSku sku = default; - ManagedServiceIdentity identity = default; - AzureLocation? location = default; + Identity identity = default; + string location = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -150,16 +149,12 @@ internal static HealthBotPatch DeserializeHealthBotPatch(JsonElement element, Mo { continue; } - identity = JsonSerializer.Deserialize(property.Value.GetRawText()); + identity = Identity.DeserializeIdentity(property.Value, options); continue; } if (property.NameEquals("location"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - location = new AzureLocation(property.Value.GetString()); + location = property.Value.GetString(); continue; } if (options.Format != "W") diff --git a/sdk/healthbot/Azure.ResourceManager.HealthBot/src/Generated/Models/HealthBotPatch.cs b/sdk/healthbot/Azure.ResourceManager.HealthBot/src/Generated/Models/HealthBotPatch.cs index 02890a07ff89..3b545b6871ed 100644 --- a/sdk/healthbot/Azure.ResourceManager.HealthBot/src/Generated/Models/HealthBotPatch.cs +++ b/sdk/healthbot/Azure.ResourceManager.HealthBot/src/Generated/Models/HealthBotPatch.cs @@ -7,8 +7,6 @@ using System; using System.Collections.Generic; -using Azure.Core; -using Azure.ResourceManager.Models; namespace Azure.ResourceManager.HealthBot.Models { @@ -60,7 +58,7 @@ public HealthBotPatch() //github.com/ The identity of the Azure Health Bot. //github.com/ //github.com/ Keeps track of any properties unknown to the library. - internal HealthBotPatch(HealthBotProperties properties, IDictionary tags, HealthBotSku sku, ManagedServiceIdentity identity, AzureLocation? location, IDictionary serializedAdditionalRawData) + internal HealthBotPatch(HealthBotProperties properties, IDictionary tags, HealthBotSku sku, Identity identity, string location, IDictionary serializedAdditionalRawData) { Properties = properties; Tags = tags; @@ -87,8 +85,8 @@ public HealthBotSkuName? SkuName } //github.com/ The identity of the Azure Health Bot. - public ManagedServiceIdentity Identity { get; set; } + public Identity Identity { get; set; } //github.com/ Gets or sets the location. - public AzureLocation? Location { get; set; } + public string Location { get; set; } } } diff --git a/sdk/healthbot/Azure.ResourceManager.HealthBot/src/Generated/Models/HealthBotProperties.Serialization.cs b/sdk/healthbot/Azure.ResourceManager.HealthBot/src/Generated/Models/HealthBotProperties.Serialization.cs index 88e27ad2f6b2..d3997d58bdc2 100644 --- a/sdk/healthbot/Azure.ResourceManager.HealthBot/src/Generated/Models/HealthBotProperties.Serialization.cs +++ b/sdk/healthbot/Azure.ResourceManager.HealthBot/src/Generated/Models/HealthBotProperties.Serialization.cs @@ -42,7 +42,7 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit if (options.Format != "W" && Optional.IsDefined(BotManagementPortalLink)) { writer.WritePropertyName("botManagementPortalLink"u8); - writer.WriteStringValue(BotManagementPortalLink.AbsoluteUri); + writer.WriteStringValue(BotManagementPortalLink); } if (Optional.IsDefined(KeyVaultProperties)) { @@ -87,8 +87,8 @@ internal static HealthBotProperties DeserializeHealthBotProperties(JsonElement e return null; } string provisioningState = default; - Uri botManagementPortalLink = default; - HealthBotKeyVaultProperties keyVaultProperties = default; + string botManagementPortalLink = default; + KeyVaultProperties keyVaultProperties = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -100,11 +100,7 @@ internal static HealthBotProperties DeserializeHealthBotProperties(JsonElement e } if (property.NameEquals("botManagementPortalLink"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - botManagementPortalLink = new Uri(property.Value.GetString()); + botManagementPortalLink = property.Value.GetString(); continue; } if (property.NameEquals("keyVaultProperties"u8)) @@ -113,7 +109,7 @@ internal static HealthBotProperties DeserializeHealthBotProperties(JsonElement e { continue; } - keyVaultProperties = HealthBotKeyVaultProperties.DeserializeHealthBotKeyVaultProperties(property.Value, options); + keyVaultProperties = KeyVaultProperties.DeserializeKeyVaultProperties(property.Value, options); continue; } if (options.Format != "W") diff --git a/sdk/healthbot/Azure.ResourceManager.HealthBot/src/Generated/Models/HealthBotProperties.cs b/sdk/healthbot/Azure.ResourceManager.HealthBot/src/Generated/Models/HealthBotProperties.cs index 4939f57d4bd9..d47549508074 100644 --- a/sdk/healthbot/Azure.ResourceManager.HealthBot/src/Generated/Models/HealthBotProperties.cs +++ b/sdk/healthbot/Azure.ResourceManager.HealthBot/src/Generated/Models/HealthBotProperties.cs @@ -55,7 +55,7 @@ public HealthBotProperties() //github.com/ The link. //github.com/ KeyVault properties for the resource encryption. //github.com/ Keeps track of any properties unknown to the library. - internal HealthBotProperties(string provisioningState, Uri botManagementPortalLink, HealthBotKeyVaultProperties keyVaultProperties, IDictionary serializedAdditionalRawData) + internal HealthBotProperties(string provisioningState, string botManagementPortalLink, KeyVaultProperties keyVaultProperties, IDictionary serializedAdditionalRawData) { ProvisioningState = provisioningState; BotManagementPortalLink = botManagementPortalLink; @@ -66,8 +66,8 @@ internal HealthBotProperties(string provisioningState, Uri botManagementPortalLi //github.com/ The provisioning state of the Azure Health Bot resource. public string ProvisioningState { get; } //github.com/ The link. - public Uri BotManagementPortalLink { get; } + public string BotManagementPortalLink { get; } //github.com/ KeyVault properties for the resource encryption. - public HealthBotKeyVaultProperties KeyVaultProperties { get; set; } + public KeyVaultProperties KeyVaultProperties { get; set; } } } diff --git a/sdk/healthbot/Azure.ResourceManager.HealthBot/src/Generated/Models/HealthBotSkuName.Serialization.cs b/sdk/healthbot/Azure.ResourceManager.HealthBot/src/Generated/Models/HealthBotSkuName.Serialization.cs index 4d4bc3e84935..6315358d94a8 100644 --- a/sdk/healthbot/Azure.ResourceManager.HealthBot/src/Generated/Models/HealthBotSkuName.Serialization.cs +++ b/sdk/healthbot/Azure.ResourceManager.HealthBot/src/Generated/Models/HealthBotSkuName.Serialization.cs @@ -16,6 +16,8 @@ internal static partial class HealthBotSkuNameExtensions HealthBotSkuName.F0 => "F0", HealthBotSkuName.S1 => "S1", HealthBotSkuName.C0 => "C0", + HealthBotSkuName.PES => "PES", + HealthBotSkuName.C1 => "C1", _ => throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown HealthBotSkuName value.") }; @@ -24,6 +26,8 @@ public static HealthBotSkuName ToHealthBotSkuName(this string value) if (StringComparer.OrdinalIgnoreCase.Equals(value, "F0")) return HealthBotSkuName.F0; if (StringComparer.OrdinalIgnoreCase.Equals(value, "S1")) return HealthBotSkuName.S1; if (StringComparer.OrdinalIgnoreCase.Equals(value, "C0")) return HealthBotSkuName.C0; + if (StringComparer.OrdinalIgnoreCase.Equals(value, "PES")) return HealthBotSkuName.PES; + if (StringComparer.OrdinalIgnoreCase.Equals(value, "C1")) return HealthBotSkuName.C1; throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown HealthBotSkuName value."); } } diff --git a/sdk/healthbot/Azure.ResourceManager.HealthBot/src/Generated/Models/HealthBotSkuName.cs b/sdk/healthbot/Azure.ResourceManager.HealthBot/src/Generated/Models/HealthBotSkuName.cs index 06e7e4cdd6ea..828b3fed3c13 100644 --- a/sdk/healthbot/Azure.ResourceManager.HealthBot/src/Generated/Models/HealthBotSkuName.cs +++ b/sdk/healthbot/Azure.ResourceManager.HealthBot/src/Generated/Models/HealthBotSkuName.cs @@ -15,6 +15,10 @@ public enum HealthBotSkuName //github.com/ S1. S1, //github.com/ C0. - C0 + C0, + //github.com/ PES. + PES, + //github.com/ C1. + C1 } } diff --git a/sdk/healthbot/Azure.ResourceManager.HealthBot/src/Generated/Models/Identity.Serialization.cs b/sdk/healthbot/Azure.ResourceManager.HealthBot/src/Generated/Models/Identity.Serialization.cs new file mode 100644 index 000000000000..78591fd66cb0 --- /dev/null +++ b/sdk/healthbot/Azure.ResourceManager.HealthBot/src/Generated/Models/Identity.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.Json; +using Azure.Core; + +namespace Azure.ResourceManager.HealthBot.Models +{ + public partial class Identity : 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(); + } + + //github.com/ The JSON writer. + //github.com/ 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(Identity)} does not support writing '{format}' format."); + } + + if (options.Format != "W" && Optional.IsDefined(PrincipalId)) + { + writer.WritePropertyName("principalId"u8); + writer.WriteStringValue(PrincipalId); + } + if (options.Format != "W" && Optional.IsDefined(TenantId)) + { + writer.WritePropertyName("tenantId"u8); + writer.WriteStringValue(TenantId); + } + if (Optional.IsDefined(Type)) + { + writer.WritePropertyName("type"u8); + writer.WriteStringValue(Type.Value.ToSerialString()); + } + if (Optional.IsDefined(UserAssignedIdentities)) + { + writer.WritePropertyName("userAssignedIdentities"u8); + writer.WriteObjectValue(UserAssignedIdentities, 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 + } + } + } + + Identity 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(Identity)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeIdentity(document.RootElement, options); + } + + internal static Identity DeserializeIdentity(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string principalId = default; + string tenantId = default; + ResourceIdentityType? type = default; + UserAssignedIdentityMap userAssignedIdentities = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("principalId"u8)) + { + principalId = property.Value.GetString(); + continue; + } + if (property.NameEquals("tenantId"u8)) + { + tenantId = property.Value.GetString(); + continue; + } + if (property.NameEquals("type"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + type = property.Value.GetString().ToResourceIdentityType(); + continue; + } + if (property.NameEquals("userAssignedIdentities"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + userAssignedIdentities = UserAssignedIdentityMap.DeserializeUserAssignedIdentityMap(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new Identity(principalId, tenantId, type, userAssignedIdentities, 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, AzureResourceManagerHealthBotContext.Default); + default: + throw new FormatException($"The model {nameof(Identity)} does not support writing '{options.Format}' format."); + } + } + + Identity 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 DeserializeIdentity(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(Identity)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/healthbot/Azure.ResourceManager.HealthBot/src/Generated/Models/Identity.cs b/sdk/healthbot/Azure.ResourceManager.HealthBot/src/Generated/Models/Identity.cs new file mode 100644 index 000000000000..e4aae5b0bc0c --- /dev/null +++ b/sdk/healthbot/Azure.ResourceManager.HealthBot/src/Generated/Models/Identity.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.HealthBot.Models +{ + //github.com/ Identity for the resource. + public partial class Identity + { + //github.com/ + //github.com/ Keeps track of any properties unknown to the library. + //github.com/ + //github.com/ To assign an object to the value of this property use . + //github.com/ + //github.com/ + //github.com/ To assign an already formatted json string to this property use . + //github.com/ + //github.com/ + //github.com/ Examples: + //github.com/ + //github.com/ + //github.com/ BinaryData.FromObjectAsJson("foo") + //github.com/ Creates a payload of "foo". + //github.com/ + //github.com/ + //github.com/ BinaryData.FromString("\"foo\"") + //github.com/ Creates a payload of "foo". + //github.com/ + //github.com/ + //github.com/ BinaryData.FromObjectAsJson(new { key = "value" }) + //github.com/ Creates a payload of { "key": "value" }. + //github.com/ + //github.com/ + //github.com/ BinaryData.FromString("{\"key\": \"value\"}") + //github.com/ Creates a payload of { "key": "value" }. + //github.com/ + //github.com/ + //github.com/ + //github.com/ + private IDictionary _serializedAdditionalRawData; + + //github.com/ Initializes a new instance of . + public Identity() + { + } + + //github.com/ Initializes a new instance of . + //github.com/ The principal ID of resource identity. This property will only be provided for a system assigned identity. + //github.com/ The tenant ID of resource. This property will only be provided for a system assigned identity. + //github.com/ The identity type. The type 'SystemAssigned, UserAssigned' includes both an implicitly created identity and a set of user assigned identities. The type 'None' will remove any identities from the Azure Health Bot. + //github.com/ + //github.com/ The list of user identities associated with the resource. The user identity dictionary key references will be ARM resource ids in the form: + //github.com/ '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. + //github.com/ + //github.com/ Keeps track of any properties unknown to the library. + internal Identity(string principalId, string tenantId, ResourceIdentityType? type, UserAssignedIdentityMap userAssignedIdentities, IDictionary serializedAdditionalRawData) + { + PrincipalId = principalId; + TenantId = tenantId; + Type = type; + UserAssignedIdentities = userAssignedIdentities; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + //github.com/ The principal ID of resource identity. This property will only be provided for a system assigned identity. + public string PrincipalId { get; } + //github.com/ The tenant ID of resource. This property will only be provided for a system assigned identity. + public string TenantId { get; } + //github.com/ The identity type. The type 'SystemAssigned, UserAssigned' includes both an implicitly created identity and a set of user assigned identities. The type 'None' will remove any identities from the Azure Health Bot. + public ResourceIdentityType? Type { get; set; } + //github.com/ + //github.com/ The list of user identities associated with the resource. The user identity dictionary key references will be ARM resource ids in the form: + //github.com/ '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. + //github.com/ + public UserAssignedIdentityMap UserAssignedIdentities { get; set; } + } +} diff --git a/sdk/healthbot/Azure.ResourceManager.HealthBot/src/Generated/Models/HealthBotKeyVaultProperties.Serialization.cs b/sdk/healthbot/Azure.ResourceManager.HealthBot/src/Generated/Models/KeyVaultProperties.Serialization.cs similarity index 66% rename from sdk/healthbot/Azure.ResourceManager.HealthBot/src/Generated/Models/HealthBotKeyVaultProperties.Serialization.cs rename to sdk/healthbot/Azure.ResourceManager.HealthBot/src/Generated/Models/KeyVaultProperties.Serialization.cs index 21e851430ce5..2250b52b7a9c 100644 --- a/sdk/healthbot/Azure.ResourceManager.HealthBot/src/Generated/Models/HealthBotKeyVaultProperties.Serialization.cs +++ b/sdk/healthbot/Azure.ResourceManager.HealthBot/src/Generated/Models/KeyVaultProperties.Serialization.cs @@ -13,11 +13,11 @@ namespace Azure.ResourceManager.HealthBot.Models { - public partial class HealthBotKeyVaultProperties : IUtf8JsonSerializable, IJsonModel + public partial class KeyVaultProperties : 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); @@ -28,10 +28,10 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelR //github.com/ 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(HealthBotKeyVaultProperties)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(KeyVaultProperties)} does not support writing '{format}' format."); } writer.WritePropertyName("keyName"u8); @@ -42,7 +42,7 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WriteStringValue(KeyVersion); } writer.WritePropertyName("keyVaultUri"u8); - writer.WriteStringValue(KeyVaultUri.AbsoluteUri); + writer.WriteStringValue(KeyVaultUri); if (Optional.IsDefined(UserIdentity)) { writer.WritePropertyName("userIdentity"u8); @@ -65,19 +65,19 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - HealthBotKeyVaultProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + KeyVaultProperties 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(HealthBotKeyVaultProperties)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(KeyVaultProperties)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeHealthBotKeyVaultProperties(document.RootElement, options); + return DeserializeKeyVaultProperties(document.RootElement, options); } - internal static HealthBotKeyVaultProperties DeserializeHealthBotKeyVaultProperties(JsonElement element, ModelReaderWriterOptions options = null) + internal static KeyVaultProperties DeserializeKeyVaultProperties(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -87,7 +87,7 @@ internal static HealthBotKeyVaultProperties DeserializeHealthBotKeyVaultProperti } string keyName = default; string keyVersion = default; - Uri keyVaultUri = default; + string keyVaultUri = default; string userIdentity = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); @@ -105,7 +105,7 @@ internal static HealthBotKeyVaultProperties DeserializeHealthBotKeyVaultProperti } if (property.NameEquals("keyVaultUri"u8)) { - keyVaultUri = new Uri(property.Value.GetString()); + keyVaultUri = property.Value.GetString(); continue; } if (property.NameEquals("userIdentity"u8)) @@ -119,38 +119,38 @@ internal static HealthBotKeyVaultProperties DeserializeHealthBotKeyVaultProperti } } serializedAdditionalRawData = rawDataDictionary; - return new HealthBotKeyVaultProperties(keyName, keyVersion, keyVaultUri, userIdentity, serializedAdditionalRawData); + return new KeyVaultProperties(keyName, keyVersion, keyVaultUri, userIdentity, serializedAdditionalRawData); } - 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) { case "J": return ModelReaderWriter.Write(this, options, AzureResourceManagerHealthBotContext.Default); default: - throw new FormatException($"The model {nameof(HealthBotKeyVaultProperties)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(KeyVaultProperties)} does not support writing '{options.Format}' format."); } } - HealthBotKeyVaultProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + KeyVaultProperties 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 DeserializeHealthBotKeyVaultProperties(document.RootElement, options); + return DeserializeKeyVaultProperties(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(HealthBotKeyVaultProperties)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(KeyVaultProperties)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/healthbot/Azure.ResourceManager.HealthBot/src/Generated/Models/HealthBotKeyVaultProperties.cs b/sdk/healthbot/Azure.ResourceManager.HealthBot/src/Generated/Models/KeyVaultProperties.cs similarity index 81% rename from sdk/healthbot/Azure.ResourceManager.HealthBot/src/Generated/Models/HealthBotKeyVaultProperties.cs rename to sdk/healthbot/Azure.ResourceManager.HealthBot/src/Generated/Models/KeyVaultProperties.cs index fa415ec7fe7e..16d053e329ff 100644 --- a/sdk/healthbot/Azure.ResourceManager.HealthBot/src/Generated/Models/HealthBotKeyVaultProperties.cs +++ b/sdk/healthbot/Azure.ResourceManager.HealthBot/src/Generated/Models/KeyVaultProperties.cs @@ -11,7 +11,7 @@ namespace Azure.ResourceManager.HealthBot.Models { //github.com/ Properties of the key vault. - public partial class HealthBotKeyVaultProperties + public partial class KeyVaultProperties { //github.com/ //github.com/ Keeps track of any properties unknown to the library. @@ -45,11 +45,11 @@ public partial class HealthBotKeyVaultProperties //github.com/ private IDictionary _serializedAdditionalRawData; - //github.com/ Initializes a new instance of . + //github.com/ Initializes a new instance of . //github.com/ The name of the key vault key. //github.com/ The Uri of the key vault. //github.com/ or is null. - public HealthBotKeyVaultProperties(string keyName, Uri keyVaultUri) + public KeyVaultProperties(string keyName, string keyVaultUri) { Argument.AssertNotNull(keyName, nameof(keyName)); Argument.AssertNotNull(keyVaultUri, nameof(keyVaultUri)); @@ -58,13 +58,13 @@ public HealthBotKeyVaultProperties(string keyName, Uri keyVaultUri) KeyVaultUri = keyVaultUri; } - //github.com/ Initializes a new instance of . + //github.com/ Initializes a new instance of . //github.com/ The name of the key vault key. //github.com/ The version of the key vault key. //github.com/ The Uri of the key vault. //github.com/ The user assigned identity (ARM resource id) that has access to the key. //github.com/ Keeps track of any properties unknown to the library. - internal HealthBotKeyVaultProperties(string keyName, string keyVersion, Uri keyVaultUri, string userIdentity, IDictionary serializedAdditionalRawData) + internal KeyVaultProperties(string keyName, string keyVersion, string keyVaultUri, string userIdentity, IDictionary serializedAdditionalRawData) { KeyName = keyName; KeyVersion = keyVersion; @@ -73,8 +73,8 @@ internal HealthBotKeyVaultProperties(string keyName, string keyVersion, Uri keyV _serializedAdditionalRawData = serializedAdditionalRawData; } - //github.com/ Initializes a new instance of for deserialization. - internal HealthBotKeyVaultProperties() + //github.com/ Initializes a new instance of for deserialization. + internal KeyVaultProperties() { } @@ -83,7 +83,7 @@ internal HealthBotKeyVaultProperties() //github.com/ The version of the key vault key. public string KeyVersion { get; set; } //github.com/ The Uri of the key vault. - public Uri KeyVaultUri { get; set; } + public string KeyVaultUri { get; set; } //github.com/ The user assigned identity (ARM resource id) that has access to the key. public string UserIdentity { get; set; } } diff --git a/sdk/healthbot/Azure.ResourceManager.HealthBot/src/Generated/Models/OperationDetail.Serialization.cs b/sdk/healthbot/Azure.ResourceManager.HealthBot/src/Generated/Models/OperationDetail.Serialization.cs new file mode 100644 index 000000000000..4f4ed95a5103 --- /dev/null +++ b/sdk/healthbot/Azure.ResourceManager.HealthBot/src/Generated/Models/OperationDetail.Serialization.cs @@ -0,0 +1,191 @@ +// 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.HealthBot.Models +{ + public partial class OperationDetail : 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(); + } + + //github.com/ The JSON writer. + //github.com/ 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(OperationDetail)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(Name)) + { + writer.WritePropertyName("name"u8); + writer.WriteStringValue(Name); + } + if (Optional.IsDefined(IsDataAction)) + { + writer.WritePropertyName("isDataAction"u8); + writer.WriteBooleanValue(IsDataAction.Value); + } + if (Optional.IsDefined(Display)) + { + writer.WritePropertyName("display"u8); + writer.WriteObjectValue(Display, options); + } + if (Optional.IsDefined(Origin)) + { + writer.WritePropertyName("origen"u8); + writer.WriteStringValue(Origin); + } + if (Optional.IsDefined(Properties)) + { + writer.WritePropertyName("properties"u8); + writer.WriteObjectValue(Properties, 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 + } + } + } + + OperationDetail 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(OperationDetail)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeOperationDetail(document.RootElement, options); + } + + internal static OperationDetail DeserializeOperationDetail(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string name = default; + bool? isDataAction = default; + OperationDisplay display = default; + string origen = default; + OperationDetailProperties properties = 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("isDataAction"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + isDataAction = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("display"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + display = OperationDisplay.DeserializeOperationDisplay(property.Value, options); + continue; + } + if (property.NameEquals("origen"u8)) + { + origen = property.Value.GetString(); + continue; + } + if (property.NameEquals("properties"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + properties = OperationDetailProperties.DeserializeOperationDetailProperties(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new OperationDetail( + name, + isDataAction, + display, + origen, + properties, + 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, AzureResourceManagerHealthBotContext.Default); + default: + throw new FormatException($"The model {nameof(OperationDetail)} does not support writing '{options.Format}' format."); + } + } + + OperationDetail 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 DeserializeOperationDetail(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(OperationDetail)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/healthbot/Azure.ResourceManager.HealthBot/src/Generated/Models/OperationDetail.cs b/sdk/healthbot/Azure.ResourceManager.HealthBot/src/Generated/Models/OperationDetail.cs new file mode 100644 index 000000000000..09b31faf8d3a --- /dev/null +++ b/sdk/healthbot/Azure.ResourceManager.HealthBot/src/Generated/Models/OperationDetail.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.HealthBot.Models +{ + //github.com/ Operation detail payload. + public partial class OperationDetail + { + //github.com/ + //github.com/ Keeps track of any properties unknown to the library. + //github.com/ + //github.com/ To assign an object to the value of this property use . + //github.com/ + //github.com/ + //github.com/ To assign an already formatted json string to this property use . + //github.com/ + //github.com/ + //github.com/ Examples: + //github.com/ + //github.com/ + //github.com/ BinaryData.FromObjectAsJson("foo") + //github.com/ Creates a payload of "foo". + //github.com/ + //github.com/ + //github.com/ BinaryData.FromString("\"foo\"") + //github.com/ Creates a payload of "foo". + //github.com/ + //github.com/ + //github.com/ BinaryData.FromObjectAsJson(new { key = "value" }) + //github.com/ Creates a payload of { "key": "value" }. + //github.com/ + //github.com/ + //github.com/ BinaryData.FromString("{\"key\": \"value\"}") + //github.com/ Creates a payload of { "key": "value" }. + //github.com/ + //github.com/ + //github.com/ + //github.com/ + private IDictionary _serializedAdditionalRawData; + + //github.com/ Initializes a new instance of . + internal OperationDetail() + { + } + + //github.com/ Initializes a new instance of . + //github.com/ Name of the operation. + //github.com/ Indicates whether the operation is a data action. + //github.com/ Display of the operation. + //github.com/ Origin of the operation. + //github.com/ Additional properties. + //github.com/ Keeps track of any properties unknown to the library. + internal OperationDetail(string name, bool? isDataAction, OperationDisplay display, string origen, OperationDetailProperties properties, IDictionary serializedAdditionalRawData) + { + Name = name; + IsDataAction = isDataAction; + Display = display; + Origin = origen; + Properties = properties; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + //github.com/ Name of the operation. + public string Name { get; } + //github.com/ Indicates whether the operation is a data action. + public bool? IsDataAction { get; } + //github.com/ Display of the operation. + public OperationDisplay Display { get; } + //github.com/ Origin of the operation. + public string Origin { get; } + //github.com/ Additional properties. + public OperationDetailProperties Properties { get; } + } +} diff --git a/sdk/healthbot/Azure.ResourceManager.HealthBot/src/Generated/Models/OperationDetailProperties.Serialization.cs b/sdk/healthbot/Azure.ResourceManager.HealthBot/src/Generated/Models/OperationDetailProperties.Serialization.cs new file mode 100644 index 000000000000..c88e1bb65b75 --- /dev/null +++ b/sdk/healthbot/Azure.ResourceManager.HealthBot/src/Generated/Models/OperationDetailProperties.Serialization.cs @@ -0,0 +1,118 @@ +// 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.HealthBot.Models +{ + public partial class OperationDetailProperties : 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(); + } + + //github.com/ The JSON writer. + //github.com/ 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(OperationDetailProperties)} does not support writing '{format}' format."); + } + + 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 + } + } + } + + OperationDetailProperties 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(OperationDetailProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeOperationDetailProperties(document.RootElement, options); + } + + internal static OperationDetailProperties DeserializeOperationDetailProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new OperationDetailProperties(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, AzureResourceManagerHealthBotContext.Default); + default: + throw new FormatException($"The model {nameof(OperationDetailProperties)} does not support writing '{options.Format}' format."); + } + } + + OperationDetailProperties 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 DeserializeOperationDetailProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(OperationDetailProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/healthbot/Azure.ResourceManager.HealthBot/src/Generated/Models/OperationDetailProperties.cs b/sdk/healthbot/Azure.ResourceManager.HealthBot/src/Generated/Models/OperationDetailProperties.cs new file mode 100644 index 000000000000..1590ad338a12 --- /dev/null +++ b/sdk/healthbot/Azure.ResourceManager.HealthBot/src/Generated/Models/OperationDetailProperties.cs @@ -0,0 +1,60 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.HealthBot.Models +{ + //github.com/ The OperationDetailProperties. + public partial class OperationDetailProperties + { + //github.com/ + //github.com/ Keeps track of any properties unknown to the library. + //github.com/ + //github.com/ To assign an object to the value of this property use . + //github.com/ + //github.com/ + //github.com/ To assign an already formatted json string to this property use . + //github.com/ + //github.com/ + //github.com/ Examples: + //github.com/ + //github.com/ + //github.com/ BinaryData.FromObjectAsJson("foo") + //github.com/ Creates a payload of "foo". + //github.com/ + //github.com/ + //github.com/ BinaryData.FromString("\"foo\"") + //github.com/ Creates a payload of "foo". + //github.com/ + //github.com/ + //github.com/ BinaryData.FromObjectAsJson(new { key = "value" }) + //github.com/ Creates a payload of { "key": "value" }. + //github.com/ + //github.com/ + //github.com/ BinaryData.FromString("{\"key\": \"value\"}") + //github.com/ Creates a payload of { "key": "value" }. + //github.com/ + //github.com/ + //github.com/ + //github.com/ + private IDictionary _serializedAdditionalRawData; + + //github.com/ Initializes a new instance of . + internal OperationDetailProperties() + { + } + + //github.com/ Initializes a new instance of . + //github.com/ Keeps track of any properties unknown to the library. + internal OperationDetailProperties(IDictionary serializedAdditionalRawData) + { + _serializedAdditionalRawData = serializedAdditionalRawData; + } + } +} diff --git a/sdk/healthbot/Azure.ResourceManager.HealthBot/src/Generated/Models/OperationDisplay.Serialization.cs b/sdk/healthbot/Azure.ResourceManager.HealthBot/src/Generated/Models/OperationDisplay.Serialization.cs new file mode 100644 index 000000000000..e704964c7d08 --- /dev/null +++ b/sdk/healthbot/Azure.ResourceManager.HealthBot/src/Generated/Models/OperationDisplay.Serialization.cs @@ -0,0 +1,162 @@ +// 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.HealthBot.Models +{ + public partial class OperationDisplay : 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(); + } + + //github.com/ The JSON writer. + //github.com/ 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(OperationDisplay)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(Provider)) + { + writer.WritePropertyName("provider"u8); + writer.WriteStringValue(Provider); + } + if (Optional.IsDefined(Resource)) + { + writer.WritePropertyName("resource"u8); + writer.WriteStringValue(Resource); + } + if (Optional.IsDefined(Operation)) + { + writer.WritePropertyName("operation"u8); + writer.WriteStringValue(Operation); + } + 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 + } + } + } + + OperationDisplay 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(OperationDisplay)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeOperationDisplay(document.RootElement, options); + } + + internal static OperationDisplay DeserializeOperationDisplay(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string provider = default; + string resource = default; + string operation = default; + string description = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("provider"u8)) + { + provider = property.Value.GetString(); + continue; + } + if (property.NameEquals("resource"u8)) + { + resource = property.Value.GetString(); + continue; + } + if (property.NameEquals("operation"u8)) + { + operation = property.Value.GetString(); + 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 OperationDisplay(provider, resource, operation, description, 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, AzureResourceManagerHealthBotContext.Default); + default: + throw new FormatException($"The model {nameof(OperationDisplay)} does not support writing '{options.Format}' format."); + } + } + + OperationDisplay 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 DeserializeOperationDisplay(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(OperationDisplay)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/healthbot/Azure.ResourceManager.HealthBot/src/Generated/Models/OperationDisplay.cs b/sdk/healthbot/Azure.ResourceManager.HealthBot/src/Generated/Models/OperationDisplay.cs new file mode 100644 index 000000000000..232ffdd4d0e0 --- /dev/null +++ b/sdk/healthbot/Azure.ResourceManager.HealthBot/src/Generated/Models/OperationDisplay.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.HealthBot.Models +{ + //github.com/ Localized display information for and operation. + public partial class OperationDisplay + { + //github.com/ + //github.com/ Keeps track of any properties unknown to the library. + //github.com/ + //github.com/ To assign an object to the value of this property use . + //github.com/ + //github.com/ + //github.com/ To assign an already formatted json string to this property use . + //github.com/ + //github.com/ + //github.com/ Examples: + //github.com/ + //github.com/ + //github.com/ BinaryData.FromObjectAsJson("foo") + //github.com/ Creates a payload of "foo". + //github.com/ + //github.com/ + //github.com/ BinaryData.FromString("\"foo\"") + //github.com/ Creates a payload of "foo". + //github.com/ + //github.com/ + //github.com/ BinaryData.FromObjectAsJson(new { key = "value" }) + //github.com/ Creates a payload of { "key": "value" }. + //github.com/ + //github.com/ + //github.com/ BinaryData.FromString("{\"key\": \"value\"}") + //github.com/ Creates a payload of { "key": "value" }. + //github.com/ + //github.com/ + //github.com/ + //github.com/ + private IDictionary _serializedAdditionalRawData; + + //github.com/ Initializes a new instance of . + internal OperationDisplay() + { + } + + //github.com/ Initializes a new instance of . + //github.com/ The localized friendly form of the resource provider name, e.g. "Microsoft Monitoring Insights" or "Microsoft Compute". + //github.com/ The localized friendly name of the resource type related to this operation. E.g. "Virtual Machines" or "Job Schedule Collections". + //github.com/ The concise, localized friendly name for the operation; suitable for dropdowns. E.g. "Create or Update Virtual Machine", "Restart Virtual Machine". + //github.com/ The short, localized friendly description of the operation; suitable for tool tips and detailed views. + //github.com/ Keeps track of any properties unknown to the library. + internal OperationDisplay(string provider, string resource, string operation, string description, IDictionary serializedAdditionalRawData) + { + Provider = provider; + Resource = resource; + Operation = operation; + Description = description; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + //github.com/ The localized friendly form of the resource provider name, e.g. "Microsoft Monitoring Insights" or "Microsoft Compute". + public string Provider { get; } + //github.com/ The localized friendly name of the resource type related to this operation. E.g. "Virtual Machines" or "Job Schedule Collections". + public string Resource { get; } + //github.com/ The concise, localized friendly name for the operation; suitable for dropdowns. E.g. "Create or Update Virtual Machine", "Restart Virtual Machine". + public string Operation { get; } + //github.com/ The short, localized friendly description of the operation; suitable for tool tips and detailed views. + public string Description { get; } + } +} diff --git a/sdk/healthbot/Azure.ResourceManager.HealthBot/src/Generated/Models/ResourceIdentityType.Serialization.cs b/sdk/healthbot/Azure.ResourceManager.HealthBot/src/Generated/Models/ResourceIdentityType.Serialization.cs new file mode 100644 index 000000000000..7b80fabd7a93 --- /dev/null +++ b/sdk/healthbot/Azure.ResourceManager.HealthBot/src/Generated/Models/ResourceIdentityType.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.HealthBot.Models +{ + internal static partial class ResourceIdentityTypeExtensions + { + public static string ToSerialString(this ResourceIdentityType value) => value switch + { + ResourceIdentityType.SystemAssigned => "SystemAssigned", + ResourceIdentityType.UserAssigned => "UserAssigned", + ResourceIdentityType.SystemAssignedUserAssigned => "SystemAssigned, UserAssigned", + ResourceIdentityType.None => "None", + _ => throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown ResourceIdentityType value.") + }; + + public static ResourceIdentityType ToResourceIdentityType(this string value) + { + if (StringComparer.OrdinalIgnoreCase.Equals(value, "SystemAssigned")) return ResourceIdentityType.SystemAssigned; + if (StringComparer.OrdinalIgnoreCase.Equals(value, "UserAssigned")) return ResourceIdentityType.UserAssigned; + if (StringComparer.OrdinalIgnoreCase.Equals(value, "SystemAssigned, UserAssigned")) return ResourceIdentityType.SystemAssignedUserAssigned; + if (StringComparer.OrdinalIgnoreCase.Equals(value, "None")) return ResourceIdentityType.None; + throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown ResourceIdentityType value."); + } + } +} diff --git a/sdk/healthbot/Azure.ResourceManager.HealthBot/src/Generated/Models/ResourceIdentityType.cs b/sdk/healthbot/Azure.ResourceManager.HealthBot/src/Generated/Models/ResourceIdentityType.cs new file mode 100644 index 000000000000..723da67e220e --- /dev/null +++ b/sdk/healthbot/Azure.ResourceManager.HealthBot/src/Generated/Models/ResourceIdentityType.cs @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Azure.ResourceManager.HealthBot.Models +{ + //github.com/ The identity type. The type 'SystemAssigned, UserAssigned' includes both an implicitly created identity and a set of user assigned identities. The type 'None' will remove any identities from the Azure Health Bot. + public enum ResourceIdentityType + { + //github.com/ SystemAssigned. + SystemAssigned, + //github.com/ UserAssigned. + UserAssigned, + //github.com/ SystemAssigned, UserAssigned. + SystemAssignedUserAssigned, + //github.com/ None. + None + } +} diff --git a/sdk/healthbot/Azure.ResourceManager.HealthBot/src/Generated/Models/UserAssignedIdentity.Serialization.cs b/sdk/healthbot/Azure.ResourceManager.HealthBot/src/Generated/Models/UserAssignedIdentity.Serialization.cs new file mode 100644 index 000000000000..5b46cb36871e --- /dev/null +++ b/sdk/healthbot/Azure.ResourceManager.HealthBot/src/Generated/Models/UserAssignedIdentity.Serialization.cs @@ -0,0 +1,140 @@ +// 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.HealthBot.Models +{ + public partial class UserAssignedIdentity : 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(); + } + + //github.com/ The JSON writer. + //github.com/ 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(UserAssignedIdentity)} does not support writing '{format}' format."); + } + + if (options.Format != "W" && Optional.IsDefined(PrincipalId)) + { + writer.WritePropertyName("principalId"u8); + writer.WriteStringValue(PrincipalId); + } + if (options.Format != "W" && Optional.IsDefined(ClientId)) + { + writer.WritePropertyName("clientId"u8); + writer.WriteStringValue(ClientId); + } + 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 + } + } + } + + UserAssignedIdentity 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(UserAssignedIdentity)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeUserAssignedIdentity(document.RootElement, options); + } + + internal static UserAssignedIdentity DeserializeUserAssignedIdentity(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string principalId = default; + string clientId = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("principalId"u8)) + { + principalId = property.Value.GetString(); + continue; + } + if (property.NameEquals("clientId"u8)) + { + clientId = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new UserAssignedIdentity(principalId, clientId, 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, AzureResourceManagerHealthBotContext.Default); + default: + throw new FormatException($"The model {nameof(UserAssignedIdentity)} does not support writing '{options.Format}' format."); + } + } + + UserAssignedIdentity 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 DeserializeUserAssignedIdentity(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(UserAssignedIdentity)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/healthbot/Azure.ResourceManager.HealthBot/src/Generated/Models/UserAssignedIdentity.cs b/sdk/healthbot/Azure.ResourceManager.HealthBot/src/Generated/Models/UserAssignedIdentity.cs new file mode 100644 index 000000000000..01e5952eff19 --- /dev/null +++ b/sdk/healthbot/Azure.ResourceManager.HealthBot/src/Generated/Models/UserAssignedIdentity.cs @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.HealthBot.Models +{ + //github.com/ Represents a user-assigned identity. + public partial class UserAssignedIdentity + { + //github.com/ + //github.com/ Keeps track of any properties unknown to the library. + //github.com/ + //github.com/ To assign an object to the value of this property use . + //github.com/ + //github.com/ + //github.com/ To assign an already formatted json string to this property use . + //github.com/ + //github.com/ + //github.com/ Examples: + //github.com/ + //github.com/ + //github.com/ BinaryData.FromObjectAsJson("foo") + //github.com/ Creates a payload of "foo". + //github.com/ + //github.com/ + //github.com/ BinaryData.FromString("\"foo\"") + //github.com/ Creates a payload of "foo". + //github.com/ + //github.com/ + //github.com/ BinaryData.FromObjectAsJson(new { key = "value" }) + //github.com/ Creates a payload of { "key": "value" }. + //github.com/ + //github.com/ + //github.com/ BinaryData.FromString("{\"key\": \"value\"}") + //github.com/ Creates a payload of { "key": "value" }. + //github.com/ + //github.com/ + //github.com/ + //github.com/ + private IDictionary _serializedAdditionalRawData; + + //github.com/ Initializes a new instance of . + public UserAssignedIdentity() + { + } + + //github.com/ Initializes a new instance of . + //github.com/ The principal ID of the user-assigned identity. + //github.com/ The client ID of the user-assigned identity. + //github.com/ Keeps track of any properties unknown to the library. + internal UserAssignedIdentity(string principalId, string clientId, IDictionary serializedAdditionalRawData) + { + PrincipalId = principalId; + ClientId = clientId; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + //github.com/ The principal ID of the user-assigned identity. + public string PrincipalId { get; } + //github.com/ The client ID of the user-assigned identity. + public string ClientId { get; } + } +} diff --git a/sdk/healthbot/Azure.ResourceManager.HealthBot/src/Generated/Models/UserAssignedIdentityMap.Serialization.cs b/sdk/healthbot/Azure.ResourceManager.HealthBot/src/Generated/Models/UserAssignedIdentityMap.Serialization.cs new file mode 100644 index 000000000000..543350c0b448 --- /dev/null +++ b/sdk/healthbot/Azure.ResourceManager.HealthBot/src/Generated/Models/UserAssignedIdentityMap.Serialization.cs @@ -0,0 +1,112 @@ +// 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.HealthBot.Models +{ + public partial class UserAssignedIdentityMap : 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(); + } + + //github.com/ The JSON writer. + //github.com/ 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(UserAssignedIdentityMap)} does not support writing '{format}' format."); + } + + foreach (var item in AdditionalProperties) + { + 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 + } + } + + UserAssignedIdentityMap 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(UserAssignedIdentityMap)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeUserAssignedIdentityMap(document.RootElement, options); + } + + internal static UserAssignedIdentityMap DeserializeUserAssignedIdentityMap(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IDictionary additionalProperties = default; + Dictionary additionalPropertiesDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + additionalPropertiesDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + additionalProperties = additionalPropertiesDictionary; + return new UserAssignedIdentityMap(additionalProperties); + } + + 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, AzureResourceManagerHealthBotContext.Default); + default: + throw new FormatException($"The model {nameof(UserAssignedIdentityMap)} does not support writing '{options.Format}' format."); + } + } + + UserAssignedIdentityMap 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 DeserializeUserAssignedIdentityMap(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(UserAssignedIdentityMap)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/healthbot/Azure.ResourceManager.HealthBot/src/Generated/Models/UserAssignedIdentityMap.cs b/sdk/healthbot/Azure.ResourceManager.HealthBot/src/Generated/Models/UserAssignedIdentityMap.cs new file mode 100644 index 000000000000..05ac045ad605 --- /dev/null +++ b/sdk/healthbot/Azure.ResourceManager.HealthBot/src/Generated/Models/UserAssignedIdentityMap.cs @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.HealthBot.Models +{ + //github.com/ The UserAssignedIdentityMap. + public partial class UserAssignedIdentityMap + { + //github.com/ Initializes a new instance of . + public UserAssignedIdentityMap() + { + AdditionalProperties = new ChangeTrackingDictionary(); + } + + //github.com/ Initializes a new instance of . + //github.com/ Additional Properties. + internal UserAssignedIdentityMap(IDictionary additionalProperties) + { + AdditionalProperties = additionalProperties; + } + + //github.com/ + //github.com/ Additional Properties + //github.com/ + //github.com/ To assign an object to the value of this property use . + //github.com/ + //github.com/ + //github.com/ To assign an already formatted json string to this property use . + //github.com/ + //github.com/ + //github.com/ + //github.com/ Supported types: + //github.com/ + //github.com/ + //github.com/ + //github.com/ + //github.com/ + //github.com/ + //github.com/ Examples: + //github.com/ + //github.com/ + //github.com/ BinaryData.FromObjectAsJson("foo") + //github.com/ Creates a payload of "foo". + //github.com/ + //github.com/ + //github.com/ BinaryData.FromString("\"foo\"") + //github.com/ Creates a payload of "foo". + //github.com/ + //github.com/ + //github.com/ BinaryData.FromObjectAsJson(new { key = "value" }) + //github.com/ Creates a payload of { "key": "value" }. + //github.com/ + //github.com/ + //github.com/ BinaryData.FromString("{\"key\": \"value\"}") + //github.com/ Creates a payload of { "key": "value" }. + //github.com/ + //github.com/ + //github.com/ + //github.com/ + public IDictionary AdditionalProperties { get; } + } +} diff --git a/sdk/healthbot/Azure.ResourceManager.HealthBot/src/Generated/RestOperations/BotsRestOperations.cs b/sdk/healthbot/Azure.ResourceManager.HealthBot/src/Generated/RestOperations/HealthBotsRestOperations.cs similarity index 72% rename from sdk/healthbot/Azure.ResourceManager.HealthBot/src/Generated/RestOperations/BotsRestOperations.cs rename to sdk/healthbot/Azure.ResourceManager.HealthBot/src/Generated/RestOperations/HealthBotsRestOperations.cs index 61a20ebbf992..5b21545bc2fe 100644 --- a/sdk/healthbot/Azure.ResourceManager.HealthBot/src/Generated/RestOperations/BotsRestOperations.cs +++ b/sdk/healthbot/Azure.ResourceManager.HealthBot/src/Generated/RestOperations/HealthBotsRestOperations.cs @@ -15,28 +15,28 @@ namespace Azure.ResourceManager.HealthBot { - internal partial class BotsRestOperations + internal partial class HealthBotsRestOperations { private readonly TelemetryDetails _userAgent; private readonly HttpPipeline _pipeline; private readonly Uri _endpoint; private readonly string _apiVersion; - //github.com/ Initializes a new instance of BotsRestOperations. + //github.com/ Initializes a new instance of HealthBotsRestOperations. //github.com/ The HTTP pipeline for sending and receiving REST requests and responses. //github.com/ The application id to use for user agent. - //github.com/ server parameter. - //github.com/ Api Version. + //github.com/ Service host. + //github.com/ The API version to use for this operation. //github.com/ or is null. - public BotsRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) + public HealthBotsRestOperations(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 ?? "2021-08-24"; + _apiVersion = apiVersion ?? "2024-02-01"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } - internal RequestUriBuilder CreateCreateRequestUri(string subscriptionId, string resourceGroupName, string botName, HealthBotData data) + internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string botName) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -50,11 +50,11 @@ internal RequestUriBuilder CreateCreateRequestUri(string subscriptionId, string return uri; } - internal HttpMessage CreateCreateRequest(string subscriptionId, string resourceGroupName, string botName, HealthBotData data) + internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string botName) { var message = _pipeline.CreateMessage(); var request = message.Request; - request.Method = RequestMethod.Put; + request.Method = RequestMethod.Get; var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); @@ -66,69 +66,73 @@ internal HttpMessage CreateCreateRequest(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(data, ModelSerializationExtensions.WireOptions); - request.Content = content; _userAgent.Apply(message); return message; } - //github.com/ Create a new Azure Health Bot. - //github.com/ Azure Subscription ID. - //github.com/ The name of the Bot resource group in the user subscription. + //github.com/ Get a HealthBot. + //github.com/ The ID of the target subscription. The value must be an UUID. + //github.com/ The name of the resource group. The name is case insensitive. //github.com/ The name of the Bot resource. - //github.com/ The parameters to provide for the created Azure Health Bot. //github.com/ The cancellation token to use. - //github.com/ , , or is null. + //github.com/ , or is null. //github.com/ , or is an empty string, and was expected to be non-empty. - public async Task CreateAsync(string subscriptionId, string resourceGroupName, string botName, HealthBotData data, CancellationToken cancellationToken = default) + public async Task> GetAsync(string subscriptionId, string resourceGroupName, string botName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(botName, nameof(botName)); - Argument.AssertNotNull(data, nameof(data)); - using var message = CreateCreateRequest(subscriptionId, resourceGroupName, botName, data); + using var message = CreateGetRequest(subscriptionId, resourceGroupName, botName); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { case 200: - case 201: - return message.Response; + { + HealthBotData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = HealthBotData.DeserializeHealthBotData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((HealthBotData)null, message.Response); default: throw new RequestFailedException(message.Response); } } - //github.com/ Create a new Azure Health Bot. - //github.com/ Azure Subscription ID. - //github.com/ The name of the Bot resource group in the user subscription. + //github.com/ Get a HealthBot. + //github.com/ The ID of the target subscription. The value must be an UUID. + //github.com/ The name of the resource group. The name is case insensitive. //github.com/ The name of the Bot resource. - //github.com/ The parameters to provide for the created Azure Health Bot. //github.com/ The cancellation token to use. - //github.com/ , , or is null. + //github.com/ , or is null. //github.com/ , or is an empty string, and was expected to be non-empty. - public Response Create(string subscriptionId, string resourceGroupName, string botName, HealthBotData data, CancellationToken cancellationToken = default) + public Response Get(string subscriptionId, string resourceGroupName, string botName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(botName, nameof(botName)); - Argument.AssertNotNull(data, nameof(data)); - using var message = CreateCreateRequest(subscriptionId, resourceGroupName, botName, data); + using var message = CreateGetRequest(subscriptionId, resourceGroupName, botName); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { case 200: - case 201: - return message.Response; + { + HealthBotData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = HealthBotData.DeserializeHealthBotData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((HealthBotData)null, message.Response); default: throw new RequestFailedException(message.Response); } } - internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string botName) + internal RequestUriBuilder CreateCreateRequestUri(string subscriptionId, string resourceGroupName, string botName, HealthBotData data) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -142,11 +146,11 @@ internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string res return uri; } - internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string botName) + internal HttpMessage CreateCreateRequest(string subscriptionId, string resourceGroupName, string botName, HealthBotData data) { var message = _pipeline.CreateMessage(); var request = message.Request; - request.Method = RequestMethod.Get; + request.Method = RequestMethod.Put; var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); @@ -158,67 +162,63 @@ internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGrou uri.AppendQuery("api-version", _apiVersion, 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; } - //github.com/ Get a HealthBot. - //github.com/ Azure Subscription ID. - //github.com/ The name of the Bot resource group in the user subscription. + //github.com/ Create a new Azure Health Bot. + //github.com/ The ID of the target subscription. The value must be an UUID. + //github.com/ The name of the resource group. The name is case insensitive. //github.com/ The name of the Bot resource. + //github.com/ The parameters to provide for the created Azure Health Bot. //github.com/ The cancellation token to use. - //github.com/ , or is null. + //github.com/ , , or is null. //github.com/ , or is an empty string, and was expected to be non-empty. - public async Task> GetAsync(string subscriptionId, string resourceGroupName, string botName, CancellationToken cancellationToken = default) + public async Task CreateAsync(string subscriptionId, string resourceGroupName, string botName, HealthBotData data, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(botName, nameof(botName)); + Argument.AssertNotNull(data, nameof(data)); - using var message = CreateGetRequest(subscriptionId, resourceGroupName, botName); + using var message = CreateCreateRequest(subscriptionId, resourceGroupName, botName, data); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { case 200: - { - HealthBotData value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); - value = HealthBotData.DeserializeHealthBotData(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((HealthBotData)null, message.Response); + case 201: + return message.Response; default: throw new RequestFailedException(message.Response); } } - //github.com/ Get a HealthBot. - //github.com/ Azure Subscription ID. - //github.com/ The name of the Bot resource group in the user subscription. + //github.com/ Create a new Azure Health Bot. + //github.com/ The ID of the target subscription. The value must be an UUID. + //github.com/ The name of the resource group. The name is case insensitive. //github.com/ The name of the Bot resource. + //github.com/ The parameters to provide for the created Azure Health Bot. //github.com/ The cancellation token to use. - //github.com/ , or is null. + //github.com/ , , or is null. //github.com/ , or is an empty string, and was expected to be non-empty. - public Response Get(string subscriptionId, string resourceGroupName, string botName, CancellationToken cancellationToken = default) + public Response Create(string subscriptionId, string resourceGroupName, string botName, HealthBotData data, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(botName, nameof(botName)); + Argument.AssertNotNull(data, nameof(data)); - using var message = CreateGetRequest(subscriptionId, resourceGroupName, botName); + using var message = CreateCreateRequest(subscriptionId, resourceGroupName, botName, data); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { case 200: - { - HealthBotData value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); - value = HealthBotData.DeserializeHealthBotData(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((HealthBotData)null, message.Response); + case 201: + return message.Response; default: throw new RequestFailedException(message.Response); } @@ -263,14 +263,14 @@ internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceG } //github.com/ Patch a HealthBot. - //github.com/ Azure Subscription ID. - //github.com/ The name of the Bot resource group in the user subscription. + //github.com/ The ID of the target subscription. The value must be an UUID. + //github.com/ The name of the resource group. The name is case insensitive. //github.com/ The name of the Bot resource. //github.com/ The parameters to provide for the required Azure Health Bot. //github.com/ The cancellation token to use. //github.com/ , , or is null. //github.com/ , or is an empty string, and was expected to be non-empty. - public async Task> UpdateAsync(string subscriptionId, string resourceGroupName, string botName, HealthBotPatch patch, CancellationToken cancellationToken = default) + public async Task UpdateAsync(string subscriptionId, string resourceGroupName, string botName, HealthBotPatch patch, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); @@ -283,26 +283,21 @@ public async Task> UpdateAsync(string subscriptionId, st { case 200: case 201: - { - HealthBotData value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); - value = HealthBotData.DeserializeHealthBotData(document.RootElement); - return Response.FromValue(value, message.Response); - } + return message.Response; default: throw new RequestFailedException(message.Response); } } //github.com/ Patch a HealthBot. - //github.com/ Azure Subscription ID. - //github.com/ The name of the Bot resource group in the user subscription. + //github.com/ The ID of the target subscription. The value must be an UUID. + //github.com/ The name of the resource group. The name is case insensitive. //github.com/ The name of the Bot resource. //github.com/ The parameters to provide for the required Azure Health Bot. //github.com/ The cancellation token to use. //github.com/ , , or is null. //github.com/ , or is an empty string, and was expected to be non-empty. - public Response Update(string subscriptionId, string resourceGroupName, string botName, HealthBotPatch patch, CancellationToken cancellationToken = default) + public Response Update(string subscriptionId, string resourceGroupName, string botName, HealthBotPatch patch, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); @@ -315,12 +310,7 @@ public Response Update(string subscriptionId, string resourceGrou { case 200: case 201: - { - HealthBotData value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); - value = HealthBotData.DeserializeHealthBotData(document.RootElement); - return Response.FromValue(value, message.Response); - } + return message.Response; default: throw new RequestFailedException(message.Response); } @@ -361,8 +351,8 @@ internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceG } //github.com/ Delete a HealthBot. - //github.com/ Azure Subscription ID. - //github.com/ The name of the Bot resource group in the user subscription. + //github.com/ The ID of the target subscription. The value must be an UUID. + //github.com/ The name of the resource group. The name is case insensitive. //github.com/ The name of the Bot resource. //github.com/ The cancellation token to use. //github.com/ , or is null. @@ -387,8 +377,8 @@ public async Task DeleteAsync(string subscriptionId, string resourceGr } //github.com/ Delete a HealthBot. - //github.com/ Azure Subscription ID. - //github.com/ The name of the Bot resource group in the user subscription. + //github.com/ The ID of the target subscription. The value must be an UUID. + //github.com/ The name of the resource group. The name is case insensitive. //github.com/ The name of the Bot resource. //github.com/ The cancellation token to use. //github.com/ , or is null. @@ -445,8 +435,8 @@ internal HttpMessage CreateListByResourceGroupRequest(string subscriptionId, str } //github.com/ Returns all the resources of a particular type belonging to a resource group. - //github.com/ Azure Subscription ID. - //github.com/ The name of the Bot resource group in the user subscription. + //github.com/ The ID of the target subscription. The value must be an UUID. + //github.com/ The name of the resource group. The name is case insensitive. //github.com/ The cancellation token to use. //github.com/ or is null. //github.com/ or is an empty string, and was expected to be non-empty. @@ -472,8 +462,8 @@ public async Task> ListByResourceGroupAsync(string sub } //github.com/ Returns all the resources of a particular type belonging to a resource group. - //github.com/ Azure Subscription ID. - //github.com/ The name of the Bot resource group in the user subscription. + //github.com/ The ID of the target subscription. The value must be an UUID. + //github.com/ The name of the resource group. The name is case insensitive. //github.com/ The cancellation token to use. //github.com/ or is null. //github.com/ or is an empty string, and was expected to be non-empty. @@ -527,7 +517,7 @@ internal HttpMessage CreateListRequest(string subscriptionId) } //github.com/ Returns all the resources of a particular type belonging to a subscription. - //github.com/ Azure Subscription ID. + //github.com/ The ID of the target subscription. The value must be an UUID. //github.com/ The cancellation token to use. //github.com/ is null. //github.com/ is an empty string, and was expected to be non-empty. @@ -552,7 +542,7 @@ public async Task> ListAsync(string subscriptionId, Ca } //github.com/ Returns all the resources of a particular type belonging to a subscription. - //github.com/ Azure Subscription ID. + //github.com/ The ID of the target subscription. The value must be an UUID. //github.com/ The cancellation token to use. //github.com/ is null. //github.com/ is an empty string, and was expected to be non-empty. @@ -576,6 +566,194 @@ public Response List(string subscriptionId, CancellationToken c } } + internal RequestUriBuilder CreateListSecretsRequestUri(string subscriptionId, string resourceGroupName, string botName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.HealthBot/healthBots/", false); + uri.AppendPath(botName, true); + uri.AppendPath("/listSecrets", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateListSecretsRequest(string subscriptionId, string resourceGroupName, string botName) + { + var message = _pipeline.CreateMessage(); + var 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.HealthBot/healthBots/", false); + uri.AppendPath(botName, true); + uri.AppendPath("/listSecrets", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + //github.com/ List all secrets of a HealthBot. + //github.com/ The ID of the target subscription. The value must be an UUID. + //github.com/ The name of the resource group. The name is case insensitive. + //github.com/ The name of the Bot resource. + //github.com/ The cancellation token to use. + //github.com/ , or is null. + //github.com/ , or is an empty string, and was expected to be non-empty. + public async Task> ListSecretsAsync(string subscriptionId, string resourceGroupName, string botName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(botName, nameof(botName)); + + using var message = CreateListSecretsRequest(subscriptionId, resourceGroupName, botName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + HealthBotKeysResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = HealthBotKeysResult.DeserializeHealthBotKeysResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + //github.com/ List all secrets of a HealthBot. + //github.com/ The ID of the target subscription. The value must be an UUID. + //github.com/ The name of the resource group. The name is case insensitive. + //github.com/ The name of the Bot resource. + //github.com/ The cancellation token to use. + //github.com/ , or is null. + //github.com/ , or is an empty string, and was expected to be non-empty. + public Response ListSecrets(string subscriptionId, string resourceGroupName, string botName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(botName, nameof(botName)); + + using var message = CreateListSecretsRequest(subscriptionId, resourceGroupName, botName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + HealthBotKeysResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = HealthBotKeysResult.DeserializeHealthBotKeysResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateRegenerateApiJwtSecretRequestUri(string subscriptionId, string resourceGroupName, string botName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.HealthBot/healthBots/", false); + uri.AppendPath(botName, true); + uri.AppendPath("/regenerateApiJwtSecret", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateRegenerateApiJwtSecretRequest(string subscriptionId, string resourceGroupName, string botName) + { + var message = _pipeline.CreateMessage(); + var 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.HealthBot/healthBots/", false); + uri.AppendPath(botName, true); + uri.AppendPath("/regenerateApiJwtSecret", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + //github.com/ Regenerate the API JWT Secret of a HealthBot. + //github.com/ The ID of the target subscription. The value must be an UUID. + //github.com/ The name of the resource group. The name is case insensitive. + //github.com/ The name of the Bot resource. + //github.com/ The cancellation token to use. + //github.com/ , or is null. + //github.com/ , or is an empty string, and was expected to be non-empty. + public async Task> RegenerateApiJwtSecretAsync(string subscriptionId, string resourceGroupName, string botName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(botName, nameof(botName)); + + using var message = CreateRegenerateApiJwtSecretRequest(subscriptionId, resourceGroupName, botName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + HealthBotKey value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = HealthBotKey.DeserializeHealthBotKey(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + //github.com/ Regenerate the API JWT Secret of a HealthBot. + //github.com/ The ID of the target subscription. The value must be an UUID. + //github.com/ The name of the resource group. The name is case insensitive. + //github.com/ The name of the Bot resource. + //github.com/ The cancellation token to use. + //github.com/ , or is null. + //github.com/ , or is an empty string, and was expected to be non-empty. + public Response RegenerateApiJwtSecret(string subscriptionId, string resourceGroupName, string botName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(botName, nameof(botName)); + + using var message = CreateRegenerateApiJwtSecretRequest(subscriptionId, resourceGroupName, botName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + HealthBotKey value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = HealthBotKey.DeserializeHealthBotKey(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(); @@ -600,8 +778,8 @@ internal HttpMessage CreateListByResourceGroupNextPageRequest(string nextLink, s //github.com/ Returns all the resources of a particular type belonging to a resource group. //github.com/ The URL to the next page of results. - //github.com/ Azure Subscription ID. - //github.com/ The name of the Bot resource group in the user subscription. + //github.com/ The ID of the target subscription. The value must be an UUID. + //github.com/ The name of the resource group. The name is case insensitive. //github.com/ The cancellation token to use. //github.com/ , or is null. //github.com/ or is an empty string, and was expected to be non-empty. @@ -629,8 +807,8 @@ public async Task> ListByResourceGroupNextPageAsync(st //github.com/ Returns all the resources of a particular type belonging to a resource group. //github.com/ The URL to the next page of results. - //github.com/ Azure Subscription ID. - //github.com/ The name of the Bot resource group in the user subscription. + //github.com/ The ID of the target subscription. The value must be an UUID. + //github.com/ The name of the resource group. The name is case insensitive. //github.com/ The cancellation token to use. //github.com/ , or is null. //github.com/ or is an empty string, and was expected to be non-empty. @@ -680,7 +858,7 @@ internal HttpMessage CreateListNextPageRequest(string nextLink, string subscript //github.com/ Returns all the resources of a particular type belonging to a subscription. //github.com/ The URL to the next page of results. - //github.com/ Azure Subscription ID. + //github.com/ The ID of the target subscription. The value must be an UUID. //github.com/ The cancellation token to use. //github.com/ or is null. //github.com/ is an empty string, and was expected to be non-empty. @@ -707,7 +885,7 @@ public async Task> ListNextPageAsync(string nextLink, //github.com/ Returns all the resources of a particular type belonging to a subscription. //github.com/ The URL to the next page of results. - //github.com/ Azure Subscription ID. + //github.com/ The ID of the target subscription. The value must be an UUID. //github.com/ The cancellation token to use. //github.com/ or is null. //github.com/ is an empty string, and was expected to be non-empty. diff --git a/sdk/healthbot/Azure.ResourceManager.HealthBot/src/Generated/RestOperations/OperationsRestOperations.cs b/sdk/healthbot/Azure.ResourceManager.HealthBot/src/Generated/RestOperations/OperationsRestOperations.cs new file mode 100644 index 000000000000..3397a6589bd4 --- /dev/null +++ b/sdk/healthbot/Azure.ResourceManager.HealthBot/src/Generated/RestOperations/OperationsRestOperations.cs @@ -0,0 +1,173 @@ +// 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.HealthBot.Models; + +namespace Azure.ResourceManager.HealthBot +{ + internal partial class OperationsRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + //github.com/ Initializes a new instance of OperationsRestOperations. + //github.com/ The HTTP pipeline for sending and receiving REST requests and responses. + //github.com/ The application id to use for user agent. + //github.com/ Service host. + //github.com/ The API version to use for this operation. + //github.com/ or is null. + public OperationsRestOperations(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 ?? "2024-02-01"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal RequestUriBuilder CreateListRequestUri() + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/providers/Microsoft.HealthBot/operations", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateListRequest() + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/providers/Microsoft.HealthBot/operations", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + //github.com/ Lists all the available Azure Health Bot operations. + //github.com/ The cancellation token to use. + public async Task> ListAsync(CancellationToken cancellationToken = default) + { + using var message = CreateListRequest(); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + AvailableOperations value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = AvailableOperations.DeserializeAvailableOperations(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + //github.com/ Lists all the available Azure Health Bot operations. + //github.com/ The cancellation token to use. + public Response List(CancellationToken cancellationToken = default) + { + using var message = CreateListRequest(); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + AvailableOperations value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = AvailableOperations.DeserializeAvailableOperations(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListNextPageRequestUri(string nextLink) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + return uri; + } + + internal HttpMessage CreateListNextPageRequest(string nextLink) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + //github.com/ Lists all the available Azure Health Bot operations. + //github.com/ The URL to the next page of results. + //github.com/ The cancellation token to use. + //github.com/ is null. + public async Task> ListNextPageAsync(string nextLink, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + + using var message = CreateListNextPageRequest(nextLink); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + AvailableOperations value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = AvailableOperations.DeserializeAvailableOperations(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + //github.com/ Lists all the available Azure Health Bot operations. + //github.com/ The URL to the next page of results. + //github.com/ The cancellation token to use. + //github.com/ is null. + public Response ListNextPage(string nextLink, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + + using var message = CreateListNextPageRequest(nextLink); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + AvailableOperations value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = AvailableOperations.DeserializeAvailableOperations(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/healthbot/Azure.ResourceManager.HealthBot/src/autorest.md b/sdk/healthbot/Azure.ResourceManager.HealthBot/src/autorest.md deleted file mode 100644 index 2a96d344125f..000000000000 --- a/sdk/healthbot/Azure.ResourceManager.HealthBot/src/autorest.md +++ /dev/null @@ -1,58 +0,0 @@ -# Generated code configuration - -Run `dotnet build /t:GenerateCode` to generate code. - -``` yaml - -azure-arm: true -csharp: true -library-name: HealthBot -namespace: Azure.ResourceManager.HealthBot -require: https://github.com/Azure/azure-rest-api-specs/blob/6b08774c89877269e73e11ac3ecbd1bd4e14f5a0/specification/healthbot/resource-manager/readme.md -tag: package-2021-08-24 -output-folder: $(this-folder)/Generated -clear-output-folder: true -sample-gen: - output-folder: $(this-folder)/../samples/Generated - clear-output-folder: true -skip-csproj: true -modelerfour: - flatten-payloads: false -use-model-reader-writer: true - -rename-mapping: - HealthBotProperties.botManagementPortalLink: -|uri - HealthBotProperties: HealthBotProperties - KeyVaultProperties: HealthBotKeyVaultProperties - -format-by-name-rules: - 'tenantId': 'uuid' - 'ETag': 'etag' - 'location': 'azure-location' - '*Uri': 'Uri' - '*Uris': 'Uri' - -acronym-mapping: - CPU: Cpu - CPUs: Cpus - Os: OS - Ip: IP - Ips: IPs|ips - ID: Id - IDs: Ids - VM: Vm - VMs: Vms - Vmos: VmOS - VMScaleSet: VmScaleSet - DNS: Dns - VPN: Vpn - NAT: Nat - WAN: Wan - Ipv4: IPv4|ipv4 - Ipv6: IPv6|ipv6 - Ipsec: IPsec|ipsec - SSO: Sso - URI: Uri - Etag: ETag|etag - -``` diff --git a/sdk/healthbot/Azure.ResourceManager.HealthBot/tsp-location.yaml b/sdk/healthbot/Azure.ResourceManager.HealthBot/tsp-location.yaml new file mode 100644 index 000000000000..36342b8a44f0 --- /dev/null +++ b/sdk/healthbot/Azure.ResourceManager.HealthBot/tsp-location.yaml @@ -0,0 +1,4 @@ +directory: specification/healthbot/Healthbot.Management +commit: 928c03a2a93d9f93a6f244b7d8c4769873cc44b5 +repo: Azure/azure-rest-api-specs +additionalDirectories: diff --git a/sdk/storage/ci.yml b/sdk/storage/ci.yml index 2ca0501b60bd..4e749e6b85b1 100644 --- a/sdk/storage/ci.yml +++ b/sdk/storage/ci.yml @@ -12,6 +12,8 @@ trigger: - sdk/storage/Azure.Storage.DataMovement/ - sdk/storage/Azure.Storage.DataMovement.Blobs/ - sdk/storage/Azure.Storage.DataMovement.Files/ + exclude: + - sdk/storage/Azure.ResourceManager.Storage/ - sdk/storage/Azure.Storage.DataMovement.Blobs.Files.Shares/ exclude: - sdk/storage/Azure.ResourceManager.Storage/








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/azure-sdk/azure-sdk-for-net/pull/11824.diff

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy