diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/api/Azure.ResourceManager.CosmosDB.net8.0.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/api/Azure.ResourceManager.CosmosDB.net8.0.cs index b7d5d59400f7..e2b8e378dfc4 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/api/Azure.ResourceManager.CosmosDB.net8.0.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/api/Azure.ResourceManager.CosmosDB.net8.0.cs @@ -213,6 +213,107 @@ protected CassandraKeyspaceThroughputSettingResource() { } string System.ClientModel.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 CassandraRoleAssignmentResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected CassandraRoleAssignmentResource() { } + public virtual Azure.ResourceManager.CosmosDB.CassandraRoleAssignmentResourceData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string accountName, string roleAssignmentId) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + Azure.ResourceManager.CosmosDB.CassandraRoleAssignmentResourceData 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.CosmosDB.CassandraRoleAssignmentResourceData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.CosmosDB.CassandraRoleAssignmentResourceData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.CosmosDB.CassandraRoleAssignmentResourceData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public partial class CassandraRoleAssignmentResourceCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected CassandraRoleAssignmentResourceCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string roleAssignmentId, Azure.ResourceManager.CosmosDB.CassandraRoleAssignmentResourceData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string roleAssignmentId, Azure.ResourceManager.CosmosDB.CassandraRoleAssignmentResourceData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string roleAssignmentId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string roleAssignmentId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string roleAssignmentId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string roleAssignmentId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string roleAssignmentId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string roleAssignmentId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } + System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } + } + public partial class CassandraRoleAssignmentResourceData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public CassandraRoleAssignmentResourceData() { } + public System.Guid? PrincipalId { get { throw null; } set { } } + public string ProvisioningState { get { throw null; } } + public string RoleDefinitionId { get { throw null; } set { } } + public string Scope { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.CosmosDB.CassandraRoleAssignmentResourceData 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.CosmosDB.CassandraRoleAssignmentResourceData 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 CassandraRoleDefinitionResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected CassandraRoleDefinitionResource() { } + public virtual Azure.ResourceManager.CosmosDB.CassandraRoleDefinitionResourceData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string accountName, string roleDefinitionId) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + Azure.ResourceManager.CosmosDB.CassandraRoleDefinitionResourceData 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.CosmosDB.CassandraRoleDefinitionResourceData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.CosmosDB.CassandraRoleDefinitionResourceData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.CosmosDB.CassandraRoleDefinitionResourceData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public partial class CassandraRoleDefinitionResourceCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected CassandraRoleDefinitionResourceCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string roleDefinitionId, Azure.ResourceManager.CosmosDB.CassandraRoleDefinitionResourceData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string roleDefinitionId, Azure.ResourceManager.CosmosDB.CassandraRoleDefinitionResourceData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string roleDefinitionId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string roleDefinitionId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string roleDefinitionId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string roleDefinitionId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string roleDefinitionId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string roleDefinitionId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } + System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } + } + public partial class CassandraRoleDefinitionResourceData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public CassandraRoleDefinitionResourceData() { } + public System.Collections.Generic.IList AssignableScopes { get { throw null; } } + public string IdPropertiesId { get { throw null; } set { } } + public System.Collections.Generic.IList Permissions { get { throw null; } } + public string RoleName { get { throw null; } set { } } + public Azure.ResourceManager.CosmosDB.Models.CosmosDBSqlRoleDefinitionType? TypePropertiesType { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.CosmosDB.CassandraRoleDefinitionResourceData 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.CosmosDB.CassandraRoleDefinitionResourceData 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 CassandraTableCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable { protected CassandraTableCollection() { } @@ -379,6 +480,59 @@ protected CassandraViewThroughputSettingResource() { } string System.ClientModel.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 CopyJobGetResultCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected CopyJobGetResultCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string jobName, Azure.ResourceManager.CosmosDB.CopyJobGetResultData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string jobName, Azure.ResourceManager.CosmosDB.CopyJobGetResultData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string jobName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string jobName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string jobName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string jobName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string jobName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string jobName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } + System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } + } + public partial class CopyJobGetResultData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public CopyJobGetResultData(Azure.ResourceManager.CosmosDB.Models.CopyJobProperties properties) { } + public Azure.ResourceManager.CosmosDB.Models.CopyJobProperties Properties { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.CosmosDB.CopyJobGetResultData 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.CosmosDB.CopyJobGetResultData 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 CopyJobGetResultResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected CopyJobGetResultResource() { } + public virtual Azure.ResourceManager.CosmosDB.CopyJobGetResultData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public virtual Azure.Response Cancel(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CancelAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Complete(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CompleteAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string accountName, string jobName) { 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 Pause(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> PauseAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Resume(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ResumeAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + Azure.ResourceManager.CosmosDB.CopyJobGetResultData 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.CosmosDB.CopyJobGetResultData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.CosmosDB.CopyJobGetResultData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.CosmosDB.CopyJobGetResultData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } public partial class CosmosDBAccountCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable { protected CosmosDBAccountCollection() { } @@ -418,6 +572,7 @@ public CosmosDBAccountData(Azure.Core.AzureLocation location) { } public bool? DisableKeyBasedMetadataWriteAccess { get { throw null; } set { } } public bool? DisableLocalAuth { get { throw null; } set { } } public string DocumentEndpoint { get { throw null; } } + public bool? EnableAllVersionsAndDeletesChangeFeed { get { throw null; } set { } } public bool? EnableAutomaticFailover { get { throw null; } set { } } public bool? EnableBurstCapacity { get { throw null; } set { } } public bool? EnableCassandraConnector { get { throw null; } set { } } @@ -472,8 +627,17 @@ protected CosmosDBAccountResource() { } public virtual Azure.Response GetCassandraKeyspace(string keyspaceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> GetCassandraKeyspaceAsync(string keyspaceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.ResourceManager.CosmosDB.CassandraKeyspaceCollection GetCassandraKeyspaces() { throw null; } + public virtual Azure.Response GetCassandraRoleAssignmentResource(string roleAssignmentId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetCassandraRoleAssignmentResourceAsync(string roleAssignmentId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.CosmosDB.CassandraRoleAssignmentResourceCollection GetCassandraRoleAssignmentResources() { throw null; } + public virtual Azure.Response GetCassandraRoleDefinitionResource(string roleDefinitionId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetCassandraRoleDefinitionResourceAsync(string roleDefinitionId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.CosmosDB.CassandraRoleDefinitionResourceCollection GetCassandraRoleDefinitionResources() { throw null; } public virtual Azure.Pageable GetConnectionStrings(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.AsyncPageable GetConnectionStringsAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response GetCopyJobGetResult(string jobName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetCopyJobGetResultAsync(string jobName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.CosmosDB.CopyJobGetResultCollection GetCopyJobGetResults() { throw null; } public virtual Azure.Response GetCosmosDBChaosFaultResource(string chaosFault, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> GetCosmosDBChaosFaultResourceAsync(string chaosFault, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.ResourceManager.CosmosDB.CosmosDBChaosFaultResourceCollection GetCosmosDBChaosFaultResources() { throw null; } @@ -513,6 +677,12 @@ protected CosmosDBAccountResource() { } public virtual Azure.Response GetGremlinDatabase(string databaseName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> GetGremlinDatabaseAsync(string databaseName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.ResourceManager.CosmosDB.GremlinDatabaseCollection GetGremlinDatabases() { throw null; } + public virtual Azure.Response GetGremlinRoleAssignmentResource(string roleAssignmentId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetGremlinRoleAssignmentResourceAsync(string roleAssignmentId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.CosmosDB.GremlinRoleAssignmentResourceCollection GetGremlinRoleAssignmentResources() { throw null; } + public virtual Azure.Response GetGremlinRoleDefinitionResource(string roleDefinitionId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetGremlinRoleDefinitionResourceAsync(string roleDefinitionId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.CosmosDB.GremlinRoleDefinitionResourceCollection GetGremlinRoleDefinitionResources() { throw null; } public virtual Azure.Response GetKeys(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> GetKeysAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Pageable GetMetricDefinitions(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } @@ -554,6 +724,12 @@ protected CosmosDBAccountResource() { } public virtual Azure.Response GetMongoDBUserDefinition(string mongoUserDefinitionId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> GetMongoDBUserDefinitionAsync(string mongoUserDefinitionId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.ResourceManager.CosmosDB.MongoDBUserDefinitionCollection GetMongoDBUserDefinitions() { throw null; } + public virtual Azure.Response GetMongoMIRoleAssignmentResource(string roleAssignmentId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetMongoMIRoleAssignmentResourceAsync(string roleAssignmentId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.CosmosDB.MongoMIRoleAssignmentResourceCollection GetMongoMIRoleAssignmentResources() { throw null; } + public virtual Azure.Response GetMongoMIRoleDefinitionResource(string roleDefinitionId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetMongoMIRoleDefinitionResourceAsync(string roleDefinitionId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.CosmosDB.MongoMIRoleDefinitionResourceCollection GetMongoMIRoleDefinitionResources() { throw null; } public virtual Azure.Response GetNetworkSecurityPerimeterConfiguration(string networkSecurityPerimeterConfigurationName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> GetNetworkSecurityPerimeterConfigurationAsync(string networkSecurityPerimeterConfigurationName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.ResourceManager.CosmosDB.NetworkSecurityPerimeterConfigurationCollection GetNetworkSecurityPerimeterConfigurations() { throw null; } @@ -647,10 +823,13 @@ public static partial class CosmosDBExtensions public static Azure.ResourceManager.CosmosDB.CassandraDataCenterResource GetCassandraDataCenterResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } public static Azure.ResourceManager.CosmosDB.CassandraKeyspaceResource GetCassandraKeyspaceResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } public static Azure.ResourceManager.CosmosDB.CassandraKeyspaceThroughputSettingResource GetCassandraKeyspaceThroughputSettingResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.ResourceManager.CosmosDB.CassandraRoleAssignmentResource GetCassandraRoleAssignmentResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.ResourceManager.CosmosDB.CassandraRoleDefinitionResource GetCassandraRoleDefinitionResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } public static Azure.ResourceManager.CosmosDB.CassandraTableResource GetCassandraTableResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } public static Azure.ResourceManager.CosmosDB.CassandraTableThroughputSettingResource GetCassandraTableThroughputSettingResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } public static Azure.ResourceManager.CosmosDB.CassandraViewGetResultResource GetCassandraViewGetResultResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } public static Azure.ResourceManager.CosmosDB.CassandraViewThroughputSettingResource GetCassandraViewThroughputSettingResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.ResourceManager.CosmosDB.CopyJobGetResultResource GetCopyJobGetResultResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } public static Azure.Response GetCosmosDBAccount(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string accountName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public static System.Threading.Tasks.Task> GetCosmosDBAccountAsync(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string accountName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public static Azure.ResourceManager.CosmosDB.CosmosDBAccountResource GetCosmosDBAccountResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } @@ -687,17 +866,30 @@ public static partial class CosmosDBExtensions public static Azure.AsyncPageable GetCosmosDBThroughputPoolsAsync(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public static Azure.ResourceManager.CosmosDB.CosmosTableThroughputSettingResource GetCosmosTableThroughputSettingResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } public static Azure.ResourceManager.CosmosDB.DataTransferJobGetResultResource GetDataTransferJobGetResultResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.ResourceManager.CosmosDB.FleetAnalyticsResource GetFleetAnalyticsResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.ResourceManager.CosmosDB.FleetResource GetFleetResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.Response GetFleetResource(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string fleetName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static System.Threading.Tasks.Task> GetFleetResourceAsync(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string fleetName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.ResourceManager.CosmosDB.FleetResourceCollection GetFleetResources(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource) { throw null; } + public static Azure.Pageable GetFleetResources(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.AsyncPageable GetFleetResourcesAsync(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.ResourceManager.CosmosDB.FleetspaceAccountResource GetFleetspaceAccountResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.ResourceManager.CosmosDB.FleetspaceResource GetFleetspaceResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } public static Azure.ResourceManager.CosmosDB.GraphResourceGetResultResource GetGraphResourceGetResultResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } public static Azure.ResourceManager.CosmosDB.GremlinDatabaseResource GetGremlinDatabaseResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } public static Azure.ResourceManager.CosmosDB.GremlinDatabaseThroughputSettingResource GetGremlinDatabaseThroughputSettingResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } public static Azure.ResourceManager.CosmosDB.GremlinGraphResource GetGremlinGraphResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } public static Azure.ResourceManager.CosmosDB.GremlinGraphThroughputSettingResource GetGremlinGraphThroughputSettingResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.ResourceManager.CosmosDB.GremlinRoleAssignmentResource GetGremlinRoleAssignmentResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.ResourceManager.CosmosDB.GremlinRoleDefinitionResource GetGremlinRoleDefinitionResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } public static Azure.ResourceManager.CosmosDB.MongoDBCollectionResource GetMongoDBCollectionResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } public static Azure.ResourceManager.CosmosDB.MongoDBCollectionThroughputSettingResource GetMongoDBCollectionThroughputSettingResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } public static Azure.ResourceManager.CosmosDB.MongoDBDatabaseResource GetMongoDBDatabaseResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } public static Azure.ResourceManager.CosmosDB.MongoDBDatabaseThroughputSettingResource GetMongoDBDatabaseThroughputSettingResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } public static Azure.ResourceManager.CosmosDB.MongoDBRoleDefinitionResource GetMongoDBRoleDefinitionResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } public static Azure.ResourceManager.CosmosDB.MongoDBUserDefinitionResource GetMongoDBUserDefinitionResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.ResourceManager.CosmosDB.MongoMIRoleAssignmentResource GetMongoMIRoleAssignmentResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.ResourceManager.CosmosDB.MongoMIRoleDefinitionResource GetMongoMIRoleDefinitionResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } public static Azure.ResourceManager.CosmosDB.NetworkSecurityPerimeterConfigurationResource GetNetworkSecurityPerimeterConfigurationResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } public static Azure.ResourceManager.CosmosDB.RestorableCosmosDBAccountResource GetRestorableCosmosDBAccountResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } public static Azure.Pageable GetRestorableCosmosDBAccounts(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } @@ -1738,6 +1930,209 @@ protected DataTransferJobGetResultResource() { } public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.CosmosDB.Models.DataTransferJobGetResultCreateOrUpdateContent content, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.CosmosDB.Models.DataTransferJobGetResultCreateOrUpdateContent content, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } } + public partial class FleetAnalyticsResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected FleetAnalyticsResource() { } + public virtual Azure.ResourceManager.CosmosDB.FleetAnalyticsResourceData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string fleetName, string fleetAnalyticsName) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + Azure.ResourceManager.CosmosDB.FleetAnalyticsResourceData 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.CosmosDB.FleetAnalyticsResourceData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.CosmosDB.FleetAnalyticsResourceData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.CosmosDB.FleetAnalyticsResourceData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public partial class FleetAnalyticsResourceCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected FleetAnalyticsResourceCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string fleetAnalyticsName, Azure.ResourceManager.CosmosDB.FleetAnalyticsResourceData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string fleetAnalyticsName, Azure.ResourceManager.CosmosDB.FleetAnalyticsResourceData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string fleetAnalyticsName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string fleetAnalyticsName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string fleetAnalyticsName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string fleetAnalyticsName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string fleetAnalyticsName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string fleetAnalyticsName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } + System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } + } + public partial class FleetAnalyticsResourceData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public FleetAnalyticsResourceData() { } + public Azure.ResourceManager.CosmosDB.Models.CosmosDBStatus? ProvisioningState { get { throw null; } set { } } + public Azure.ResourceManager.CosmosDB.Models.FleetAnalyticsPropertiesStorageLocationType? StorageLocationType { get { throw null; } set { } } + public System.Uri StorageLocationUri { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.CosmosDB.FleetAnalyticsResourceData 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.CosmosDB.FleetAnalyticsResourceData 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 FleetResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected FleetResource() { } + public virtual Azure.ResourceManager.CosmosDB.FleetResourceData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string fleetName) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response GetFleetAnalyticsResource(string fleetAnalyticsName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetFleetAnalyticsResourceAsync(string fleetAnalyticsName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.CosmosDB.FleetAnalyticsResourceCollection GetFleetAnalyticsResources() { throw null; } + public virtual Azure.Response GetFleetspaceResource(string fleetspaceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetFleetspaceResourceAsync(string fleetspaceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.CosmosDB.FleetspaceResourceCollection GetFleetspaceResources() { throw null; } + Azure.ResourceManager.CosmosDB.FleetResourceData 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.CosmosDB.FleetResourceData 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.CosmosDB.Models.FleetResourcePatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.ResourceManager.CosmosDB.Models.FleetResourcePatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public partial class FleetResourceCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected FleetResourceCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string fleetName, Azure.ResourceManager.CosmosDB.FleetResourceData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string fleetName, Azure.ResourceManager.CosmosDB.FleetResourceData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string fleetName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string fleetName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string fleetName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string fleetName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string fleetName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string fleetName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } + System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } + } + public partial class FleetResourceData : Azure.ResourceManager.Models.TrackedResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public FleetResourceData(Azure.Core.AzureLocation location) { } + public Azure.ResourceManager.CosmosDB.Models.CosmosDBStatus? ProvisioningState { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.CosmosDB.FleetResourceData 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.CosmosDB.FleetResourceData 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 FleetspaceAccountResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected FleetspaceAccountResource() { } + public virtual Azure.ResourceManager.CosmosDB.FleetspaceAccountResourceData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string fleetName, string fleetspaceName, string fleetspaceAccountName) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + Azure.ResourceManager.CosmosDB.FleetspaceAccountResourceData 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.CosmosDB.FleetspaceAccountResourceData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.CosmosDB.FleetspaceAccountResourceData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.CosmosDB.FleetspaceAccountResourceData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public partial class FleetspaceAccountResourceCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected FleetspaceAccountResourceCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string fleetspaceAccountName, Azure.ResourceManager.CosmosDB.FleetspaceAccountResourceData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string fleetspaceAccountName, Azure.ResourceManager.CosmosDB.FleetspaceAccountResourceData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string fleetspaceAccountName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string fleetspaceAccountName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string fleetspaceAccountName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string fleetspaceAccountName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string fleetspaceAccountName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string fleetspaceAccountName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } + System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } + } + public partial class FleetspaceAccountResourceData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public FleetspaceAccountResourceData() { } + public string AccountLocation { get { throw null; } set { } } + public string AccountResourceIdentifier { get { throw null; } set { } } + public Azure.ResourceManager.CosmosDB.Models.CosmosDBStatus? ProvisioningState { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.CosmosDB.FleetspaceAccountResourceData 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.CosmosDB.FleetspaceAccountResourceData 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 FleetspaceResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected FleetspaceResource() { } + public virtual Azure.ResourceManager.CosmosDB.FleetspaceResourceData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string fleetName, string fleetspaceName) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response GetFleetspaceAccountResource(string fleetspaceAccountName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetFleetspaceAccountResourceAsync(string fleetspaceAccountName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.CosmosDB.FleetspaceAccountResourceCollection GetFleetspaceAccountResources() { throw null; } + Azure.ResourceManager.CosmosDB.FleetspaceResourceData 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.CosmosDB.FleetspaceResourceData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.CosmosDB.Models.FleetspaceResourcePatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.CosmosDB.Models.FleetspaceResourcePatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public partial class FleetspaceResourceCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected FleetspaceResourceCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string fleetspaceName, Azure.ResourceManager.CosmosDB.FleetspaceResourceData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string fleetspaceName, Azure.ResourceManager.CosmosDB.FleetspaceResourceData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string fleetspaceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string fleetspaceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string fleetspaceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string fleetspaceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string fleetspaceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string fleetspaceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } + System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } + } + public partial class FleetspaceResourceData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public FleetspaceResourceData() { } + public Azure.ResourceManager.CosmosDB.Models.FleetspacePropertiesFleetspaceApiKind? FleetspaceApiKind { get { throw null; } set { } } + public Azure.ResourceManager.CosmosDB.Models.CosmosDBStatus? ProvisioningState { get { throw null; } set { } } + public Azure.ResourceManager.CosmosDB.Models.FleetspacePropertiesThroughputPoolConfiguration ThroughputPoolConfiguration { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.CosmosDB.FleetspaceResourceData 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.CosmosDB.FleetspaceResourceData 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 GraphResourceGetResultCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable { protected GraphResourceGetResultCollection() { } @@ -1964,6 +2359,107 @@ protected GremlinGraphThroughputSettingResource() { } string System.ClientModel.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 GremlinRoleAssignmentResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected GremlinRoleAssignmentResource() { } + public virtual Azure.ResourceManager.CosmosDB.GremlinRoleAssignmentResourceData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string accountName, string roleAssignmentId) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + Azure.ResourceManager.CosmosDB.GremlinRoleAssignmentResourceData 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.CosmosDB.GremlinRoleAssignmentResourceData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.CosmosDB.GremlinRoleAssignmentResourceData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.CosmosDB.GremlinRoleAssignmentResourceData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public partial class GremlinRoleAssignmentResourceCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected GremlinRoleAssignmentResourceCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string roleAssignmentId, Azure.ResourceManager.CosmosDB.GremlinRoleAssignmentResourceData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string roleAssignmentId, Azure.ResourceManager.CosmosDB.GremlinRoleAssignmentResourceData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string roleAssignmentId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string roleAssignmentId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string roleAssignmentId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string roleAssignmentId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string roleAssignmentId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string roleAssignmentId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } + System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } + } + public partial class GremlinRoleAssignmentResourceData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public GremlinRoleAssignmentResourceData() { } + public System.Guid? PrincipalId { get { throw null; } set { } } + public string ProvisioningState { get { throw null; } } + public string RoleDefinitionId { get { throw null; } set { } } + public string Scope { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.CosmosDB.GremlinRoleAssignmentResourceData 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.CosmosDB.GremlinRoleAssignmentResourceData 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 GremlinRoleDefinitionResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected GremlinRoleDefinitionResource() { } + public virtual Azure.ResourceManager.CosmosDB.GremlinRoleDefinitionResourceData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string accountName, string roleDefinitionId) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + Azure.ResourceManager.CosmosDB.GremlinRoleDefinitionResourceData 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.CosmosDB.GremlinRoleDefinitionResourceData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.CosmosDB.GremlinRoleDefinitionResourceData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.CosmosDB.GremlinRoleDefinitionResourceData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public partial class GremlinRoleDefinitionResourceCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected GremlinRoleDefinitionResourceCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string roleDefinitionId, Azure.ResourceManager.CosmosDB.GremlinRoleDefinitionResourceData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string roleDefinitionId, Azure.ResourceManager.CosmosDB.GremlinRoleDefinitionResourceData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string roleDefinitionId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string roleDefinitionId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string roleDefinitionId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string roleDefinitionId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string roleDefinitionId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string roleDefinitionId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } + System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } + } + public partial class GremlinRoleDefinitionResourceData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public GremlinRoleDefinitionResourceData() { } + public System.Collections.Generic.IList AssignableScopes { get { throw null; } } + public string IdPropertiesId { get { throw null; } set { } } + public System.Collections.Generic.IList Permissions { get { throw null; } } + public string RoleName { get { throw null; } set { } } + public Azure.ResourceManager.CosmosDB.Models.CosmosDBSqlRoleDefinitionType? TypePropertiesType { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.CosmosDB.GremlinRoleDefinitionResourceData 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.CosmosDB.GremlinRoleDefinitionResourceData 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 MongoDBCollectionCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable { protected MongoDBCollectionCollection() { } @@ -2250,6 +2746,107 @@ protected MongoDBUserDefinitionResource() { } public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.CosmosDB.Models.MongoDBUserDefinitionCreateOrUpdateContent content, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.CosmosDB.Models.MongoDBUserDefinitionCreateOrUpdateContent content, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } } + public partial class MongoMIRoleAssignmentResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected MongoMIRoleAssignmentResource() { } + public virtual Azure.ResourceManager.CosmosDB.MongoMIRoleAssignmentResourceData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string accountName, string roleAssignmentId) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + Azure.ResourceManager.CosmosDB.MongoMIRoleAssignmentResourceData 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.CosmosDB.MongoMIRoleAssignmentResourceData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.CosmosDB.MongoMIRoleAssignmentResourceData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.CosmosDB.MongoMIRoleAssignmentResourceData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public partial class MongoMIRoleAssignmentResourceCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected MongoMIRoleAssignmentResourceCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string roleAssignmentId, Azure.ResourceManager.CosmosDB.MongoMIRoleAssignmentResourceData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string roleAssignmentId, Azure.ResourceManager.CosmosDB.MongoMIRoleAssignmentResourceData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string roleAssignmentId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string roleAssignmentId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string roleAssignmentId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string roleAssignmentId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string roleAssignmentId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string roleAssignmentId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } + System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } + } + public partial class MongoMIRoleAssignmentResourceData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public MongoMIRoleAssignmentResourceData() { } + public System.Guid? PrincipalId { get { throw null; } set { } } + public string ProvisioningState { get { throw null; } } + public string RoleDefinitionId { get { throw null; } set { } } + public string Scope { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.CosmosDB.MongoMIRoleAssignmentResourceData 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.CosmosDB.MongoMIRoleAssignmentResourceData 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 MongoMIRoleDefinitionResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected MongoMIRoleDefinitionResource() { } + public virtual Azure.ResourceManager.CosmosDB.MongoMIRoleDefinitionResourceData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string accountName, string roleDefinitionId) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + Azure.ResourceManager.CosmosDB.MongoMIRoleDefinitionResourceData 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.CosmosDB.MongoMIRoleDefinitionResourceData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.CosmosDB.MongoMIRoleDefinitionResourceData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.CosmosDB.MongoMIRoleDefinitionResourceData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public partial class MongoMIRoleDefinitionResourceCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected MongoMIRoleDefinitionResourceCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string roleDefinitionId, Azure.ResourceManager.CosmosDB.MongoMIRoleDefinitionResourceData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string roleDefinitionId, Azure.ResourceManager.CosmosDB.MongoMIRoleDefinitionResourceData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string roleDefinitionId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string roleDefinitionId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string roleDefinitionId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string roleDefinitionId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string roleDefinitionId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string roleDefinitionId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } + System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } + } + public partial class MongoMIRoleDefinitionResourceData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public MongoMIRoleDefinitionResourceData() { } + public System.Collections.Generic.IList AssignableScopes { get { throw null; } } + public string IdPropertiesId { get { throw null; } set { } } + public System.Collections.Generic.IList Permissions { get { throw null; } } + public string RoleName { get { throw null; } set { } } + public Azure.ResourceManager.CosmosDB.Models.CosmosDBSqlRoleDefinitionType? TypePropertiesType { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.CosmosDB.MongoMIRoleDefinitionResourceData 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.CosmosDB.MongoMIRoleDefinitionResourceData 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 NetworkSecurityPerimeterConfigurationCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable { protected NetworkSecurityPerimeterConfigurationCollection() { } @@ -2398,10 +2995,13 @@ protected MockableCosmosDBArmClient() { } public virtual Azure.ResourceManager.CosmosDB.CassandraDataCenterResource GetCassandraDataCenterResource(Azure.Core.ResourceIdentifier id) { throw null; } public virtual Azure.ResourceManager.CosmosDB.CassandraKeyspaceResource GetCassandraKeyspaceResource(Azure.Core.ResourceIdentifier id) { throw null; } public virtual Azure.ResourceManager.CosmosDB.CassandraKeyspaceThroughputSettingResource GetCassandraKeyspaceThroughputSettingResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.CosmosDB.CassandraRoleAssignmentResource GetCassandraRoleAssignmentResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.CosmosDB.CassandraRoleDefinitionResource GetCassandraRoleDefinitionResource(Azure.Core.ResourceIdentifier id) { throw null; } public virtual Azure.ResourceManager.CosmosDB.CassandraTableResource GetCassandraTableResource(Azure.Core.ResourceIdentifier id) { throw null; } public virtual Azure.ResourceManager.CosmosDB.CassandraTableThroughputSettingResource GetCassandraTableThroughputSettingResource(Azure.Core.ResourceIdentifier id) { throw null; } public virtual Azure.ResourceManager.CosmosDB.CassandraViewGetResultResource GetCassandraViewGetResultResource(Azure.Core.ResourceIdentifier id) { throw null; } public virtual Azure.ResourceManager.CosmosDB.CassandraViewThroughputSettingResource GetCassandraViewThroughputSettingResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.CosmosDB.CopyJobGetResultResource GetCopyJobGetResultResource(Azure.Core.ResourceIdentifier id) { throw null; } public virtual Azure.ResourceManager.CosmosDB.CosmosDBAccountResource GetCosmosDBAccountResource(Azure.Core.ResourceIdentifier id) { throw null; } public virtual Azure.ResourceManager.CosmosDB.CosmosDBChaosFaultResource GetCosmosDBChaosFaultResource(Azure.Core.ResourceIdentifier id) { throw null; } public virtual Azure.ResourceManager.CosmosDB.CosmosDBLocationResource GetCosmosDBLocationResource(Azure.Core.ResourceIdentifier id) { throw null; } @@ -2425,17 +3025,25 @@ protected MockableCosmosDBArmClient() { } public virtual Azure.ResourceManager.CosmosDB.CosmosDBThroughputPoolResource GetCosmosDBThroughputPoolResource(Azure.Core.ResourceIdentifier id) { throw null; } public virtual Azure.ResourceManager.CosmosDB.CosmosTableThroughputSettingResource GetCosmosTableThroughputSettingResource(Azure.Core.ResourceIdentifier id) { throw null; } public virtual Azure.ResourceManager.CosmosDB.DataTransferJobGetResultResource GetDataTransferJobGetResultResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.CosmosDB.FleetAnalyticsResource GetFleetAnalyticsResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.CosmosDB.FleetResource GetFleetResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.CosmosDB.FleetspaceAccountResource GetFleetspaceAccountResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.CosmosDB.FleetspaceResource GetFleetspaceResource(Azure.Core.ResourceIdentifier id) { throw null; } public virtual Azure.ResourceManager.CosmosDB.GraphResourceGetResultResource GetGraphResourceGetResultResource(Azure.Core.ResourceIdentifier id) { throw null; } public virtual Azure.ResourceManager.CosmosDB.GremlinDatabaseResource GetGremlinDatabaseResource(Azure.Core.ResourceIdentifier id) { throw null; } public virtual Azure.ResourceManager.CosmosDB.GremlinDatabaseThroughputSettingResource GetGremlinDatabaseThroughputSettingResource(Azure.Core.ResourceIdentifier id) { throw null; } public virtual Azure.ResourceManager.CosmosDB.GremlinGraphResource GetGremlinGraphResource(Azure.Core.ResourceIdentifier id) { throw null; } public virtual Azure.ResourceManager.CosmosDB.GremlinGraphThroughputSettingResource GetGremlinGraphThroughputSettingResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.CosmosDB.GremlinRoleAssignmentResource GetGremlinRoleAssignmentResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.CosmosDB.GremlinRoleDefinitionResource GetGremlinRoleDefinitionResource(Azure.Core.ResourceIdentifier id) { throw null; } public virtual Azure.ResourceManager.CosmosDB.MongoDBCollectionResource GetMongoDBCollectionResource(Azure.Core.ResourceIdentifier id) { throw null; } public virtual Azure.ResourceManager.CosmosDB.MongoDBCollectionThroughputSettingResource GetMongoDBCollectionThroughputSettingResource(Azure.Core.ResourceIdentifier id) { throw null; } public virtual Azure.ResourceManager.CosmosDB.MongoDBDatabaseResource GetMongoDBDatabaseResource(Azure.Core.ResourceIdentifier id) { throw null; } public virtual Azure.ResourceManager.CosmosDB.MongoDBDatabaseThroughputSettingResource GetMongoDBDatabaseThroughputSettingResource(Azure.Core.ResourceIdentifier id) { throw null; } public virtual Azure.ResourceManager.CosmosDB.MongoDBRoleDefinitionResource GetMongoDBRoleDefinitionResource(Azure.Core.ResourceIdentifier id) { throw null; } public virtual Azure.ResourceManager.CosmosDB.MongoDBUserDefinitionResource GetMongoDBUserDefinitionResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.CosmosDB.MongoMIRoleAssignmentResource GetMongoMIRoleAssignmentResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.CosmosDB.MongoMIRoleDefinitionResource GetMongoMIRoleDefinitionResource(Azure.Core.ResourceIdentifier id) { throw null; } public virtual Azure.ResourceManager.CosmosDB.NetworkSecurityPerimeterConfigurationResource GetNetworkSecurityPerimeterConfigurationResource(Azure.Core.ResourceIdentifier id) { throw null; } public virtual Azure.ResourceManager.CosmosDB.RestorableCosmosDBAccountResource GetRestorableCosmosDBAccountResource(Azure.Core.ResourceIdentifier id) { throw null; } } @@ -2451,6 +3059,9 @@ protected MockableCosmosDBResourceGroupResource() { } public virtual Azure.Response GetCosmosDBThroughputPool(string throughputPoolName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> GetCosmosDBThroughputPoolAsync(string throughputPoolName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.ResourceManager.CosmosDB.CosmosDBThroughputPoolCollection GetCosmosDBThroughputPools() { throw null; } + public virtual Azure.Response GetFleetResource(string fleetName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetFleetResourceAsync(string fleetName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.CosmosDB.FleetResourceCollection GetFleetResources() { throw null; } } public partial class MockableCosmosDBSubscriptionResource : Azure.ResourceManager.ArmResource { @@ -2464,6 +3075,8 @@ protected MockableCosmosDBSubscriptionResource() { } public virtual Azure.ResourceManager.CosmosDB.CosmosDBLocationCollection GetCosmosDBLocations() { throw null; } public virtual Azure.Pageable GetCosmosDBThroughputPools(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.AsyncPageable GetCosmosDBThroughputPoolsAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetFleetResources(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetFleetResourcesAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Pageable GetRestorableCosmosDBAccounts(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.AsyncPageable GetRestorableCosmosDBAccountsAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } } @@ -2544,6 +3157,8 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer public static partial class ArmCosmosDBModelFactory { public static Azure.ResourceManager.CosmosDB.Models.AutoscaleSettingsResourceInfo AutoscaleSettingsResourceInfo(int maxThroughput = 0, Azure.ResourceManager.CosmosDB.Models.ThroughputPolicyResourceInfo autoUpgradeThroughputPolicy = null, int? targetMaxThroughput = default(int?)) { throw null; } + public static Azure.ResourceManager.CosmosDB.Models.BaseCopyJobTask BaseCopyJobTask(long? totalCount = default(long?), long? processedCount = default(long?)) { throw null; } + public static Azure.ResourceManager.CosmosDB.Models.BlobToCassandraRUCopyJobTask BlobToCassandraRUCopyJobTask(long? totalCount = default(long?), long? processedCount = default(long?), string sourceContainerName = null, Azure.ResourceManager.CosmosDB.Models.CosmosDBCassandraTable destination = null) { throw null; } public static Azure.ResourceManager.CosmosDB.Models.CapacityModeChangeTransitionState CapacityModeChangeTransitionState(Azure.ResourceManager.CosmosDB.Models.CapacityModeTransitionStatus? capacityModeTransitionStatus = default(Azure.ResourceManager.CosmosDB.Models.CapacityModeTransitionStatus?), Azure.ResourceManager.CosmosDB.Models.CapacityMode? currentCapacityMode = default(Azure.ResourceManager.CosmosDB.Models.CapacityMode?), Azure.ResourceManager.CosmosDB.Models.CapacityMode? previousCapacityMode = default(Azure.ResourceManager.CosmosDB.Models.CapacityMode?), System.DateTimeOffset? capacityModeTransitionBeginTimestamp = default(System.DateTimeOffset?), System.DateTimeOffset? capacityModeTransitionEndTimestamp = default(System.DateTimeOffset?), System.DateTimeOffset? capacityModeLastSuccessfulTransitionEndTimestamp = default(System.DateTimeOffset?)) { throw null; } public static Azure.ResourceManager.CosmosDB.Models.CassandraClusterBackupResourceInfo CassandraClusterBackupResourceInfo(string backupId = null, Azure.ResourceManager.CosmosDB.Models.CassandraClusterBackupState? backupState = default(Azure.ResourceManager.CosmosDB.Models.CassandraClusterBackupState?), System.DateTimeOffset? backupStartTimestamp = default(System.DateTimeOffset?), System.DateTimeOffset? backupStopTimestamp = default(System.DateTimeOffset?), System.DateTimeOffset? backupExpiryTimestamp = default(System.DateTimeOffset?)) { throw null; } public static Azure.ResourceManager.CosmosDB.Models.CassandraClusterCommand CassandraClusterCommand(string command = null, string commandId = null, System.BinaryData arguments = null, string host = null, bool? isAdmin = default(bool?), bool? shouldStopCassandraBeforeStart = default(bool?), bool? isReadWrite = default(bool?), string result = null, Azure.ResourceManager.CosmosDB.Models.CassandraClusterCommandStatus? status = default(Azure.ResourceManager.CosmosDB.Models.CassandraClusterCommandStatus?), string outputFile = null) { throw null; } @@ -2560,17 +3175,23 @@ public static partial class ArmCosmosDBModelFactory public static Azure.ResourceManager.CosmosDB.Models.CassandraKeyspaceCreateOrUpdateContent CassandraKeyspaceCreateOrUpdateContent(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IDictionary tags = null, Azure.Core.AzureLocation location = default(Azure.Core.AzureLocation), string resourceKeyspaceName = null, Azure.ResourceManager.CosmosDB.Models.CosmosDBCreateUpdateConfig options = null, Azure.ResourceManager.Models.ManagedServiceIdentity identity = null) { throw null; } public static Azure.ResourceManager.CosmosDB.CassandraKeyspaceData CassandraKeyspaceData(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.CosmosDB.Models.ExtendedCassandraKeyspaceResourceInfo resource = null, Azure.ResourceManager.CosmosDB.Models.CassandraKeyspacePropertiesConfig options = null, Azure.ResourceManager.Models.ManagedServiceIdentity identity = null) { throw null; } public static Azure.ResourceManager.CosmosDB.Models.CassandraReaperStatus CassandraReaperStatus(bool? isHealthy = default(bool?), System.Collections.Generic.IReadOnlyDictionary repairRunIds = null, System.Collections.Generic.IReadOnlyDictionary repairSchedules = null) { throw null; } + public static Azure.ResourceManager.CosmosDB.CassandraRoleAssignmentResourceData CassandraRoleAssignmentResourceData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, string roleDefinitionId = null, string scope = null, System.Guid? principalId = default(System.Guid?), string provisioningState = null) { throw null; } + public static Azure.ResourceManager.CosmosDB.CassandraRoleDefinitionResourceData CassandraRoleDefinitionResourceData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, string idPropertiesId = null, string roleName = null, Azure.ResourceManager.CosmosDB.Models.CosmosDBSqlRoleDefinitionType? typePropertiesType = default(Azure.ResourceManager.CosmosDB.Models.CosmosDBSqlRoleDefinitionType?), System.Collections.Generic.IEnumerable assignableScopes = null, System.Collections.Generic.IEnumerable permissions = null) { throw null; } + public static Azure.ResourceManager.CosmosDB.Models.CassandraRUToBlobCopyJobTask CassandraRUToBlobCopyJobTask(long? totalCount = default(long?), long? processedCount = default(long?), Azure.ResourceManager.CosmosDB.Models.CosmosDBCassandraTable source = null, string destinationContainerName = null) { throw null; } + public static Azure.ResourceManager.CosmosDB.Models.CassandraRUToCassandraRUCopyJobTask CassandraRUToCassandraRUCopyJobTask(long? totalCount = default(long?), long? processedCount = default(long?), Azure.ResourceManager.CosmosDB.Models.CosmosDBCassandraTable source = null, Azure.ResourceManager.CosmosDB.Models.CosmosDBCassandraTable destination = null) { throw null; } public static Azure.ResourceManager.CosmosDB.Models.CassandraTableCreateOrUpdateContent CassandraTableCreateOrUpdateContent(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.CosmosDB.Models.CassandraTableResourceInfo resource = null, Azure.ResourceManager.CosmosDB.Models.CosmosDBCreateUpdateConfig options = null, Azure.ResourceManager.Models.ManagedServiceIdentity identity = null) { throw null; } public static Azure.ResourceManager.CosmosDB.CassandraTableData CassandraTableData(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.CosmosDB.Models.ExtendedCassandraTableResourceInfo resource = null, Azure.ResourceManager.CosmosDB.Models.CassandraTablePropertiesConfig options = null, Azure.ResourceManager.Models.ManagedServiceIdentity identity = null) { throw null; } public static Azure.ResourceManager.CosmosDB.Models.CassandraViewGetPropertiesResource CassandraViewGetPropertiesResource(string id = null, string viewDefinition = null, string rid = null, float? timestamp = default(float?), Azure.ETag? etag = default(Azure.ETag?)) { throw null; } public static Azure.ResourceManager.CosmosDB.Models.CassandraViewGetResultCreateOrUpdateContent CassandraViewGetResultCreateOrUpdateContent(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.CosmosDB.Models.CassandraViewResource resource = null, Azure.ResourceManager.CosmosDB.Models.CosmosDBCreateUpdateConfig options = null, Azure.ResourceManager.Models.ManagedServiceIdentity identity = null) { throw null; } public static Azure.ResourceManager.CosmosDB.CassandraViewGetResultData CassandraViewGetResultData(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.CosmosDB.Models.CassandraViewGetPropertiesResource resource = null, Azure.ResourceManager.CosmosDB.Models.CassandraViewGetPropertiesOptions options = null, Azure.ResourceManager.Models.ManagedServiceIdentity identity = null) { throw null; } + public static Azure.ResourceManager.CosmosDB.CopyJobGetResultData CopyJobGetResultData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.CosmosDB.Models.CopyJobProperties properties = null) { throw null; } + public static Azure.ResourceManager.CosmosDB.Models.CopyJobProperties CopyJobProperties(Azure.ResourceManager.CosmosDB.Models.BaseCopyJobProperties jobProperties = null, Azure.ResourceManager.CosmosDB.Models.CopyJobStatus? status = default(Azure.ResourceManager.CosmosDB.Models.CopyJobStatus?), long? processedCount = default(long?), long? totalCount = default(long?), System.DateTimeOffset? lastUpdatedUtcOn = default(System.DateTimeOffset?), int? workerCount = default(int?), Azure.ResourceManager.CosmosDB.Models.CosmosDBErrorResult error = null, System.TimeSpan? duration = default(System.TimeSpan?), Azure.ResourceManager.CosmosDB.Models.CopyJobMode? mode = default(Azure.ResourceManager.CosmosDB.Models.CopyJobMode?)) { throw null; } public static Azure.ResourceManager.CosmosDB.Models.CosmosDBAccountConnectionString CosmosDBAccountConnectionString(string connectionString = null, string description = null, Azure.ResourceManager.CosmosDB.Models.CosmosDBKind? keyKind = default(Azure.ResourceManager.CosmosDB.Models.CosmosDBKind?), Azure.ResourceManager.CosmosDB.Models.CosmosDBType? keyType = default(Azure.ResourceManager.CosmosDB.Models.CosmosDBType?)) { throw null; } - public static Azure.ResourceManager.CosmosDB.Models.CosmosDBAccountCreateOrUpdateContent CosmosDBAccountCreateOrUpdateContent(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.CosmosDB.Models.CosmosDBAccountKind? kind = default(Azure.ResourceManager.CosmosDB.Models.CosmosDBAccountKind?), Azure.ResourceManager.CosmosDB.Models.ConsistencyPolicy consistencyPolicy = null, System.Collections.Generic.IEnumerable locations = null, Azure.ResourceManager.CosmosDB.Models.CosmosDBAccountOfferType databaseAccountOfferType = default(Azure.ResourceManager.CosmosDB.Models.CosmosDBAccountOfferType), System.Collections.Generic.IEnumerable ipRules = null, bool? isVirtualNetworkFilterEnabled = default(bool?), bool? enableAutomaticFailover = default(bool?), System.Collections.Generic.IEnumerable capabilities = null, System.Collections.Generic.IEnumerable virtualNetworkRules = null, bool? enableMultipleWriteLocations = default(bool?), bool? enableCassandraConnector = default(bool?), Azure.ResourceManager.CosmosDB.Models.ConnectorOffer? connectorOffer = default(Azure.ResourceManager.CosmosDB.Models.ConnectorOffer?), bool? disableKeyBasedMetadataWriteAccess = default(bool?), System.Uri keyVaultKeyUri = null, string defaultIdentity = null, Azure.ResourceManager.CosmosDB.Models.CosmosDBPublicNetworkAccess? publicNetworkAccess = default(Azure.ResourceManager.CosmosDB.Models.CosmosDBPublicNetworkAccess?), bool? isFreeTierEnabled = default(bool?), Azure.ResourceManager.CosmosDB.Models.CosmosDBServerVersion? apiServerVersion = default(Azure.ResourceManager.CosmosDB.Models.CosmosDBServerVersion?), bool? isAnalyticalStorageEnabled = default(bool?), Azure.ResourceManager.CosmosDB.Models.AnalyticalStorageSchemaType? analyticalStorageSchemaType = default(Azure.ResourceManager.CosmosDB.Models.AnalyticalStorageSchemaType?), Azure.ResourceManager.CosmosDB.Models.CosmosDBAccountCreateMode? createMode = default(Azure.ResourceManager.CosmosDB.Models.CosmosDBAccountCreateMode?), Azure.ResourceManager.CosmosDB.Models.CosmosDBAccountBackupPolicy backupPolicy = null, System.Collections.Generic.IEnumerable cors = null, Azure.ResourceManager.CosmosDB.Models.NetworkAclBypass? networkAclBypass = default(Azure.ResourceManager.CosmosDB.Models.NetworkAclBypass?), System.Collections.Generic.IEnumerable networkAclBypassResourceIds = null, Azure.ResourceManager.CosmosDB.Models.EnableFullTextQuery? diagnosticLogEnableFullTextQuery = default(Azure.ResourceManager.CosmosDB.Models.EnableFullTextQuery?), bool? disableLocalAuth = default(bool?), Azure.ResourceManager.CosmosDB.Models.CosmosDBAccountRestoreParameters restoreParameters = null, int? capacityTotalThroughputLimit = default(int?), Azure.ResourceManager.CosmosDB.Models.CapacityMode? capacityMode = default(Azure.ResourceManager.CosmosDB.Models.CapacityMode?), bool? enableMaterializedViews = default(bool?), Azure.ResourceManager.CosmosDB.Models.DatabaseAccountKeysMetadata keysMetadata = null, bool? enablePartitionMerge = default(bool?), bool? enableBurstCapacity = default(bool?), Azure.ResourceManager.CosmosDB.Models.CosmosDBMinimalTlsVersion? minimalTlsVersion = default(Azure.ResourceManager.CosmosDB.Models.CosmosDBMinimalTlsVersion?), string customerManagedKeyStatus = null, bool? enablePriorityBasedExecution = default(bool?), Azure.ResourceManager.CosmosDB.Models.DefaultPriorityLevel? defaultPriorityLevel = default(Azure.ResourceManager.CosmosDB.Models.DefaultPriorityLevel?), bool? enablePerRegionPerPartitionAutoscale = default(bool?), Azure.ResourceManager.Models.ManagedServiceIdentity identity = null) { throw null; } - public static Azure.ResourceManager.CosmosDB.CosmosDBAccountData CosmosDBAccountData(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.CosmosDB.Models.CosmosDBAccountKind? kind = default(Azure.ResourceManager.CosmosDB.Models.CosmosDBAccountKind?), string provisioningState = null, string documentEndpoint = null, Azure.ResourceManager.CosmosDB.Models.CosmosDBAccountOfferType? databaseAccountOfferType = default(Azure.ResourceManager.CosmosDB.Models.CosmosDBAccountOfferType?), System.Collections.Generic.IEnumerable ipRules = null, bool? isVirtualNetworkFilterEnabled = default(bool?), bool? enableAutomaticFailover = default(bool?), Azure.ResourceManager.CosmosDB.Models.ConsistencyPolicy consistencyPolicy = null, System.Collections.Generic.IEnumerable capabilities = null, System.Collections.Generic.IEnumerable writeLocations = null, System.Collections.Generic.IEnumerable readLocations = null, System.Collections.Generic.IEnumerable locations = null, System.Collections.Generic.IEnumerable failoverPolicies = null, System.Collections.Generic.IEnumerable virtualNetworkRules = null, System.Collections.Generic.IEnumerable privateEndpointConnections = null, bool? enableMultipleWriteLocations = default(bool?), bool? enableCassandraConnector = default(bool?), Azure.ResourceManager.CosmosDB.Models.ConnectorOffer? connectorOffer = default(Azure.ResourceManager.CosmosDB.Models.ConnectorOffer?), bool? disableKeyBasedMetadataWriteAccess = default(bool?), System.Uri keyVaultKeyUri = null, string defaultIdentity = null, Azure.ResourceManager.CosmosDB.Models.CosmosDBPublicNetworkAccess? publicNetworkAccess = default(Azure.ResourceManager.CosmosDB.Models.CosmosDBPublicNetworkAccess?), bool? isFreeTierEnabled = default(bool?), Azure.ResourceManager.CosmosDB.Models.CosmosDBServerVersion? apiServerVersion = default(Azure.ResourceManager.CosmosDB.Models.CosmosDBServerVersion?), bool? isAnalyticalStorageEnabled = default(bool?), Azure.ResourceManager.CosmosDB.Models.AnalyticalStorageSchemaType? analyticalStorageSchemaType = default(Azure.ResourceManager.CosmosDB.Models.AnalyticalStorageSchemaType?), System.Guid? instanceId = default(System.Guid?), Azure.ResourceManager.CosmosDB.Models.CosmosDBAccountCreateMode? createMode = default(Azure.ResourceManager.CosmosDB.Models.CosmosDBAccountCreateMode?), Azure.ResourceManager.CosmosDB.Models.CosmosDBAccountRestoreParameters restoreParameters = null, Azure.ResourceManager.CosmosDB.Models.CosmosDBAccountBackupPolicy backupPolicy = null, System.Collections.Generic.IEnumerable cors = null, Azure.ResourceManager.CosmosDB.Models.NetworkAclBypass? networkAclBypass = default(Azure.ResourceManager.CosmosDB.Models.NetworkAclBypass?), System.Collections.Generic.IEnumerable networkAclBypassResourceIds = null, Azure.ResourceManager.CosmosDB.Models.EnableFullTextQuery? diagnosticLogEnableFullTextQuery = default(Azure.ResourceManager.CosmosDB.Models.EnableFullTextQuery?), bool? disableLocalAuth = default(bool?), int? capacityTotalThroughputLimit = default(int?), Azure.ResourceManager.CosmosDB.Models.CapacityMode? capacityMode = default(Azure.ResourceManager.CosmosDB.Models.CapacityMode?), Azure.ResourceManager.CosmosDB.Models.CapacityModeChangeTransitionState capacityModeChangeTransitionState = null, bool? enableMaterializedViews = default(bool?), Azure.ResourceManager.CosmosDB.Models.DatabaseAccountKeysMetadata keysMetadata = null, bool? enablePartitionMerge = default(bool?), bool? enableBurstCapacity = default(bool?), Azure.ResourceManager.CosmosDB.Models.CosmosDBMinimalTlsVersion? minimalTlsVersion = default(Azure.ResourceManager.CosmosDB.Models.CosmosDBMinimalTlsVersion?), string customerManagedKeyStatus = null, bool? enablePriorityBasedExecution = default(bool?), Azure.ResourceManager.CosmosDB.Models.DefaultPriorityLevel? defaultPriorityLevel = default(Azure.ResourceManager.CosmosDB.Models.DefaultPriorityLevel?), bool? enablePerRegionPerPartitionAutoscale = default(bool?), Azure.ResourceManager.Models.ManagedServiceIdentity identity = null) { throw null; } + public static Azure.ResourceManager.CosmosDB.Models.CosmosDBAccountCreateOrUpdateContent CosmosDBAccountCreateOrUpdateContent(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.CosmosDB.Models.CosmosDBAccountKind? kind = default(Azure.ResourceManager.CosmosDB.Models.CosmosDBAccountKind?), Azure.ResourceManager.CosmosDB.Models.ConsistencyPolicy consistencyPolicy = null, System.Collections.Generic.IEnumerable locations = null, Azure.ResourceManager.CosmosDB.Models.CosmosDBAccountOfferType databaseAccountOfferType = default(Azure.ResourceManager.CosmosDB.Models.CosmosDBAccountOfferType), System.Collections.Generic.IEnumerable ipRules = null, bool? isVirtualNetworkFilterEnabled = default(bool?), bool? enableAutomaticFailover = default(bool?), System.Collections.Generic.IEnumerable capabilities = null, System.Collections.Generic.IEnumerable virtualNetworkRules = null, bool? enableMultipleWriteLocations = default(bool?), bool? enableCassandraConnector = default(bool?), Azure.ResourceManager.CosmosDB.Models.ConnectorOffer? connectorOffer = default(Azure.ResourceManager.CosmosDB.Models.ConnectorOffer?), bool? disableKeyBasedMetadataWriteAccess = default(bool?), System.Uri keyVaultKeyUri = null, string defaultIdentity = null, Azure.ResourceManager.CosmosDB.Models.CosmosDBPublicNetworkAccess? publicNetworkAccess = default(Azure.ResourceManager.CosmosDB.Models.CosmosDBPublicNetworkAccess?), bool? isFreeTierEnabled = default(bool?), Azure.ResourceManager.CosmosDB.Models.CosmosDBServerVersion? apiServerVersion = default(Azure.ResourceManager.CosmosDB.Models.CosmosDBServerVersion?), bool? isAnalyticalStorageEnabled = default(bool?), Azure.ResourceManager.CosmosDB.Models.AnalyticalStorageSchemaType? analyticalStorageSchemaType = default(Azure.ResourceManager.CosmosDB.Models.AnalyticalStorageSchemaType?), Azure.ResourceManager.CosmosDB.Models.CosmosDBAccountCreateMode? createMode = default(Azure.ResourceManager.CosmosDB.Models.CosmosDBAccountCreateMode?), Azure.ResourceManager.CosmosDB.Models.CosmosDBAccountBackupPolicy backupPolicy = null, System.Collections.Generic.IEnumerable cors = null, Azure.ResourceManager.CosmosDB.Models.NetworkAclBypass? networkAclBypass = default(Azure.ResourceManager.CosmosDB.Models.NetworkAclBypass?), System.Collections.Generic.IEnumerable networkAclBypassResourceIds = null, Azure.ResourceManager.CosmosDB.Models.EnableFullTextQuery? diagnosticLogEnableFullTextQuery = default(Azure.ResourceManager.CosmosDB.Models.EnableFullTextQuery?), bool? disableLocalAuth = default(bool?), Azure.ResourceManager.CosmosDB.Models.CosmosDBAccountRestoreParameters restoreParameters = null, int? capacityTotalThroughputLimit = default(int?), Azure.ResourceManager.CosmosDB.Models.CapacityMode? capacityMode = default(Azure.ResourceManager.CosmosDB.Models.CapacityMode?), bool? enableMaterializedViews = default(bool?), Azure.ResourceManager.CosmosDB.Models.DatabaseAccountKeysMetadata keysMetadata = null, bool? enablePartitionMerge = default(bool?), bool? enableBurstCapacity = default(bool?), Azure.ResourceManager.CosmosDB.Models.CosmosDBMinimalTlsVersion? minimalTlsVersion = default(Azure.ResourceManager.CosmosDB.Models.CosmosDBMinimalTlsVersion?), string customerManagedKeyStatus = null, bool? enablePriorityBasedExecution = default(bool?), Azure.ResourceManager.CosmosDB.Models.DefaultPriorityLevel? defaultPriorityLevel = default(Azure.ResourceManager.CosmosDB.Models.DefaultPriorityLevel?), bool? enablePerRegionPerPartitionAutoscale = default(bool?), bool? enableAllVersionsAndDeletesChangeFeed = default(bool?), Azure.ResourceManager.Models.ManagedServiceIdentity identity = null) { throw null; } + public static Azure.ResourceManager.CosmosDB.CosmosDBAccountData CosmosDBAccountData(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.CosmosDB.Models.CosmosDBAccountKind? kind = default(Azure.ResourceManager.CosmosDB.Models.CosmosDBAccountKind?), string provisioningState = null, string documentEndpoint = null, Azure.ResourceManager.CosmosDB.Models.CosmosDBAccountOfferType? databaseAccountOfferType = default(Azure.ResourceManager.CosmosDB.Models.CosmosDBAccountOfferType?), System.Collections.Generic.IEnumerable ipRules = null, bool? isVirtualNetworkFilterEnabled = default(bool?), bool? enableAutomaticFailover = default(bool?), Azure.ResourceManager.CosmosDB.Models.ConsistencyPolicy consistencyPolicy = null, System.Collections.Generic.IEnumerable capabilities = null, System.Collections.Generic.IEnumerable writeLocations = null, System.Collections.Generic.IEnumerable readLocations = null, System.Collections.Generic.IEnumerable locations = null, System.Collections.Generic.IEnumerable failoverPolicies = null, System.Collections.Generic.IEnumerable virtualNetworkRules = null, System.Collections.Generic.IEnumerable privateEndpointConnections = null, bool? enableMultipleWriteLocations = default(bool?), bool? enableCassandraConnector = default(bool?), Azure.ResourceManager.CosmosDB.Models.ConnectorOffer? connectorOffer = default(Azure.ResourceManager.CosmosDB.Models.ConnectorOffer?), bool? disableKeyBasedMetadataWriteAccess = default(bool?), System.Uri keyVaultKeyUri = null, string defaultIdentity = null, Azure.ResourceManager.CosmosDB.Models.CosmosDBPublicNetworkAccess? publicNetworkAccess = default(Azure.ResourceManager.CosmosDB.Models.CosmosDBPublicNetworkAccess?), bool? isFreeTierEnabled = default(bool?), Azure.ResourceManager.CosmosDB.Models.CosmosDBServerVersion? apiServerVersion = default(Azure.ResourceManager.CosmosDB.Models.CosmosDBServerVersion?), bool? isAnalyticalStorageEnabled = default(bool?), Azure.ResourceManager.CosmosDB.Models.AnalyticalStorageSchemaType? analyticalStorageSchemaType = default(Azure.ResourceManager.CosmosDB.Models.AnalyticalStorageSchemaType?), System.Guid? instanceId = default(System.Guid?), Azure.ResourceManager.CosmosDB.Models.CosmosDBAccountCreateMode? createMode = default(Azure.ResourceManager.CosmosDB.Models.CosmosDBAccountCreateMode?), Azure.ResourceManager.CosmosDB.Models.CosmosDBAccountRestoreParameters restoreParameters = null, Azure.ResourceManager.CosmosDB.Models.CosmosDBAccountBackupPolicy backupPolicy = null, System.Collections.Generic.IEnumerable cors = null, Azure.ResourceManager.CosmosDB.Models.NetworkAclBypass? networkAclBypass = default(Azure.ResourceManager.CosmosDB.Models.NetworkAclBypass?), System.Collections.Generic.IEnumerable networkAclBypassResourceIds = null, Azure.ResourceManager.CosmosDB.Models.EnableFullTextQuery? diagnosticLogEnableFullTextQuery = default(Azure.ResourceManager.CosmosDB.Models.EnableFullTextQuery?), bool? disableLocalAuth = default(bool?), int? capacityTotalThroughputLimit = default(int?), Azure.ResourceManager.CosmosDB.Models.CapacityMode? capacityMode = default(Azure.ResourceManager.CosmosDB.Models.CapacityMode?), Azure.ResourceManager.CosmosDB.Models.CapacityModeChangeTransitionState capacityModeChangeTransitionState = null, bool? enableMaterializedViews = default(bool?), Azure.ResourceManager.CosmosDB.Models.DatabaseAccountKeysMetadata keysMetadata = null, bool? enablePartitionMerge = default(bool?), bool? enableBurstCapacity = default(bool?), Azure.ResourceManager.CosmosDB.Models.CosmosDBMinimalTlsVersion? minimalTlsVersion = default(Azure.ResourceManager.CosmosDB.Models.CosmosDBMinimalTlsVersion?), string customerManagedKeyStatus = null, bool? enablePriorityBasedExecution = default(bool?), Azure.ResourceManager.CosmosDB.Models.DefaultPriorityLevel? defaultPriorityLevel = default(Azure.ResourceManager.CosmosDB.Models.DefaultPriorityLevel?), bool? enablePerRegionPerPartitionAutoscale = default(bool?), bool? enableAllVersionsAndDeletesChangeFeed = default(bool?), Azure.ResourceManager.Models.ManagedServiceIdentity identity = null) { throw null; } public static Azure.ResourceManager.CosmosDB.Models.CosmosDBAccountKeyList CosmosDBAccountKeyList(string primaryReadonlyMasterKey = null, string secondaryReadonlyMasterKey = null, string primaryMasterKey = null, string secondaryMasterKey = null) { throw null; } public static Azure.ResourceManager.CosmosDB.Models.CosmosDBAccountLocation CosmosDBAccountLocation(string id = null, Azure.Core.AzureLocation? locationName = default(Azure.Core.AzureLocation?), string documentEndpoint = null, string provisioningState = null, int? failoverPriority = default(int?), bool? isZoneRedundant = default(bool?)) { throw null; } - public static Azure.ResourceManager.CosmosDB.Models.CosmosDBAccountPatch CosmosDBAccountPatch(System.Collections.Generic.IDictionary tags = null, Azure.Core.AzureLocation? location = default(Azure.Core.AzureLocation?), Azure.ResourceManager.Models.ManagedServiceIdentity identity = null, Azure.ResourceManager.CosmosDB.Models.ConsistencyPolicy consistencyPolicy = null, System.Collections.Generic.IEnumerable locations = null, System.Collections.Generic.IEnumerable ipRules = null, bool? isVirtualNetworkFilterEnabled = default(bool?), bool? enableAutomaticFailover = default(bool?), System.Collections.Generic.IEnumerable capabilities = null, System.Collections.Generic.IEnumerable virtualNetworkRules = null, bool? enableMultipleWriteLocations = default(bool?), bool? enableCassandraConnector = default(bool?), Azure.ResourceManager.CosmosDB.Models.ConnectorOffer? connectorOffer = default(Azure.ResourceManager.CosmosDB.Models.ConnectorOffer?), bool? disableKeyBasedMetadataWriteAccess = default(bool?), System.Uri keyVaultKeyUri = null, string defaultIdentity = null, Azure.ResourceManager.CosmosDB.Models.CosmosDBPublicNetworkAccess? publicNetworkAccess = default(Azure.ResourceManager.CosmosDB.Models.CosmosDBPublicNetworkAccess?), bool? isFreeTierEnabled = default(bool?), Azure.ResourceManager.CosmosDB.Models.CosmosDBServerVersion? apiServerVersion = default(Azure.ResourceManager.CosmosDB.Models.CosmosDBServerVersion?), bool? isAnalyticalStorageEnabled = default(bool?), Azure.ResourceManager.CosmosDB.Models.AnalyticalStorageSchemaType? analyticalStorageSchemaType = default(Azure.ResourceManager.CosmosDB.Models.AnalyticalStorageSchemaType?), Azure.ResourceManager.CosmosDB.Models.CosmosDBAccountBackupPolicy backupPolicy = null, System.Collections.Generic.IEnumerable cors = null, Azure.ResourceManager.CosmosDB.Models.NetworkAclBypass? networkAclBypass = default(Azure.ResourceManager.CosmosDB.Models.NetworkAclBypass?), System.Collections.Generic.IEnumerable networkAclBypassResourceIds = null, Azure.ResourceManager.CosmosDB.Models.EnableFullTextQuery? diagnosticLogEnableFullTextQuery = default(Azure.ResourceManager.CosmosDB.Models.EnableFullTextQuery?), bool? disableLocalAuth = default(bool?), int? capacityTotalThroughputLimit = default(int?), Azure.ResourceManager.CosmosDB.Models.CapacityMode? capacityMode = default(Azure.ResourceManager.CosmosDB.Models.CapacityMode?), bool? enableMaterializedViews = default(bool?), Azure.ResourceManager.CosmosDB.Models.DatabaseAccountKeysMetadata keysMetadata = null, bool? enablePartitionMerge = default(bool?), bool? enableBurstCapacity = default(bool?), Azure.ResourceManager.CosmosDB.Models.CosmosDBMinimalTlsVersion? minimalTlsVersion = default(Azure.ResourceManager.CosmosDB.Models.CosmosDBMinimalTlsVersion?), string customerManagedKeyStatus = null, bool? enablePriorityBasedExecution = default(bool?), Azure.ResourceManager.CosmosDB.Models.DefaultPriorityLevel? defaultPriorityLevel = default(Azure.ResourceManager.CosmosDB.Models.DefaultPriorityLevel?), bool? enablePerRegionPerPartitionAutoscale = default(bool?)) { throw null; } + public static Azure.ResourceManager.CosmosDB.Models.CosmosDBAccountPatch CosmosDBAccountPatch(System.Collections.Generic.IDictionary tags = null, Azure.Core.AzureLocation? location = default(Azure.Core.AzureLocation?), Azure.ResourceManager.Models.ManagedServiceIdentity identity = null, Azure.ResourceManager.CosmosDB.Models.ConsistencyPolicy consistencyPolicy = null, System.Collections.Generic.IEnumerable locations = null, System.Collections.Generic.IEnumerable ipRules = null, bool? isVirtualNetworkFilterEnabled = default(bool?), bool? enableAutomaticFailover = default(bool?), System.Collections.Generic.IEnumerable capabilities = null, System.Collections.Generic.IEnumerable virtualNetworkRules = null, bool? enableMultipleWriteLocations = default(bool?), bool? enableCassandraConnector = default(bool?), Azure.ResourceManager.CosmosDB.Models.ConnectorOffer? connectorOffer = default(Azure.ResourceManager.CosmosDB.Models.ConnectorOffer?), bool? disableKeyBasedMetadataWriteAccess = default(bool?), System.Uri keyVaultKeyUri = null, string defaultIdentity = null, Azure.ResourceManager.CosmosDB.Models.CosmosDBPublicNetworkAccess? publicNetworkAccess = default(Azure.ResourceManager.CosmosDB.Models.CosmosDBPublicNetworkAccess?), bool? isFreeTierEnabled = default(bool?), Azure.ResourceManager.CosmosDB.Models.CosmosDBServerVersion? apiServerVersion = default(Azure.ResourceManager.CosmosDB.Models.CosmosDBServerVersion?), bool? isAnalyticalStorageEnabled = default(bool?), Azure.ResourceManager.CosmosDB.Models.AnalyticalStorageSchemaType? analyticalStorageSchemaType = default(Azure.ResourceManager.CosmosDB.Models.AnalyticalStorageSchemaType?), Azure.ResourceManager.CosmosDB.Models.CosmosDBAccountBackupPolicy backupPolicy = null, System.Collections.Generic.IEnumerable cors = null, Azure.ResourceManager.CosmosDB.Models.NetworkAclBypass? networkAclBypass = default(Azure.ResourceManager.CosmosDB.Models.NetworkAclBypass?), System.Collections.Generic.IEnumerable networkAclBypassResourceIds = null, Azure.ResourceManager.CosmosDB.Models.EnableFullTextQuery? diagnosticLogEnableFullTextQuery = default(Azure.ResourceManager.CosmosDB.Models.EnableFullTextQuery?), bool? disableLocalAuth = default(bool?), int? capacityTotalThroughputLimit = default(int?), Azure.ResourceManager.CosmosDB.Models.CapacityMode? capacityMode = default(Azure.ResourceManager.CosmosDB.Models.CapacityMode?), bool? enableMaterializedViews = default(bool?), Azure.ResourceManager.CosmosDB.Models.DatabaseAccountKeysMetadata keysMetadata = null, bool? enablePartitionMerge = default(bool?), bool? enableBurstCapacity = default(bool?), Azure.ResourceManager.CosmosDB.Models.CosmosDBMinimalTlsVersion? minimalTlsVersion = default(Azure.ResourceManager.CosmosDB.Models.CosmosDBMinimalTlsVersion?), string customerManagedKeyStatus = null, bool? enablePriorityBasedExecution = default(bool?), Azure.ResourceManager.CosmosDB.Models.DefaultPriorityLevel? defaultPriorityLevel = default(Azure.ResourceManager.CosmosDB.Models.DefaultPriorityLevel?), bool? enablePerRegionPerPartitionAutoscale = default(bool?), bool? enableAllVersionsAndDeletesChangeFeed = default(bool?)) { throw null; } public static Azure.ResourceManager.CosmosDB.Models.CosmosDBAccountReadOnlyKeyList CosmosDBAccountReadOnlyKeyList(string primaryReadonlyMasterKey = null, string secondaryReadonlyMasterKey = null) { throw null; } public static Azure.ResourceManager.CosmosDB.Models.CosmosDBBackupInformation CosmosDBBackupInformation(System.DateTimeOffset? continuousBackupInformationLatestRestorableTimestamp = default(System.DateTimeOffset?)) { throw null; } public static Azure.ResourceManager.CosmosDB.Models.CosmosDBBaseMetric CosmosDBBaseMetric(System.DateTimeOffset? startOn = default(System.DateTimeOffset?), System.DateTimeOffset? endOn = default(System.DateTimeOffset?), string timeGrain = null, Azure.ResourceManager.CosmosDB.Models.CosmosDBMetricUnitType? unit = default(Azure.ResourceManager.CosmosDB.Models.CosmosDBMetricUnitType?), Azure.ResourceManager.CosmosDB.Models.CosmosDBMetricName name = null, System.Collections.Generic.IEnumerable metricValues = null) { throw null; } @@ -2621,7 +3242,7 @@ public static partial class ArmCosmosDBModelFactory public static Azure.ResourceManager.CosmosDB.Models.DataTransferServiceProperties DataTransferServiceProperties(System.DateTimeOffset? createdOn = default(System.DateTimeOffset?), Azure.ResourceManager.CosmosDB.Models.CosmosDBServiceSize? instanceSize = default(Azure.ResourceManager.CosmosDB.Models.CosmosDBServiceSize?), int? instanceCount = default(int?), Azure.ResourceManager.CosmosDB.Models.CosmosDBServiceStatus? status = default(Azure.ResourceManager.CosmosDB.Models.CosmosDBServiceStatus?), System.Collections.Generic.IDictionary additionalProperties = null, System.Collections.Generic.IEnumerable locations = null) { throw null; } public static Azure.ResourceManager.CosmosDB.Models.ExtendedCassandraKeyspaceResourceInfo ExtendedCassandraKeyspaceResourceInfo(string keyspaceName = null, string rid = null, float? timestamp = default(float?), Azure.ETag? etag = default(Azure.ETag?)) { throw null; } public static Azure.ResourceManager.CosmosDB.Models.ExtendedCassandraTableResourceInfo ExtendedCassandraTableResourceInfo(string tableName = null, int? defaultTtl = default(int?), Azure.ResourceManager.CosmosDB.Models.CassandraSchema schema = null, int? analyticalStorageTtl = default(int?), string rid = null, float? timestamp = default(float?), Azure.ETag? etag = default(Azure.ETag?)) { throw null; } - public static Azure.ResourceManager.CosmosDB.Models.ExtendedCosmosDBSqlContainerResourceInfo ExtendedCosmosDBSqlContainerResourceInfo(string containerName = null, Azure.ResourceManager.CosmosDB.Models.CosmosDBIndexingPolicy indexingPolicy = null, Azure.ResourceManager.CosmosDB.Models.CosmosDBContainerPartitionKey partitionKey = null, int? defaultTtl = default(int?), System.Collections.Generic.IEnumerable uniqueKeys = null, Azure.ResourceManager.CosmosDB.Models.ConflictResolutionPolicy conflictResolutionPolicy = null, Azure.ResourceManager.CosmosDB.Models.CosmosDBClientEncryptionPolicy clientEncryptionPolicy = null, long? analyticalStorageTtl = default(long?), Azure.ResourceManager.CosmosDB.Models.ResourceRestoreParameters restoreParameters = null, Azure.ResourceManager.CosmosDB.Models.CosmosDBAccountCreateMode? createMode = default(Azure.ResourceManager.CosmosDB.Models.CosmosDBAccountCreateMode?), Azure.ResourceManager.CosmosDB.Models.MaterializedViewDefinition materializedViewDefinition = null, System.Collections.Generic.IEnumerable computedProperties = null, System.Collections.Generic.IEnumerable vectorEmbeddings = null, string rid = null, float? timestamp = default(float?), Azure.ETag? etag = default(Azure.ETag?)) { throw null; } + public static Azure.ResourceManager.CosmosDB.Models.ExtendedCosmosDBSqlContainerResourceInfo ExtendedCosmosDBSqlContainerResourceInfo(string containerName = null, Azure.ResourceManager.CosmosDB.Models.CosmosDBIndexingPolicy indexingPolicy = null, Azure.ResourceManager.CosmosDB.Models.CosmosDBContainerPartitionKey partitionKey = null, int? defaultTtl = default(int?), System.Collections.Generic.IEnumerable uniqueKeys = null, Azure.ResourceManager.CosmosDB.Models.ConflictResolutionPolicy conflictResolutionPolicy = null, Azure.ResourceManager.CosmosDB.Models.CosmosDBClientEncryptionPolicy clientEncryptionPolicy = null, long? analyticalStorageTtl = default(long?), Azure.ResourceManager.CosmosDB.Models.ResourceRestoreParameters restoreParameters = null, Azure.ResourceManager.CosmosDB.Models.CosmosDBAccountCreateMode? createMode = default(Azure.ResourceManager.CosmosDB.Models.CosmosDBAccountCreateMode?), Azure.ResourceManager.CosmosDB.Models.MaterializedViewDefinition materializedViewDefinition = null, System.Collections.Generic.IEnumerable materializedViews = null, System.Collections.Generic.IEnumerable computedProperties = null, System.Collections.Generic.IEnumerable vectorEmbeddings = null, Azure.ResourceManager.CosmosDB.Models.FullTextPolicy fullTextPolicy = null, string rid = null, float? timestamp = default(float?), Azure.ETag? etag = default(Azure.ETag?)) { throw null; } public static Azure.ResourceManager.CosmosDB.Models.ExtendedCosmosDBSqlDatabaseResourceInfo ExtendedCosmosDBSqlDatabaseResourceInfo(string databaseName = null, Azure.ResourceManager.CosmosDB.Models.ResourceRestoreParameters restoreParameters = null, Azure.ResourceManager.CosmosDB.Models.CosmosDBAccountCreateMode? createMode = default(Azure.ResourceManager.CosmosDB.Models.CosmosDBAccountCreateMode?), string colls = null, string users = null, string rid = null, float? timestamp = default(float?), Azure.ETag? etag = default(Azure.ETag?)) { throw null; } public static Azure.ResourceManager.CosmosDB.Models.ExtendedCosmosDBSqlStoredProcedureResourceInfo ExtendedCosmosDBSqlStoredProcedureResourceInfo(string storedProcedureName = null, string body = null, string rid = null, float? timestamp = default(float?), Azure.ETag? etag = default(Azure.ETag?)) { throw null; } public static Azure.ResourceManager.CosmosDB.Models.ExtendedCosmosDBSqlTriggerResourceInfo ExtendedCosmosDBSqlTriggerResourceInfo(string triggerName = null, string body = null, Azure.ResourceManager.CosmosDB.Models.CosmosDBSqlTriggerType? triggerType = default(Azure.ResourceManager.CosmosDB.Models.CosmosDBSqlTriggerType?), Azure.ResourceManager.CosmosDB.Models.CosmosDBSqlTriggerOperation? triggerOperation = default(Azure.ResourceManager.CosmosDB.Models.CosmosDBSqlTriggerOperation?), string rid = null, float? timestamp = default(float?), Azure.ETag? etag = default(Azure.ETag?)) { throw null; } @@ -2638,6 +3259,10 @@ public static partial class ArmCosmosDBModelFactory public static Azure.ResourceManager.CosmosDB.Models.ExtendedRestorableSqlDatabaseResourceInfo ExtendedRestorableSqlDatabaseResourceInfo(string rid = null, Azure.ResourceManager.CosmosDB.Models.CosmosDBOperationType? operationType = default(Azure.ResourceManager.CosmosDB.Models.CosmosDBOperationType?), string canUndelete = null, string canUndeleteReason = null, string eventTimestamp = null, string databaseName = null, string databaseId = null, Azure.ResourceManager.CosmosDB.Models.RestorableSqlDatabasePropertiesResourceDatabase database = null) { throw null; } public static Azure.ResourceManager.CosmosDB.Models.ExtendedRestorableTableResourceInfo ExtendedRestorableTableResourceInfo(string rid = null, Azure.ResourceManager.CosmosDB.Models.CosmosDBOperationType? operationType = default(Azure.ResourceManager.CosmosDB.Models.CosmosDBOperationType?), string canUndelete = null, string canUndeleteReason = null, string eventTimestamp = null, string tableName = null, string tableId = null) { throw null; } public static Azure.ResourceManager.CosmosDB.Models.ExtendedThroughputSettingsResourceInfo ExtendedThroughputSettingsResourceInfo(int? throughput = default(int?), Azure.ResourceManager.CosmosDB.Models.AutoscaleSettingsResourceInfo autoscaleSettings = null, string minimumThroughput = null, string offerReplacePending = null, string instantMaximumThroughput = null, string softAllowedMaximumThroughput = null, System.Collections.Generic.IEnumerable throughputBuckets = null, string rid = null, float? timestamp = default(float?), Azure.ETag? etag = default(Azure.ETag?)) { throw null; } + public static Azure.ResourceManager.CosmosDB.FleetAnalyticsResourceData FleetAnalyticsResourceData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.CosmosDB.Models.CosmosDBStatus? provisioningState = default(Azure.ResourceManager.CosmosDB.Models.CosmosDBStatus?), Azure.ResourceManager.CosmosDB.Models.FleetAnalyticsPropertiesStorageLocationType? storageLocationType = default(Azure.ResourceManager.CosmosDB.Models.FleetAnalyticsPropertiesStorageLocationType?), System.Uri storageLocationUri = null) { throw null; } + public static Azure.ResourceManager.CosmosDB.FleetResourceData FleetResourceData(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.CosmosDB.Models.CosmosDBStatus? provisioningState = default(Azure.ResourceManager.CosmosDB.Models.CosmosDBStatus?)) { throw null; } + public static Azure.ResourceManager.CosmosDB.FleetspaceAccountResourceData FleetspaceAccountResourceData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.CosmosDB.Models.CosmosDBStatus? provisioningState = default(Azure.ResourceManager.CosmosDB.Models.CosmosDBStatus?), string accountResourceIdentifier = null, string accountLocation = null) { throw null; } + public static Azure.ResourceManager.CosmosDB.FleetspaceResourceData FleetspaceResourceData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.CosmosDB.Models.CosmosDBStatus? provisioningState = default(Azure.ResourceManager.CosmosDB.Models.CosmosDBStatus?), Azure.ResourceManager.CosmosDB.Models.FleetspacePropertiesFleetspaceApiKind? fleetspaceApiKind = default(Azure.ResourceManager.CosmosDB.Models.FleetspacePropertiesFleetspaceApiKind?), Azure.ResourceManager.CosmosDB.Models.FleetspacePropertiesThroughputPoolConfiguration throughputPoolConfiguration = null) { throw null; } public static Azure.ResourceManager.CosmosDB.Models.GraphApiComputeRegionalService GraphApiComputeRegionalService(string name = null, Azure.Core.AzureLocation? location = default(Azure.Core.AzureLocation?), Azure.ResourceManager.CosmosDB.Models.CosmosDBServiceStatus? status = default(Azure.ResourceManager.CosmosDB.Models.CosmosDBServiceStatus?), string graphApiComputeEndpoint = null) { throw null; } public static Azure.ResourceManager.CosmosDB.Models.GraphApiComputeServiceProperties GraphApiComputeServiceProperties(System.DateTimeOffset? createdOn = default(System.DateTimeOffset?), Azure.ResourceManager.CosmosDB.Models.CosmosDBServiceSize? instanceSize = default(Azure.ResourceManager.CosmosDB.Models.CosmosDBServiceSize?), int? instanceCount = default(int?), Azure.ResourceManager.CosmosDB.Models.CosmosDBServiceStatus? status = default(Azure.ResourceManager.CosmosDB.Models.CosmosDBServiceStatus?), System.Collections.Generic.IDictionary additionalProperties = null, string graphApiComputeEndpoint = null, System.Collections.Generic.IEnumerable locations = null) { throw null; } public static Azure.ResourceManager.CosmosDB.Models.GraphResourceGetResultCreateOrUpdateContent GraphResourceGetResultCreateOrUpdateContent(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.Core.ResourceIdentifier resourceId = null, Azure.ResourceManager.CosmosDB.Models.CosmosDBCreateUpdateConfig options = null, Azure.ResourceManager.Models.ManagedServiceIdentity identity = null) { throw null; } @@ -2646,6 +3271,8 @@ public static partial class ArmCosmosDBModelFactory public static Azure.ResourceManager.CosmosDB.GremlinDatabaseData GremlinDatabaseData(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.CosmosDB.Models.ExtendedGremlinDatabaseResourceInfo resource = null, Azure.ResourceManager.CosmosDB.Models.GremlinDatabasePropertiesConfig options = null, Azure.ResourceManager.Models.ManagedServiceIdentity identity = null) { throw null; } public static Azure.ResourceManager.CosmosDB.Models.GremlinGraphCreateOrUpdateContent GremlinGraphCreateOrUpdateContent(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.CosmosDB.Models.GremlinGraphResourceInfo resource = null, Azure.ResourceManager.CosmosDB.Models.CosmosDBCreateUpdateConfig options = null, Azure.ResourceManager.Models.ManagedServiceIdentity identity = null) { throw null; } public static Azure.ResourceManager.CosmosDB.GremlinGraphData GremlinGraphData(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.CosmosDB.Models.ExtendedGremlinGraphResourceInfo resource = null, Azure.ResourceManager.CosmosDB.Models.GremlinGraphPropertiesConfig options = null, Azure.ResourceManager.Models.ManagedServiceIdentity identity = null) { throw null; } + public static Azure.ResourceManager.CosmosDB.GremlinRoleAssignmentResourceData GremlinRoleAssignmentResourceData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, string roleDefinitionId = null, string scope = null, System.Guid? principalId = default(System.Guid?), string provisioningState = null) { throw null; } + public static Azure.ResourceManager.CosmosDB.GremlinRoleDefinitionResourceData GremlinRoleDefinitionResourceData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, string idPropertiesId = null, string roleName = null, Azure.ResourceManager.CosmosDB.Models.CosmosDBSqlRoleDefinitionType? typePropertiesType = default(Azure.ResourceManager.CosmosDB.Models.CosmosDBSqlRoleDefinitionType?), System.Collections.Generic.IEnumerable assignableScopes = null, System.Collections.Generic.IEnumerable permissions = null) { throw null; } public static Azure.ResourceManager.CosmosDB.Models.MaterializedViewDefinition MaterializedViewDefinition(string sourceCollectionRid = null, string sourceCollectionId = null, string definition = null) { throw null; } public static Azure.ResourceManager.CosmosDB.Models.MaterializedViewsBuilderRegionalService MaterializedViewsBuilderRegionalService(string name = null, Azure.Core.AzureLocation? location = default(Azure.Core.AzureLocation?), Azure.ResourceManager.CosmosDB.Models.CosmosDBServiceStatus? status = default(Azure.ResourceManager.CosmosDB.Models.CosmosDBServiceStatus?)) { throw null; } public static Azure.ResourceManager.CosmosDB.Models.MaterializedViewsBuilderServiceProperties MaterializedViewsBuilderServiceProperties(System.DateTimeOffset? createdOn = default(System.DateTimeOffset?), Azure.ResourceManager.CosmosDB.Models.CosmosDBServiceSize? instanceSize = default(Azure.ResourceManager.CosmosDB.Models.CosmosDBServiceSize?), int? instanceCount = default(int?), Azure.ResourceManager.CosmosDB.Models.CosmosDBServiceStatus? status = default(Azure.ResourceManager.CosmosDB.Models.CosmosDBServiceStatus?), System.Collections.Generic.IDictionary additionalProperties = null, System.Collections.Generic.IEnumerable locations = null) { throw null; } @@ -2655,8 +3282,13 @@ public static partial class ArmCosmosDBModelFactory public static Azure.ResourceManager.CosmosDB.MongoDBDatabaseData MongoDBDatabaseData(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.CosmosDB.Models.ExtendedMongoDBDatabaseResourceInfo resource = null, Azure.ResourceManager.CosmosDB.Models.MongoDBDatabasePropertiesConfig options = null, Azure.ResourceManager.Models.ManagedServiceIdentity identity = null) { throw null; } public static Azure.ResourceManager.CosmosDB.MongoDBRoleDefinitionData MongoDBRoleDefinitionData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, string roleName = null, Azure.ResourceManager.CosmosDB.Models.MongoDBRoleDefinitionType? roleDefinitionType = default(Azure.ResourceManager.CosmosDB.Models.MongoDBRoleDefinitionType?), string databaseName = null, System.Collections.Generic.IEnumerable privileges = null, System.Collections.Generic.IEnumerable roles = null) { throw null; } public static Azure.ResourceManager.CosmosDB.MongoDBUserDefinitionData MongoDBUserDefinitionData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, string userName = null, string password = null, string databaseName = null, string customData = null, System.Collections.Generic.IEnumerable roles = null, string mechanisms = null) { throw null; } + public static Azure.ResourceManager.CosmosDB.MongoMIRoleAssignmentResourceData MongoMIRoleAssignmentResourceData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, string roleDefinitionId = null, string scope = null, System.Guid? principalId = default(System.Guid?), string provisioningState = null) { throw null; } + public static Azure.ResourceManager.CosmosDB.MongoMIRoleDefinitionResourceData MongoMIRoleDefinitionResourceData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, string idPropertiesId = null, string roleName = null, Azure.ResourceManager.CosmosDB.Models.CosmosDBSqlRoleDefinitionType? typePropertiesType = default(Azure.ResourceManager.CosmosDB.Models.CosmosDBSqlRoleDefinitionType?), System.Collections.Generic.IEnumerable assignableScopes = null, System.Collections.Generic.IEnumerable permissions = null) { throw null; } + public static Azure.ResourceManager.CosmosDB.Models.MongoRUToMongoRUCopyJobTask MongoRUToMongoRUCopyJobTask(long? totalCount = default(long?), long? processedCount = default(long?), Azure.ResourceManager.CosmosDB.Models.CosmosDBMongoCollection source = null, Azure.ResourceManager.CosmosDB.Models.CosmosDBMongoCollection destination = null) { throw null; } + public static Azure.ResourceManager.CosmosDB.Models.MongoRUToMongoVCoreCopyJobTask MongoRUToMongoVCoreCopyJobTask(long? totalCount = default(long?), long? processedCount = default(long?), Azure.ResourceManager.CosmosDB.Models.CosmosDBMongoCollection source = null, Azure.ResourceManager.CosmosDB.Models.CosmosDBMongoVCoreCollection destination = null) { throw null; } public static Azure.ResourceManager.CosmosDB.NetworkSecurityPerimeterConfigurationData NetworkSecurityPerimeterConfigurationData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.CosmosDB.Models.NetworkSecurityPerimeterConfigurationProperties properties = null) { throw null; } public static Azure.ResourceManager.CosmosDB.Models.NetworkSecurityPerimeterConfigurationProperties NetworkSecurityPerimeterConfigurationProperties(Azure.ResourceManager.CosmosDB.Models.NetworkSecurityPerimeterConfigurationProvisioningState? provisioningState = default(Azure.ResourceManager.CosmosDB.Models.NetworkSecurityPerimeterConfigurationProvisioningState?), System.Collections.Generic.IEnumerable provisioningIssues = null, Azure.ResourceManager.CosmosDB.Models.NetworkSecurityPerimeter networkSecurityPerimeter = null, Azure.ResourceManager.CosmosDB.Models.ResourceAssociation resourceAssociation = null, Azure.ResourceManager.CosmosDB.Models.NetworkSecurityProfile profile = null) { throw null; } + public static Azure.ResourceManager.CosmosDB.Models.NoSqlRUToNoSqlRUCopyJobTask NoSqlRUToNoSqlRUCopyJobTask(long? totalCount = default(long?), long? processedCount = default(long?), Azure.ResourceManager.CosmosDB.Models.CosmosDBNoSqlContainer source = null, Azure.ResourceManager.CosmosDB.Models.CosmosDBNoSqlContainer destination = null) { throw null; } public static Azure.ResourceManager.CosmosDB.Models.PartitionMetric PartitionMetric(System.DateTimeOffset? startOn = default(System.DateTimeOffset?), System.DateTimeOffset? endOn = default(System.DateTimeOffset?), string timeGrain = null, Azure.ResourceManager.CosmosDB.Models.CosmosDBMetricUnitType? unit = default(Azure.ResourceManager.CosmosDB.Models.CosmosDBMetricUnitType?), Azure.ResourceManager.CosmosDB.Models.CosmosDBMetricName name = null, System.Collections.Generic.IEnumerable metricValues = null, System.Guid? partitionId = default(System.Guid?), string partitionKeyRangeId = null) { throw null; } public static Azure.ResourceManager.CosmosDB.Models.PartitionUsage PartitionUsage(Azure.ResourceManager.CosmosDB.Models.CosmosDBMetricUnitType? unit = default(Azure.ResourceManager.CosmosDB.Models.CosmosDBMetricUnitType?), Azure.ResourceManager.CosmosDB.Models.CosmosDBMetricName name = null, string quotaPeriod = null, long? limit = default(long?), long? currentValue = default(long?), System.Guid? partitionId = default(System.Guid?), string partitionKeyRangeId = null) { throw null; } public static Azure.ResourceManager.CosmosDB.Models.PercentileMetricValue PercentileMetricValue(int? count = default(int?), double? average = default(double?), double? maximum = default(double?), double? minimum = default(double?), System.DateTimeOffset? timestamp = default(System.DateTimeOffset?), double? total = default(double?), double? p10 = default(double?), double? p25 = default(double?), double? p50 = default(double?), double? p75 = default(double?), double? p90 = default(double?), double? p95 = default(double?), double? p99 = default(double?)) { throw null; } @@ -2675,7 +3307,7 @@ public static partial class ArmCosmosDBModelFactory public static Azure.ResourceManager.CosmosDB.Models.RestorableMongoDBDatabase RestorableMongoDBDatabase(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.CosmosDB.Models.ExtendedRestorableMongoDBDatabaseResourceInfo resource = null) { throw null; } public static Azure.ResourceManager.CosmosDB.Models.RestorableMongoDBResourceData RestorableMongoDBResourceData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, string databaseName = null, System.Collections.Generic.IEnumerable collectionNames = null) { throw null; } public static Azure.ResourceManager.CosmosDB.Models.RestorableSqlContainer RestorableSqlContainer(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.CosmosDB.Models.ExtendedRestorableSqlContainerResourceInfo resource = null) { throw null; } - public static Azure.ResourceManager.CosmosDB.Models.RestorableSqlContainerPropertiesResourceContainer RestorableSqlContainerPropertiesResourceContainer(string containerName = null, Azure.ResourceManager.CosmosDB.Models.CosmosDBIndexingPolicy indexingPolicy = null, Azure.ResourceManager.CosmosDB.Models.CosmosDBContainerPartitionKey partitionKey = null, int? defaultTtl = default(int?), System.Collections.Generic.IEnumerable uniqueKeys = null, Azure.ResourceManager.CosmosDB.Models.ConflictResolutionPolicy conflictResolutionPolicy = null, Azure.ResourceManager.CosmosDB.Models.CosmosDBClientEncryptionPolicy clientEncryptionPolicy = null, long? analyticalStorageTtl = default(long?), Azure.ResourceManager.CosmosDB.Models.ResourceRestoreParameters restoreParameters = null, Azure.ResourceManager.CosmosDB.Models.CosmosDBAccountCreateMode? createMode = default(Azure.ResourceManager.CosmosDB.Models.CosmosDBAccountCreateMode?), Azure.ResourceManager.CosmosDB.Models.MaterializedViewDefinition materializedViewDefinition = null, System.Collections.Generic.IEnumerable computedProperties = null, System.Collections.Generic.IEnumerable vectorEmbeddings = null, string self = null, string rid = null, float? timestamp = default(float?), Azure.ETag? etag = default(Azure.ETag?)) { throw null; } + public static Azure.ResourceManager.CosmosDB.Models.RestorableSqlContainerPropertiesResourceContainer RestorableSqlContainerPropertiesResourceContainer(string containerName = null, Azure.ResourceManager.CosmosDB.Models.CosmosDBIndexingPolicy indexingPolicy = null, Azure.ResourceManager.CosmosDB.Models.CosmosDBContainerPartitionKey partitionKey = null, int? defaultTtl = default(int?), System.Collections.Generic.IEnumerable uniqueKeys = null, Azure.ResourceManager.CosmosDB.Models.ConflictResolutionPolicy conflictResolutionPolicy = null, Azure.ResourceManager.CosmosDB.Models.CosmosDBClientEncryptionPolicy clientEncryptionPolicy = null, long? analyticalStorageTtl = default(long?), Azure.ResourceManager.CosmosDB.Models.ResourceRestoreParameters restoreParameters = null, Azure.ResourceManager.CosmosDB.Models.CosmosDBAccountCreateMode? createMode = default(Azure.ResourceManager.CosmosDB.Models.CosmosDBAccountCreateMode?), Azure.ResourceManager.CosmosDB.Models.MaterializedViewDefinition materializedViewDefinition = null, System.Collections.Generic.IEnumerable materializedViews = null, System.Collections.Generic.IEnumerable computedProperties = null, System.Collections.Generic.IEnumerable vectorEmbeddings = null, Azure.ResourceManager.CosmosDB.Models.FullTextPolicy fullTextPolicy = null, string self = null, string rid = null, float? timestamp = default(float?), Azure.ETag? etag = default(Azure.ETag?)) { throw null; } public static Azure.ResourceManager.CosmosDB.Models.RestorableSqlDatabase RestorableSqlDatabase(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.CosmosDB.Models.ExtendedRestorableSqlDatabaseResourceInfo resource = null) { throw null; } public static Azure.ResourceManager.CosmosDB.Models.RestorableSqlDatabasePropertiesResourceDatabase RestorableSqlDatabasePropertiesResourceDatabase(string databaseName = null, Azure.ResourceManager.CosmosDB.Models.ResourceRestoreParameters restoreParameters = null, Azure.ResourceManager.CosmosDB.Models.CosmosDBAccountCreateMode? createMode = default(Azure.ResourceManager.CosmosDB.Models.CosmosDBAccountCreateMode?), string colls = null, string users = null, string self = null, string rid = null, float? timestamp = default(float?), Azure.ETag? etag = default(Azure.ETag?)) { throw null; } public static Azure.ResourceManager.CosmosDB.Models.RestorableSqlResourceData RestorableSqlResourceData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, string databaseName = null, System.Collections.Generic.IEnumerable collectionNames = null) { throw null; } @@ -2719,6 +3351,17 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } + public partial class AzureBlobContainer : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public AzureBlobContainer(string containerName) { } + public string ContainerName { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.CosmosDB.Models.AzureBlobContainer 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.CosmosDB.Models.AzureBlobContainer 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 AzureBlobDataTransferDataSourceSink : Azure.ResourceManager.CosmosDB.Models.DataTransferDataSourceSink, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public AzureBlobDataTransferDataSourceSink(string containerName) { } @@ -2731,6 +3374,17 @@ protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter write string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } + public partial class AzureBlobSourceSinkDetails : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public AzureBlobSourceSinkDetails(System.Uri endpointUri) { } + public System.Uri EndpointUri { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.CosmosDB.Models.AzureBlobSourceSinkDetails 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.CosmosDB.Models.AzureBlobSourceSinkDetails 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 BackupPolicyMigrationState : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public BackupPolicyMigrationState() { } @@ -2782,6 +3436,28 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer public static bool operator !=(Azure.ResourceManager.CosmosDB.Models.BackupPolicyType left, Azure.ResourceManager.CosmosDB.Models.BackupPolicyType right) { throw null; } public override string ToString() { throw null; } } + public abstract partial class BaseCopyJobProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + protected BaseCopyJobProperties() { } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.CosmosDB.Models.BaseCopyJobProperties 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.CosmosDB.Models.BaseCopyJobProperties 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 BaseCopyJobTask : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public BaseCopyJobTask() { } + public long? ProcessedCount { get { throw null; } } + public long? TotalCount { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.CosmosDB.Models.BaseCopyJobTask 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.CosmosDB.Models.BaseCopyJobTask 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 BaseCosmosDataTransferDataSourceSink : Azure.ResourceManager.CosmosDB.Models.DataTransferDataSourceSink, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public BaseCosmosDataTransferDataSourceSink() { } @@ -2793,6 +3469,31 @@ protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter write string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } + public partial class BlobToCassandraRUCopyJobProperties : Azure.ResourceManager.CosmosDB.Models.BaseCopyJobProperties, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public BlobToCassandraRUCopyJobProperties(Azure.ResourceManager.CosmosDB.Models.AzureBlobSourceSinkDetails sourceDetails, System.Collections.Generic.IEnumerable tasks) { } + public string DestinationDetailsRemoteAccountName { get { throw null; } set { } } + public System.Uri SourceDetailsEndpointUri { get { throw null; } set { } } + public System.Collections.Generic.IList Tasks { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.CosmosDB.Models.BlobToCassandraRUCopyJobProperties 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.CosmosDB.Models.BlobToCassandraRUCopyJobProperties 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 BlobToCassandraRUCopyJobTask : Azure.ResourceManager.CosmosDB.Models.BaseCopyJobTask, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public BlobToCassandraRUCopyJobTask(Azure.ResourceManager.CosmosDB.Models.AzureBlobContainer source, Azure.ResourceManager.CosmosDB.Models.CosmosDBCassandraTable destination) { } + public Azure.ResourceManager.CosmosDB.Models.CosmosDBCassandraTable Destination { get { throw null; } set { } } + public string SourceContainerName { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.CosmosDB.Models.BlobToCassandraRUCopyJobTask 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.CosmosDB.Models.BlobToCassandraRUCopyJobTask System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] public readonly partial struct CapacityMode : System.IEquatable { @@ -3337,6 +4038,56 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } + public partial class CassandraRUToBlobCopyJobProperties : Azure.ResourceManager.CosmosDB.Models.BaseCopyJobProperties, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public CassandraRUToBlobCopyJobProperties(Azure.ResourceManager.CosmosDB.Models.AzureBlobSourceSinkDetails destinationDetails, System.Collections.Generic.IEnumerable tasks) { } + public System.Uri DestinationDetailsEndpointUri { get { throw null; } set { } } + public string SourceDetailsRemoteAccountName { get { throw null; } set { } } + public System.Collections.Generic.IList Tasks { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.CosmosDB.Models.CassandraRUToBlobCopyJobProperties 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.CosmosDB.Models.CassandraRUToBlobCopyJobProperties 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 CassandraRUToBlobCopyJobTask : Azure.ResourceManager.CosmosDB.Models.BaseCopyJobTask, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public CassandraRUToBlobCopyJobTask(Azure.ResourceManager.CosmosDB.Models.CosmosDBCassandraTable source, Azure.ResourceManager.CosmosDB.Models.AzureBlobContainer destination) { } + public string DestinationContainerName { get { throw null; } set { } } + public Azure.ResourceManager.CosmosDB.Models.CosmosDBCassandraTable Source { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.CosmosDB.Models.CassandraRUToBlobCopyJobTask 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.CosmosDB.Models.CassandraRUToBlobCopyJobTask 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 CassandraRUToCassandraRUCopyJobProperties : Azure.ResourceManager.CosmosDB.Models.BaseCopyJobProperties, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public CassandraRUToCassandraRUCopyJobProperties(System.Collections.Generic.IEnumerable tasks) { } + public string DestinationDetailsRemoteAccountName { get { throw null; } set { } } + public string SourceDetailsRemoteAccountName { get { throw null; } set { } } + public System.Collections.Generic.IList Tasks { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.CosmosDB.Models.CassandraRUToCassandraRUCopyJobProperties 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.CosmosDB.Models.CassandraRUToCassandraRUCopyJobProperties 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 CassandraRUToCassandraRUCopyJobTask : Azure.ResourceManager.CosmosDB.Models.BaseCopyJobTask, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public CassandraRUToCassandraRUCopyJobTask(Azure.ResourceManager.CosmosDB.Models.CosmosDBCassandraTable source, Azure.ResourceManager.CosmosDB.Models.CosmosDBCassandraTable destination) { } + public Azure.ResourceManager.CosmosDB.Models.CosmosDBCassandraTable Destination { get { throw null; } set { } } + public Azure.ResourceManager.CosmosDB.Models.CosmosDBCassandraTable Source { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.CosmosDB.Models.CassandraRUToCassandraRUCopyJobTask 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.CosmosDB.Models.CassandraRUToCassandraRUCopyJobTask 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 CassandraSchema : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public CassandraSchema() { } @@ -3566,6 +4317,66 @@ protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter write public static bool operator !=(Azure.ResourceManager.CosmosDB.Models.ContinuousTier left, Azure.ResourceManager.CosmosDB.Models.ContinuousTier right) { throw null; } public override string ToString() { throw null; } } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct CopyJobMode : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public CopyJobMode(string value) { throw null; } + public static Azure.ResourceManager.CosmosDB.Models.CopyJobMode Offline { get { throw null; } } + public static Azure.ResourceManager.CosmosDB.Models.CopyJobMode Online { get { throw null; } } + public bool Equals(Azure.ResourceManager.CosmosDB.Models.CopyJobMode other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.CosmosDB.Models.CopyJobMode left, Azure.ResourceManager.CosmosDB.Models.CopyJobMode right) { throw null; } + public static implicit operator Azure.ResourceManager.CosmosDB.Models.CopyJobMode (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.CosmosDB.Models.CopyJobMode left, Azure.ResourceManager.CosmosDB.Models.CopyJobMode right) { throw null; } + public override string ToString() { throw null; } + } + public partial class CopyJobProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public CopyJobProperties(Azure.ResourceManager.CosmosDB.Models.BaseCopyJobProperties jobProperties) { } + public System.TimeSpan? Duration { get { throw null; } } + public Azure.ResourceManager.CosmosDB.Models.CosmosDBErrorResult Error { get { throw null; } } + public Azure.ResourceManager.CosmosDB.Models.BaseCopyJobProperties JobProperties { get { throw null; } set { } } + public System.DateTimeOffset? LastUpdatedUtcOn { get { throw null; } } + public Azure.ResourceManager.CosmosDB.Models.CopyJobMode? Mode { get { throw null; } set { } } + public long? ProcessedCount { get { throw null; } } + public Azure.ResourceManager.CosmosDB.Models.CopyJobStatus? Status { get { throw null; } } + public long? TotalCount { get { throw null; } } + public int? WorkerCount { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.CosmosDB.Models.CopyJobProperties 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.CosmosDB.Models.CopyJobProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct CopyJobStatus : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public CopyJobStatus(string value) { throw null; } + public static Azure.ResourceManager.CosmosDB.Models.CopyJobStatus Cancelled { get { throw null; } } + public static Azure.ResourceManager.CosmosDB.Models.CopyJobStatus Completed { get { throw null; } } + public static Azure.ResourceManager.CosmosDB.Models.CopyJobStatus Faulted { get { throw null; } } + public static Azure.ResourceManager.CosmosDB.Models.CopyJobStatus Partitioning { get { throw null; } } + public static Azure.ResourceManager.CosmosDB.Models.CopyJobStatus Paused { get { throw null; } } + public static Azure.ResourceManager.CosmosDB.Models.CopyJobStatus Pending { get { throw null; } } + public static Azure.ResourceManager.CosmosDB.Models.CopyJobStatus Running { get { throw null; } } + public bool Equals(Azure.ResourceManager.CosmosDB.Models.CopyJobStatus other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.CosmosDB.Models.CopyJobStatus left, Azure.ResourceManager.CosmosDB.Models.CopyJobStatus right) { throw null; } + public static implicit operator Azure.ResourceManager.CosmosDB.Models.CopyJobStatus (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.CosmosDB.Models.CopyJobStatus left, Azure.ResourceManager.CosmosDB.Models.CopyJobStatus right) { throw null; } + public override string ToString() { throw null; } + } public partial class CosmosCassandraDataTransferDataSourceSink : Azure.ResourceManager.CosmosDB.Models.BaseCosmosDataTransferDataSourceSink, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public CosmosCassandraDataTransferDataSourceSink(string keyspaceName, string tableName) { } @@ -3667,6 +4478,7 @@ public CosmosDBAccountCreateOrUpdateContent(Azure.Core.AzureLocation location, S public Azure.ResourceManager.CosmosDB.Models.EnableFullTextQuery? DiagnosticLogEnableFullTextQuery { get { throw null; } set { } } public bool? DisableKeyBasedMetadataWriteAccess { get { throw null; } set { } } public bool? DisableLocalAuth { get { throw null; } set { } } + public bool? EnableAllVersionsAndDeletesChangeFeed { get { throw null; } set { } } public bool? EnableAutomaticFailover { get { throw null; } set { } } public bool? EnableBurstCapacity { get { throw null; } set { } } public bool? EnableCassandraConnector { get { throw null; } set { } } @@ -3799,6 +4611,7 @@ public CosmosDBAccountPatch() { } public Azure.ResourceManager.CosmosDB.Models.EnableFullTextQuery? DiagnosticLogEnableFullTextQuery { get { throw null; } set { } } public bool? DisableKeyBasedMetadataWriteAccess { get { throw null; } set { } } public bool? DisableLocalAuth { get { throw null; } set { } } + public bool? EnableAllVersionsAndDeletesChangeFeed { get { throw null; } set { } } public bool? EnableAutomaticFailover { get { throw null; } set { } } public bool? EnableBurstCapacity { get { throw null; } set { } } public bool? EnableCassandraConnector { get { throw null; } set { } } @@ -3979,6 +4792,18 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } + public partial class CosmosDBCassandraTable : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public CosmosDBCassandraTable(string keyspaceName, string tableName) { } + public string KeyspaceName { get { throw null; } set { } } + public string TableName { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.CosmosDB.Models.CosmosDBCassandraTable 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.CosmosDB.Models.CosmosDBCassandraTable 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 CosmosDBChaosFaultSupportedAction { Enable = 0, @@ -4364,6 +5189,42 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer public static bool operator !=(Azure.ResourceManager.CosmosDB.Models.CosmosDBMinimalTlsVersion left, Azure.ResourceManager.CosmosDB.Models.CosmosDBMinimalTlsVersion right) { throw null; } public override string ToString() { throw null; } } + public partial class CosmosDBMongoCollection : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public CosmosDBMongoCollection(string databaseName, string collectionName) { } + public string CollectionName { get { throw null; } set { } } + public string DatabaseName { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.CosmosDB.Models.CosmosDBMongoCollection 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.CosmosDB.Models.CosmosDBMongoCollection 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 CosmosDBMongoVCoreCollection : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public CosmosDBMongoVCoreCollection(string databaseName, string collectionName) { } + public string CollectionName { get { throw null; } set { } } + public string DatabaseName { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.CosmosDB.Models.CosmosDBMongoVCoreCollection 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.CosmosDB.Models.CosmosDBMongoVCoreCollection 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 CosmosDBNoSqlContainer : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public CosmosDBNoSqlContainer(string databaseName, string containerName) { } + public string ContainerName { get { throw null; } set { } } + public string DatabaseName { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.CosmosDB.Models.CosmosDBNoSqlContainer 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.CosmosDB.Models.CosmosDBNoSqlContainer System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] public readonly partial struct CosmosDBOperationType : System.IEquatable { @@ -4682,8 +5543,10 @@ public CosmosDBSqlContainerResourceInfo(string containerName) { } public string ContainerName { get { throw null; } set { } } public Azure.ResourceManager.CosmosDB.Models.CosmosDBAccountCreateMode? CreateMode { get { throw null; } set { } } public int? DefaultTtl { get { throw null; } set { } } + public Azure.ResourceManager.CosmosDB.Models.FullTextPolicy FullTextPolicy { get { throw null; } set { } } public Azure.ResourceManager.CosmosDB.Models.CosmosDBIndexingPolicy IndexingPolicy { get { throw null; } set { } } public Azure.ResourceManager.CosmosDB.Models.MaterializedViewDefinition MaterializedViewDefinition { get { throw null; } set { } } + public System.Collections.Generic.IList MaterializedViews { get { throw null; } } public Azure.ResourceManager.CosmosDB.Models.CosmosDBContainerPartitionKey PartitionKey { get { throw null; } set { } } public Azure.ResourceManager.CosmosDB.Models.ResourceRestoreParameters RestoreParameters { get { throw null; } set { } } public System.Collections.Generic.IList UniqueKeys { get { throw null; } } @@ -4899,6 +5762,7 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer private readonly int _dummyPrimitive; public CosmosDBStatus(string value) { throw null; } public static Azure.ResourceManager.CosmosDB.Models.CosmosDBStatus Canceled { get { throw null; } } + public static Azure.ResourceManager.CosmosDB.Models.CosmosDBStatus Creating { get { throw null; } } public static Azure.ResourceManager.CosmosDB.Models.CosmosDBStatus Deleting { get { throw null; } } public static Azure.ResourceManager.CosmosDB.Models.CosmosDBStatus Failed { get { throw null; } } public static Azure.ResourceManager.CosmosDB.Models.CosmosDBStatus Initializing { get { throw null; } } @@ -5600,6 +6464,121 @@ protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter write string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct FleetAnalyticsPropertiesStorageLocationType : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public FleetAnalyticsPropertiesStorageLocationType(string value) { throw null; } + public static Azure.ResourceManager.CosmosDB.Models.FleetAnalyticsPropertiesStorageLocationType FabricLakehouse { get { throw null; } } + public static Azure.ResourceManager.CosmosDB.Models.FleetAnalyticsPropertiesStorageLocationType StorageAccount { get { throw null; } } + public bool Equals(Azure.ResourceManager.CosmosDB.Models.FleetAnalyticsPropertiesStorageLocationType other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.CosmosDB.Models.FleetAnalyticsPropertiesStorageLocationType left, Azure.ResourceManager.CosmosDB.Models.FleetAnalyticsPropertiesStorageLocationType right) { throw null; } + public static implicit operator Azure.ResourceManager.CosmosDB.Models.FleetAnalyticsPropertiesStorageLocationType (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.CosmosDB.Models.FleetAnalyticsPropertiesStorageLocationType left, Azure.ResourceManager.CosmosDB.Models.FleetAnalyticsPropertiesStorageLocationType right) { throw null; } + public override string ToString() { throw null; } + } + public partial class FleetResourcePatch : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public FleetResourcePatch() { } + public Azure.ResourceManager.CosmosDB.Models.CosmosDBStatus? ProvisioningState { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.CosmosDB.Models.FleetResourcePatch 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.CosmosDB.Models.FleetResourcePatch System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct FleetspacePropertiesFleetspaceApiKind : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public FleetspacePropertiesFleetspaceApiKind(string value) { throw null; } + public static Azure.ResourceManager.CosmosDB.Models.FleetspacePropertiesFleetspaceApiKind NoSQL { get { throw null; } } + public bool Equals(Azure.ResourceManager.CosmosDB.Models.FleetspacePropertiesFleetspaceApiKind other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.CosmosDB.Models.FleetspacePropertiesFleetspaceApiKind left, Azure.ResourceManager.CosmosDB.Models.FleetspacePropertiesFleetspaceApiKind right) { throw null; } + public static implicit operator Azure.ResourceManager.CosmosDB.Models.FleetspacePropertiesFleetspaceApiKind (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.CosmosDB.Models.FleetspacePropertiesFleetspaceApiKind left, Azure.ResourceManager.CosmosDB.Models.FleetspacePropertiesFleetspaceApiKind right) { throw null; } + public override string ToString() { throw null; } + } + public partial class FleetspacePropertiesThroughputPoolConfiguration : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public FleetspacePropertiesThroughputPoolConfiguration() { } + public System.Collections.Generic.IList DataRegions { get { throw null; } } + public int? MaxThroughput { get { throw null; } set { } } + public int? MinThroughput { get { throw null; } set { } } + public Azure.ResourceManager.CosmosDB.Models.FleetspacePropertiesThroughputPoolConfigurationServiceTier? ServiceTier { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.CosmosDB.Models.FleetspacePropertiesThroughputPoolConfiguration 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.CosmosDB.Models.FleetspacePropertiesThroughputPoolConfiguration System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct FleetspacePropertiesThroughputPoolConfigurationServiceTier : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public FleetspacePropertiesThroughputPoolConfigurationServiceTier(string value) { throw null; } + public static Azure.ResourceManager.CosmosDB.Models.FleetspacePropertiesThroughputPoolConfigurationServiceTier BusinessCritical { get { throw null; } } + public static Azure.ResourceManager.CosmosDB.Models.FleetspacePropertiesThroughputPoolConfigurationServiceTier GeneralPurpose { get { throw null; } } + public bool Equals(Azure.ResourceManager.CosmosDB.Models.FleetspacePropertiesThroughputPoolConfigurationServiceTier other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.CosmosDB.Models.FleetspacePropertiesThroughputPoolConfigurationServiceTier left, Azure.ResourceManager.CosmosDB.Models.FleetspacePropertiesThroughputPoolConfigurationServiceTier right) { throw null; } + public static implicit operator Azure.ResourceManager.CosmosDB.Models.FleetspacePropertiesThroughputPoolConfigurationServiceTier (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.CosmosDB.Models.FleetspacePropertiesThroughputPoolConfigurationServiceTier left, Azure.ResourceManager.CosmosDB.Models.FleetspacePropertiesThroughputPoolConfigurationServiceTier right) { throw null; } + public override string ToString() { throw null; } + } + public partial class FleetspaceResourcePatch : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public FleetspaceResourcePatch() { } + public Azure.ResourceManager.CosmosDB.Models.FleetspacePropertiesFleetspaceApiKind? FleetspaceApiKind { get { throw null; } set { } } + public Azure.ResourceManager.CosmosDB.Models.CosmosDBStatus? ProvisioningState { get { throw null; } set { } } + public Azure.ResourceManager.CosmosDB.Models.FleetspacePropertiesThroughputPoolConfiguration ThroughputPoolConfiguration { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.CosmosDB.Models.FleetspaceResourcePatch 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.CosmosDB.Models.FleetspaceResourcePatch 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 FullTextPath : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public FullTextPath(string path) { } + public string Language { get { throw null; } set { } } + public string Path { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.CosmosDB.Models.FullTextPath 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.CosmosDB.Models.FullTextPath 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 FullTextPolicy : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public FullTextPolicy() { } + public string DefaultLanguage { get { throw null; } set { } } + public System.Collections.Generic.IList FullTextPaths { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.CosmosDB.Models.FullTextPolicy 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.CosmosDB.Models.FullTextPolicy 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 GraphApiComputeRegionalService : Azure.ResourceManager.CosmosDB.Models.CosmosDBRegionalService, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { internal GraphApiComputeRegionalService() { } @@ -5780,6 +6759,18 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } + public partial class MaterializedViewDetails : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public MaterializedViewDetails() { } + public string Id { get { throw null; } set { } } + public string Rid { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.CosmosDB.Models.MaterializedViewDetails 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.CosmosDB.Models.MaterializedViewDetails 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 MaterializedViewsBuilderRegionalService : Azure.ResourceManager.CosmosDB.Models.CosmosDBRegionalService, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { internal MaterializedViewsBuilderRegionalService() { } @@ -5994,6 +6985,68 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } + public partial class MongoRUToMongoRUCopyJobProperties : Azure.ResourceManager.CosmosDB.Models.BaseCopyJobProperties, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public MongoRUToMongoRUCopyJobProperties(System.Collections.Generic.IEnumerable tasks) { } + public string DestinationDetailsRemoteAccountName { get { throw null; } set { } } + public string SourceDetailsRemoteAccountName { get { throw null; } set { } } + public System.Collections.Generic.IList Tasks { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.CosmosDB.Models.MongoRUToMongoRUCopyJobProperties 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.CosmosDB.Models.MongoRUToMongoRUCopyJobProperties 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 MongoRUToMongoRUCopyJobTask : Azure.ResourceManager.CosmosDB.Models.BaseCopyJobTask, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public MongoRUToMongoRUCopyJobTask(Azure.ResourceManager.CosmosDB.Models.CosmosDBMongoCollection source, Azure.ResourceManager.CosmosDB.Models.CosmosDBMongoCollection destination) { } + public Azure.ResourceManager.CosmosDB.Models.CosmosDBMongoCollection Destination { get { throw null; } set { } } + public Azure.ResourceManager.CosmosDB.Models.CosmosDBMongoCollection Source { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.CosmosDB.Models.MongoRUToMongoRUCopyJobTask 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.CosmosDB.Models.MongoRUToMongoRUCopyJobTask 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 MongoRUToMongoVCoreCopyJobProperties : Azure.ResourceManager.CosmosDB.Models.BaseCopyJobProperties, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public MongoRUToMongoVCoreCopyJobProperties(Azure.ResourceManager.CosmosDB.Models.MongoVCoreSourceSinkDetails destinationDetails, System.Collections.Generic.IEnumerable tasks) { } + public Azure.ResourceManager.CosmosDB.Models.MongoVCoreSourceSinkDetails DestinationDetails { get { throw null; } set { } } + public string SourceDetailsRemoteAccountName { get { throw null; } set { } } + public System.Collections.Generic.IList Tasks { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.CosmosDB.Models.MongoRUToMongoVCoreCopyJobProperties 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.CosmosDB.Models.MongoRUToMongoVCoreCopyJobProperties 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 MongoRUToMongoVCoreCopyJobTask : Azure.ResourceManager.CosmosDB.Models.BaseCopyJobTask, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public MongoRUToMongoVCoreCopyJobTask(Azure.ResourceManager.CosmosDB.Models.CosmosDBMongoCollection source, Azure.ResourceManager.CosmosDB.Models.CosmosDBMongoVCoreCollection destination) { } + public Azure.ResourceManager.CosmosDB.Models.CosmosDBMongoVCoreCollection Destination { get { throw null; } set { } } + public Azure.ResourceManager.CosmosDB.Models.CosmosDBMongoCollection Source { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.CosmosDB.Models.MongoRUToMongoVCoreCopyJobTask 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.CosmosDB.Models.MongoRUToMongoVCoreCopyJobTask 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 MongoVCoreSourceSinkDetails : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public MongoVCoreSourceSinkDetails() { } + public System.Uri ConnectionStringKeyVaultUri { get { throw null; } set { } } + public string HostName { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.CosmosDB.Models.MongoVCoreSourceSinkDetails 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.CosmosDB.Models.MongoVCoreSourceSinkDetails 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 NetworkAclBypass { None = 0, @@ -6065,6 +7118,31 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } + public partial class NoSqlRUToNoSqlRUCopyJobProperties : Azure.ResourceManager.CosmosDB.Models.BaseCopyJobProperties, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public NoSqlRUToNoSqlRUCopyJobProperties(System.Collections.Generic.IEnumerable tasks) { } + public string DestinationDetailsRemoteAccountName { get { throw null; } set { } } + public string SourceDetailsRemoteAccountName { get { throw null; } set { } } + public System.Collections.Generic.IList Tasks { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.CosmosDB.Models.NoSqlRUToNoSqlRUCopyJobProperties 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.CosmosDB.Models.NoSqlRUToNoSqlRUCopyJobProperties 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 NoSqlRUToNoSqlRUCopyJobTask : Azure.ResourceManager.CosmosDB.Models.BaseCopyJobTask, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public NoSqlRUToNoSqlRUCopyJobTask(Azure.ResourceManager.CosmosDB.Models.CosmosDBNoSqlContainer source, Azure.ResourceManager.CosmosDB.Models.CosmosDBNoSqlContainer destination) { } + public Azure.ResourceManager.CosmosDB.Models.CosmosDBNoSqlContainer Destination { get { throw null; } set { } } + public Azure.ResourceManager.CosmosDB.Models.CosmosDBNoSqlContainer Source { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.CosmosDB.Models.NoSqlRUToNoSqlRUCopyJobTask 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.CosmosDB.Models.NoSqlRUToNoSqlRUCopyJobTask 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 PartitionMetric : Azure.ResourceManager.CosmosDB.Models.CosmosDBBaseMetric, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { internal PartitionMetric() { } @@ -6130,6 +7208,19 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } + public partial class Permission : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public Permission() { } + public System.Collections.Generic.IList DataActions { get { throw null; } } + public string Id { get { throw null; } set { } } + public System.Collections.Generic.IList NotDataActions { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.CosmosDB.Models.Permission 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.CosmosDB.Models.Permission 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 PhysicalPartitionStorageInfo : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { internal PhysicalPartitionStorageInfo() { } @@ -6157,6 +7248,7 @@ public partial class PhysicalPartitionThroughputInfoResource : System.ClientMode { public PhysicalPartitionThroughputInfoResource(string id) { } public string Id { get { throw null; } set { } } + public double? TargetThroughput { get { throw null; } set { } } public double? Throughput { get { throw null; } set { } } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.PhysicalPartitionThroughputInfoResource System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/api/Azure.ResourceManager.CosmosDB.netstandard2.0.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/api/Azure.ResourceManager.CosmosDB.netstandard2.0.cs index b7d5d59400f7..e2b8e378dfc4 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/api/Azure.ResourceManager.CosmosDB.netstandard2.0.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/api/Azure.ResourceManager.CosmosDB.netstandard2.0.cs @@ -213,6 +213,107 @@ protected CassandraKeyspaceThroughputSettingResource() { } string System.ClientModel.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 CassandraRoleAssignmentResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected CassandraRoleAssignmentResource() { } + public virtual Azure.ResourceManager.CosmosDB.CassandraRoleAssignmentResourceData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string accountName, string roleAssignmentId) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + Azure.ResourceManager.CosmosDB.CassandraRoleAssignmentResourceData 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.CosmosDB.CassandraRoleAssignmentResourceData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.CosmosDB.CassandraRoleAssignmentResourceData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.CosmosDB.CassandraRoleAssignmentResourceData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public partial class CassandraRoleAssignmentResourceCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected CassandraRoleAssignmentResourceCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string roleAssignmentId, Azure.ResourceManager.CosmosDB.CassandraRoleAssignmentResourceData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string roleAssignmentId, Azure.ResourceManager.CosmosDB.CassandraRoleAssignmentResourceData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string roleAssignmentId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string roleAssignmentId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string roleAssignmentId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string roleAssignmentId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string roleAssignmentId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string roleAssignmentId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } + System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } + } + public partial class CassandraRoleAssignmentResourceData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public CassandraRoleAssignmentResourceData() { } + public System.Guid? PrincipalId { get { throw null; } set { } } + public string ProvisioningState { get { throw null; } } + public string RoleDefinitionId { get { throw null; } set { } } + public string Scope { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.CosmosDB.CassandraRoleAssignmentResourceData 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.CosmosDB.CassandraRoleAssignmentResourceData 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 CassandraRoleDefinitionResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected CassandraRoleDefinitionResource() { } + public virtual Azure.ResourceManager.CosmosDB.CassandraRoleDefinitionResourceData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string accountName, string roleDefinitionId) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + Azure.ResourceManager.CosmosDB.CassandraRoleDefinitionResourceData 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.CosmosDB.CassandraRoleDefinitionResourceData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.CosmosDB.CassandraRoleDefinitionResourceData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.CosmosDB.CassandraRoleDefinitionResourceData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public partial class CassandraRoleDefinitionResourceCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected CassandraRoleDefinitionResourceCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string roleDefinitionId, Azure.ResourceManager.CosmosDB.CassandraRoleDefinitionResourceData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string roleDefinitionId, Azure.ResourceManager.CosmosDB.CassandraRoleDefinitionResourceData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string roleDefinitionId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string roleDefinitionId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string roleDefinitionId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string roleDefinitionId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string roleDefinitionId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string roleDefinitionId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } + System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } + } + public partial class CassandraRoleDefinitionResourceData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public CassandraRoleDefinitionResourceData() { } + public System.Collections.Generic.IList AssignableScopes { get { throw null; } } + public string IdPropertiesId { get { throw null; } set { } } + public System.Collections.Generic.IList Permissions { get { throw null; } } + public string RoleName { get { throw null; } set { } } + public Azure.ResourceManager.CosmosDB.Models.CosmosDBSqlRoleDefinitionType? TypePropertiesType { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.CosmosDB.CassandraRoleDefinitionResourceData 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.CosmosDB.CassandraRoleDefinitionResourceData 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 CassandraTableCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable { protected CassandraTableCollection() { } @@ -379,6 +480,59 @@ protected CassandraViewThroughputSettingResource() { } string System.ClientModel.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 CopyJobGetResultCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected CopyJobGetResultCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string jobName, Azure.ResourceManager.CosmosDB.CopyJobGetResultData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string jobName, Azure.ResourceManager.CosmosDB.CopyJobGetResultData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string jobName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string jobName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string jobName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string jobName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string jobName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string jobName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } + System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } + } + public partial class CopyJobGetResultData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public CopyJobGetResultData(Azure.ResourceManager.CosmosDB.Models.CopyJobProperties properties) { } + public Azure.ResourceManager.CosmosDB.Models.CopyJobProperties Properties { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.CosmosDB.CopyJobGetResultData 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.CosmosDB.CopyJobGetResultData 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 CopyJobGetResultResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected CopyJobGetResultResource() { } + public virtual Azure.ResourceManager.CosmosDB.CopyJobGetResultData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public virtual Azure.Response Cancel(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CancelAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Complete(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CompleteAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string accountName, string jobName) { 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 Pause(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> PauseAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Resume(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ResumeAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + Azure.ResourceManager.CosmosDB.CopyJobGetResultData 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.CosmosDB.CopyJobGetResultData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.CosmosDB.CopyJobGetResultData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.CosmosDB.CopyJobGetResultData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } public partial class CosmosDBAccountCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable { protected CosmosDBAccountCollection() { } @@ -418,6 +572,7 @@ public CosmosDBAccountData(Azure.Core.AzureLocation location) { } public bool? DisableKeyBasedMetadataWriteAccess { get { throw null; } set { } } public bool? DisableLocalAuth { get { throw null; } set { } } public string DocumentEndpoint { get { throw null; } } + public bool? EnableAllVersionsAndDeletesChangeFeed { get { throw null; } set { } } public bool? EnableAutomaticFailover { get { throw null; } set { } } public bool? EnableBurstCapacity { get { throw null; } set { } } public bool? EnableCassandraConnector { get { throw null; } set { } } @@ -472,8 +627,17 @@ protected CosmosDBAccountResource() { } public virtual Azure.Response GetCassandraKeyspace(string keyspaceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> GetCassandraKeyspaceAsync(string keyspaceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.ResourceManager.CosmosDB.CassandraKeyspaceCollection GetCassandraKeyspaces() { throw null; } + public virtual Azure.Response GetCassandraRoleAssignmentResource(string roleAssignmentId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetCassandraRoleAssignmentResourceAsync(string roleAssignmentId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.CosmosDB.CassandraRoleAssignmentResourceCollection GetCassandraRoleAssignmentResources() { throw null; } + public virtual Azure.Response GetCassandraRoleDefinitionResource(string roleDefinitionId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetCassandraRoleDefinitionResourceAsync(string roleDefinitionId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.CosmosDB.CassandraRoleDefinitionResourceCollection GetCassandraRoleDefinitionResources() { throw null; } public virtual Azure.Pageable GetConnectionStrings(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.AsyncPageable GetConnectionStringsAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response GetCopyJobGetResult(string jobName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetCopyJobGetResultAsync(string jobName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.CosmosDB.CopyJobGetResultCollection GetCopyJobGetResults() { throw null; } public virtual Azure.Response GetCosmosDBChaosFaultResource(string chaosFault, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> GetCosmosDBChaosFaultResourceAsync(string chaosFault, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.ResourceManager.CosmosDB.CosmosDBChaosFaultResourceCollection GetCosmosDBChaosFaultResources() { throw null; } @@ -513,6 +677,12 @@ protected CosmosDBAccountResource() { } public virtual Azure.Response GetGremlinDatabase(string databaseName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> GetGremlinDatabaseAsync(string databaseName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.ResourceManager.CosmosDB.GremlinDatabaseCollection GetGremlinDatabases() { throw null; } + public virtual Azure.Response GetGremlinRoleAssignmentResource(string roleAssignmentId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetGremlinRoleAssignmentResourceAsync(string roleAssignmentId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.CosmosDB.GremlinRoleAssignmentResourceCollection GetGremlinRoleAssignmentResources() { throw null; } + public virtual Azure.Response GetGremlinRoleDefinitionResource(string roleDefinitionId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetGremlinRoleDefinitionResourceAsync(string roleDefinitionId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.CosmosDB.GremlinRoleDefinitionResourceCollection GetGremlinRoleDefinitionResources() { throw null; } public virtual Azure.Response GetKeys(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> GetKeysAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Pageable GetMetricDefinitions(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } @@ -554,6 +724,12 @@ protected CosmosDBAccountResource() { } public virtual Azure.Response GetMongoDBUserDefinition(string mongoUserDefinitionId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> GetMongoDBUserDefinitionAsync(string mongoUserDefinitionId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.ResourceManager.CosmosDB.MongoDBUserDefinitionCollection GetMongoDBUserDefinitions() { throw null; } + public virtual Azure.Response GetMongoMIRoleAssignmentResource(string roleAssignmentId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetMongoMIRoleAssignmentResourceAsync(string roleAssignmentId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.CosmosDB.MongoMIRoleAssignmentResourceCollection GetMongoMIRoleAssignmentResources() { throw null; } + public virtual Azure.Response GetMongoMIRoleDefinitionResource(string roleDefinitionId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetMongoMIRoleDefinitionResourceAsync(string roleDefinitionId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.CosmosDB.MongoMIRoleDefinitionResourceCollection GetMongoMIRoleDefinitionResources() { throw null; } public virtual Azure.Response GetNetworkSecurityPerimeterConfiguration(string networkSecurityPerimeterConfigurationName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> GetNetworkSecurityPerimeterConfigurationAsync(string networkSecurityPerimeterConfigurationName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.ResourceManager.CosmosDB.NetworkSecurityPerimeterConfigurationCollection GetNetworkSecurityPerimeterConfigurations() { throw null; } @@ -647,10 +823,13 @@ public static partial class CosmosDBExtensions public static Azure.ResourceManager.CosmosDB.CassandraDataCenterResource GetCassandraDataCenterResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } public static Azure.ResourceManager.CosmosDB.CassandraKeyspaceResource GetCassandraKeyspaceResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } public static Azure.ResourceManager.CosmosDB.CassandraKeyspaceThroughputSettingResource GetCassandraKeyspaceThroughputSettingResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.ResourceManager.CosmosDB.CassandraRoleAssignmentResource GetCassandraRoleAssignmentResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.ResourceManager.CosmosDB.CassandraRoleDefinitionResource GetCassandraRoleDefinitionResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } public static Azure.ResourceManager.CosmosDB.CassandraTableResource GetCassandraTableResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } public static Azure.ResourceManager.CosmosDB.CassandraTableThroughputSettingResource GetCassandraTableThroughputSettingResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } public static Azure.ResourceManager.CosmosDB.CassandraViewGetResultResource GetCassandraViewGetResultResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } public static Azure.ResourceManager.CosmosDB.CassandraViewThroughputSettingResource GetCassandraViewThroughputSettingResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.ResourceManager.CosmosDB.CopyJobGetResultResource GetCopyJobGetResultResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } public static Azure.Response GetCosmosDBAccount(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string accountName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public static System.Threading.Tasks.Task> GetCosmosDBAccountAsync(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string accountName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public static Azure.ResourceManager.CosmosDB.CosmosDBAccountResource GetCosmosDBAccountResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } @@ -687,17 +866,30 @@ public static partial class CosmosDBExtensions public static Azure.AsyncPageable GetCosmosDBThroughputPoolsAsync(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public static Azure.ResourceManager.CosmosDB.CosmosTableThroughputSettingResource GetCosmosTableThroughputSettingResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } public static Azure.ResourceManager.CosmosDB.DataTransferJobGetResultResource GetDataTransferJobGetResultResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.ResourceManager.CosmosDB.FleetAnalyticsResource GetFleetAnalyticsResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.ResourceManager.CosmosDB.FleetResource GetFleetResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.Response GetFleetResource(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string fleetName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static System.Threading.Tasks.Task> GetFleetResourceAsync(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string fleetName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.ResourceManager.CosmosDB.FleetResourceCollection GetFleetResources(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource) { throw null; } + public static Azure.Pageable GetFleetResources(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.AsyncPageable GetFleetResourcesAsync(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.ResourceManager.CosmosDB.FleetspaceAccountResource GetFleetspaceAccountResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.ResourceManager.CosmosDB.FleetspaceResource GetFleetspaceResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } public static Azure.ResourceManager.CosmosDB.GraphResourceGetResultResource GetGraphResourceGetResultResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } public static Azure.ResourceManager.CosmosDB.GremlinDatabaseResource GetGremlinDatabaseResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } public static Azure.ResourceManager.CosmosDB.GremlinDatabaseThroughputSettingResource GetGremlinDatabaseThroughputSettingResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } public static Azure.ResourceManager.CosmosDB.GremlinGraphResource GetGremlinGraphResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } public static Azure.ResourceManager.CosmosDB.GremlinGraphThroughputSettingResource GetGremlinGraphThroughputSettingResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.ResourceManager.CosmosDB.GremlinRoleAssignmentResource GetGremlinRoleAssignmentResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.ResourceManager.CosmosDB.GremlinRoleDefinitionResource GetGremlinRoleDefinitionResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } public static Azure.ResourceManager.CosmosDB.MongoDBCollectionResource GetMongoDBCollectionResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } public static Azure.ResourceManager.CosmosDB.MongoDBCollectionThroughputSettingResource GetMongoDBCollectionThroughputSettingResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } public static Azure.ResourceManager.CosmosDB.MongoDBDatabaseResource GetMongoDBDatabaseResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } public static Azure.ResourceManager.CosmosDB.MongoDBDatabaseThroughputSettingResource GetMongoDBDatabaseThroughputSettingResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } public static Azure.ResourceManager.CosmosDB.MongoDBRoleDefinitionResource GetMongoDBRoleDefinitionResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } public static Azure.ResourceManager.CosmosDB.MongoDBUserDefinitionResource GetMongoDBUserDefinitionResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.ResourceManager.CosmosDB.MongoMIRoleAssignmentResource GetMongoMIRoleAssignmentResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.ResourceManager.CosmosDB.MongoMIRoleDefinitionResource GetMongoMIRoleDefinitionResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } public static Azure.ResourceManager.CosmosDB.NetworkSecurityPerimeterConfigurationResource GetNetworkSecurityPerimeterConfigurationResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } public static Azure.ResourceManager.CosmosDB.RestorableCosmosDBAccountResource GetRestorableCosmosDBAccountResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } public static Azure.Pageable GetRestorableCosmosDBAccounts(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } @@ -1738,6 +1930,209 @@ protected DataTransferJobGetResultResource() { } public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.CosmosDB.Models.DataTransferJobGetResultCreateOrUpdateContent content, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.CosmosDB.Models.DataTransferJobGetResultCreateOrUpdateContent content, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } } + public partial class FleetAnalyticsResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected FleetAnalyticsResource() { } + public virtual Azure.ResourceManager.CosmosDB.FleetAnalyticsResourceData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string fleetName, string fleetAnalyticsName) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + Azure.ResourceManager.CosmosDB.FleetAnalyticsResourceData 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.CosmosDB.FleetAnalyticsResourceData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.CosmosDB.FleetAnalyticsResourceData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.CosmosDB.FleetAnalyticsResourceData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public partial class FleetAnalyticsResourceCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected FleetAnalyticsResourceCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string fleetAnalyticsName, Azure.ResourceManager.CosmosDB.FleetAnalyticsResourceData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string fleetAnalyticsName, Azure.ResourceManager.CosmosDB.FleetAnalyticsResourceData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string fleetAnalyticsName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string fleetAnalyticsName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string fleetAnalyticsName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string fleetAnalyticsName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string fleetAnalyticsName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string fleetAnalyticsName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } + System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } + } + public partial class FleetAnalyticsResourceData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public FleetAnalyticsResourceData() { } + public Azure.ResourceManager.CosmosDB.Models.CosmosDBStatus? ProvisioningState { get { throw null; } set { } } + public Azure.ResourceManager.CosmosDB.Models.FleetAnalyticsPropertiesStorageLocationType? StorageLocationType { get { throw null; } set { } } + public System.Uri StorageLocationUri { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.CosmosDB.FleetAnalyticsResourceData 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.CosmosDB.FleetAnalyticsResourceData 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 FleetResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected FleetResource() { } + public virtual Azure.ResourceManager.CosmosDB.FleetResourceData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string fleetName) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response GetFleetAnalyticsResource(string fleetAnalyticsName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetFleetAnalyticsResourceAsync(string fleetAnalyticsName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.CosmosDB.FleetAnalyticsResourceCollection GetFleetAnalyticsResources() { throw null; } + public virtual Azure.Response GetFleetspaceResource(string fleetspaceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetFleetspaceResourceAsync(string fleetspaceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.CosmosDB.FleetspaceResourceCollection GetFleetspaceResources() { throw null; } + Azure.ResourceManager.CosmosDB.FleetResourceData 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.CosmosDB.FleetResourceData 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.CosmosDB.Models.FleetResourcePatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.ResourceManager.CosmosDB.Models.FleetResourcePatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public partial class FleetResourceCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected FleetResourceCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string fleetName, Azure.ResourceManager.CosmosDB.FleetResourceData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string fleetName, Azure.ResourceManager.CosmosDB.FleetResourceData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string fleetName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string fleetName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string fleetName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string fleetName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string fleetName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string fleetName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } + System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } + } + public partial class FleetResourceData : Azure.ResourceManager.Models.TrackedResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public FleetResourceData(Azure.Core.AzureLocation location) { } + public Azure.ResourceManager.CosmosDB.Models.CosmosDBStatus? ProvisioningState { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.CosmosDB.FleetResourceData 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.CosmosDB.FleetResourceData 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 FleetspaceAccountResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected FleetspaceAccountResource() { } + public virtual Azure.ResourceManager.CosmosDB.FleetspaceAccountResourceData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string fleetName, string fleetspaceName, string fleetspaceAccountName) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + Azure.ResourceManager.CosmosDB.FleetspaceAccountResourceData 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.CosmosDB.FleetspaceAccountResourceData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.CosmosDB.FleetspaceAccountResourceData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.CosmosDB.FleetspaceAccountResourceData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public partial class FleetspaceAccountResourceCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected FleetspaceAccountResourceCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string fleetspaceAccountName, Azure.ResourceManager.CosmosDB.FleetspaceAccountResourceData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string fleetspaceAccountName, Azure.ResourceManager.CosmosDB.FleetspaceAccountResourceData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string fleetspaceAccountName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string fleetspaceAccountName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string fleetspaceAccountName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string fleetspaceAccountName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string fleetspaceAccountName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string fleetspaceAccountName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } + System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } + } + public partial class FleetspaceAccountResourceData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public FleetspaceAccountResourceData() { } + public string AccountLocation { get { throw null; } set { } } + public string AccountResourceIdentifier { get { throw null; } set { } } + public Azure.ResourceManager.CosmosDB.Models.CosmosDBStatus? ProvisioningState { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.CosmosDB.FleetspaceAccountResourceData 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.CosmosDB.FleetspaceAccountResourceData 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 FleetspaceResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected FleetspaceResource() { } + public virtual Azure.ResourceManager.CosmosDB.FleetspaceResourceData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string fleetName, string fleetspaceName) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response GetFleetspaceAccountResource(string fleetspaceAccountName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetFleetspaceAccountResourceAsync(string fleetspaceAccountName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.CosmosDB.FleetspaceAccountResourceCollection GetFleetspaceAccountResources() { throw null; } + Azure.ResourceManager.CosmosDB.FleetspaceResourceData 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.CosmosDB.FleetspaceResourceData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.CosmosDB.Models.FleetspaceResourcePatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.CosmosDB.Models.FleetspaceResourcePatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public partial class FleetspaceResourceCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected FleetspaceResourceCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string fleetspaceName, Azure.ResourceManager.CosmosDB.FleetspaceResourceData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string fleetspaceName, Azure.ResourceManager.CosmosDB.FleetspaceResourceData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string fleetspaceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string fleetspaceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string fleetspaceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string fleetspaceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string fleetspaceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string fleetspaceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } + System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } + } + public partial class FleetspaceResourceData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public FleetspaceResourceData() { } + public Azure.ResourceManager.CosmosDB.Models.FleetspacePropertiesFleetspaceApiKind? FleetspaceApiKind { get { throw null; } set { } } + public Azure.ResourceManager.CosmosDB.Models.CosmosDBStatus? ProvisioningState { get { throw null; } set { } } + public Azure.ResourceManager.CosmosDB.Models.FleetspacePropertiesThroughputPoolConfiguration ThroughputPoolConfiguration { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.CosmosDB.FleetspaceResourceData 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.CosmosDB.FleetspaceResourceData 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 GraphResourceGetResultCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable { protected GraphResourceGetResultCollection() { } @@ -1964,6 +2359,107 @@ protected GremlinGraphThroughputSettingResource() { } string System.ClientModel.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 GremlinRoleAssignmentResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected GremlinRoleAssignmentResource() { } + public virtual Azure.ResourceManager.CosmosDB.GremlinRoleAssignmentResourceData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string accountName, string roleAssignmentId) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + Azure.ResourceManager.CosmosDB.GremlinRoleAssignmentResourceData 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.CosmosDB.GremlinRoleAssignmentResourceData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.CosmosDB.GremlinRoleAssignmentResourceData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.CosmosDB.GremlinRoleAssignmentResourceData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public partial class GremlinRoleAssignmentResourceCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected GremlinRoleAssignmentResourceCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string roleAssignmentId, Azure.ResourceManager.CosmosDB.GremlinRoleAssignmentResourceData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string roleAssignmentId, Azure.ResourceManager.CosmosDB.GremlinRoleAssignmentResourceData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string roleAssignmentId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string roleAssignmentId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string roleAssignmentId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string roleAssignmentId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string roleAssignmentId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string roleAssignmentId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } + System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } + } + public partial class GremlinRoleAssignmentResourceData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public GremlinRoleAssignmentResourceData() { } + public System.Guid? PrincipalId { get { throw null; } set { } } + public string ProvisioningState { get { throw null; } } + public string RoleDefinitionId { get { throw null; } set { } } + public string Scope { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.CosmosDB.GremlinRoleAssignmentResourceData 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.CosmosDB.GremlinRoleAssignmentResourceData 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 GremlinRoleDefinitionResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected GremlinRoleDefinitionResource() { } + public virtual Azure.ResourceManager.CosmosDB.GremlinRoleDefinitionResourceData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string accountName, string roleDefinitionId) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + Azure.ResourceManager.CosmosDB.GremlinRoleDefinitionResourceData 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.CosmosDB.GremlinRoleDefinitionResourceData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.CosmosDB.GremlinRoleDefinitionResourceData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.CosmosDB.GremlinRoleDefinitionResourceData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public partial class GremlinRoleDefinitionResourceCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected GremlinRoleDefinitionResourceCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string roleDefinitionId, Azure.ResourceManager.CosmosDB.GremlinRoleDefinitionResourceData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string roleDefinitionId, Azure.ResourceManager.CosmosDB.GremlinRoleDefinitionResourceData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string roleDefinitionId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string roleDefinitionId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string roleDefinitionId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string roleDefinitionId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string roleDefinitionId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string roleDefinitionId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } + System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } + } + public partial class GremlinRoleDefinitionResourceData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public GremlinRoleDefinitionResourceData() { } + public System.Collections.Generic.IList AssignableScopes { get { throw null; } } + public string IdPropertiesId { get { throw null; } set { } } + public System.Collections.Generic.IList Permissions { get { throw null; } } + public string RoleName { get { throw null; } set { } } + public Azure.ResourceManager.CosmosDB.Models.CosmosDBSqlRoleDefinitionType? TypePropertiesType { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.CosmosDB.GremlinRoleDefinitionResourceData 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.CosmosDB.GremlinRoleDefinitionResourceData 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 MongoDBCollectionCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable { protected MongoDBCollectionCollection() { } @@ -2250,6 +2746,107 @@ protected MongoDBUserDefinitionResource() { } public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.CosmosDB.Models.MongoDBUserDefinitionCreateOrUpdateContent content, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.CosmosDB.Models.MongoDBUserDefinitionCreateOrUpdateContent content, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } } + public partial class MongoMIRoleAssignmentResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected MongoMIRoleAssignmentResource() { } + public virtual Azure.ResourceManager.CosmosDB.MongoMIRoleAssignmentResourceData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string accountName, string roleAssignmentId) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + Azure.ResourceManager.CosmosDB.MongoMIRoleAssignmentResourceData 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.CosmosDB.MongoMIRoleAssignmentResourceData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.CosmosDB.MongoMIRoleAssignmentResourceData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.CosmosDB.MongoMIRoleAssignmentResourceData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public partial class MongoMIRoleAssignmentResourceCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected MongoMIRoleAssignmentResourceCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string roleAssignmentId, Azure.ResourceManager.CosmosDB.MongoMIRoleAssignmentResourceData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string roleAssignmentId, Azure.ResourceManager.CosmosDB.MongoMIRoleAssignmentResourceData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string roleAssignmentId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string roleAssignmentId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string roleAssignmentId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string roleAssignmentId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string roleAssignmentId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string roleAssignmentId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } + System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } + } + public partial class MongoMIRoleAssignmentResourceData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public MongoMIRoleAssignmentResourceData() { } + public System.Guid? PrincipalId { get { throw null; } set { } } + public string ProvisioningState { get { throw null; } } + public string RoleDefinitionId { get { throw null; } set { } } + public string Scope { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.CosmosDB.MongoMIRoleAssignmentResourceData 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.CosmosDB.MongoMIRoleAssignmentResourceData 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 MongoMIRoleDefinitionResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected MongoMIRoleDefinitionResource() { } + public virtual Azure.ResourceManager.CosmosDB.MongoMIRoleDefinitionResourceData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string accountName, string roleDefinitionId) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + Azure.ResourceManager.CosmosDB.MongoMIRoleDefinitionResourceData 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.CosmosDB.MongoMIRoleDefinitionResourceData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.CosmosDB.MongoMIRoleDefinitionResourceData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.CosmosDB.MongoMIRoleDefinitionResourceData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public partial class MongoMIRoleDefinitionResourceCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected MongoMIRoleDefinitionResourceCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string roleDefinitionId, Azure.ResourceManager.CosmosDB.MongoMIRoleDefinitionResourceData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string roleDefinitionId, Azure.ResourceManager.CosmosDB.MongoMIRoleDefinitionResourceData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string roleDefinitionId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string roleDefinitionId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string roleDefinitionId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string roleDefinitionId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string roleDefinitionId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string roleDefinitionId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } + System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } + } + public partial class MongoMIRoleDefinitionResourceData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public MongoMIRoleDefinitionResourceData() { } + public System.Collections.Generic.IList AssignableScopes { get { throw null; } } + public string IdPropertiesId { get { throw null; } set { } } + public System.Collections.Generic.IList Permissions { get { throw null; } } + public string RoleName { get { throw null; } set { } } + public Azure.ResourceManager.CosmosDB.Models.CosmosDBSqlRoleDefinitionType? TypePropertiesType { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.CosmosDB.MongoMIRoleDefinitionResourceData 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.CosmosDB.MongoMIRoleDefinitionResourceData 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 NetworkSecurityPerimeterConfigurationCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable { protected NetworkSecurityPerimeterConfigurationCollection() { } @@ -2398,10 +2995,13 @@ protected MockableCosmosDBArmClient() { } public virtual Azure.ResourceManager.CosmosDB.CassandraDataCenterResource GetCassandraDataCenterResource(Azure.Core.ResourceIdentifier id) { throw null; } public virtual Azure.ResourceManager.CosmosDB.CassandraKeyspaceResource GetCassandraKeyspaceResource(Azure.Core.ResourceIdentifier id) { throw null; } public virtual Azure.ResourceManager.CosmosDB.CassandraKeyspaceThroughputSettingResource GetCassandraKeyspaceThroughputSettingResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.CosmosDB.CassandraRoleAssignmentResource GetCassandraRoleAssignmentResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.CosmosDB.CassandraRoleDefinitionResource GetCassandraRoleDefinitionResource(Azure.Core.ResourceIdentifier id) { throw null; } public virtual Azure.ResourceManager.CosmosDB.CassandraTableResource GetCassandraTableResource(Azure.Core.ResourceIdentifier id) { throw null; } public virtual Azure.ResourceManager.CosmosDB.CassandraTableThroughputSettingResource GetCassandraTableThroughputSettingResource(Azure.Core.ResourceIdentifier id) { throw null; } public virtual Azure.ResourceManager.CosmosDB.CassandraViewGetResultResource GetCassandraViewGetResultResource(Azure.Core.ResourceIdentifier id) { throw null; } public virtual Azure.ResourceManager.CosmosDB.CassandraViewThroughputSettingResource GetCassandraViewThroughputSettingResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.CosmosDB.CopyJobGetResultResource GetCopyJobGetResultResource(Azure.Core.ResourceIdentifier id) { throw null; } public virtual Azure.ResourceManager.CosmosDB.CosmosDBAccountResource GetCosmosDBAccountResource(Azure.Core.ResourceIdentifier id) { throw null; } public virtual Azure.ResourceManager.CosmosDB.CosmosDBChaosFaultResource GetCosmosDBChaosFaultResource(Azure.Core.ResourceIdentifier id) { throw null; } public virtual Azure.ResourceManager.CosmosDB.CosmosDBLocationResource GetCosmosDBLocationResource(Azure.Core.ResourceIdentifier id) { throw null; } @@ -2425,17 +3025,25 @@ protected MockableCosmosDBArmClient() { } public virtual Azure.ResourceManager.CosmosDB.CosmosDBThroughputPoolResource GetCosmosDBThroughputPoolResource(Azure.Core.ResourceIdentifier id) { throw null; } public virtual Azure.ResourceManager.CosmosDB.CosmosTableThroughputSettingResource GetCosmosTableThroughputSettingResource(Azure.Core.ResourceIdentifier id) { throw null; } public virtual Azure.ResourceManager.CosmosDB.DataTransferJobGetResultResource GetDataTransferJobGetResultResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.CosmosDB.FleetAnalyticsResource GetFleetAnalyticsResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.CosmosDB.FleetResource GetFleetResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.CosmosDB.FleetspaceAccountResource GetFleetspaceAccountResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.CosmosDB.FleetspaceResource GetFleetspaceResource(Azure.Core.ResourceIdentifier id) { throw null; } public virtual Azure.ResourceManager.CosmosDB.GraphResourceGetResultResource GetGraphResourceGetResultResource(Azure.Core.ResourceIdentifier id) { throw null; } public virtual Azure.ResourceManager.CosmosDB.GremlinDatabaseResource GetGremlinDatabaseResource(Azure.Core.ResourceIdentifier id) { throw null; } public virtual Azure.ResourceManager.CosmosDB.GremlinDatabaseThroughputSettingResource GetGremlinDatabaseThroughputSettingResource(Azure.Core.ResourceIdentifier id) { throw null; } public virtual Azure.ResourceManager.CosmosDB.GremlinGraphResource GetGremlinGraphResource(Azure.Core.ResourceIdentifier id) { throw null; } public virtual Azure.ResourceManager.CosmosDB.GremlinGraphThroughputSettingResource GetGremlinGraphThroughputSettingResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.CosmosDB.GremlinRoleAssignmentResource GetGremlinRoleAssignmentResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.CosmosDB.GremlinRoleDefinitionResource GetGremlinRoleDefinitionResource(Azure.Core.ResourceIdentifier id) { throw null; } public virtual Azure.ResourceManager.CosmosDB.MongoDBCollectionResource GetMongoDBCollectionResource(Azure.Core.ResourceIdentifier id) { throw null; } public virtual Azure.ResourceManager.CosmosDB.MongoDBCollectionThroughputSettingResource GetMongoDBCollectionThroughputSettingResource(Azure.Core.ResourceIdentifier id) { throw null; } public virtual Azure.ResourceManager.CosmosDB.MongoDBDatabaseResource GetMongoDBDatabaseResource(Azure.Core.ResourceIdentifier id) { throw null; } public virtual Azure.ResourceManager.CosmosDB.MongoDBDatabaseThroughputSettingResource GetMongoDBDatabaseThroughputSettingResource(Azure.Core.ResourceIdentifier id) { throw null; } public virtual Azure.ResourceManager.CosmosDB.MongoDBRoleDefinitionResource GetMongoDBRoleDefinitionResource(Azure.Core.ResourceIdentifier id) { throw null; } public virtual Azure.ResourceManager.CosmosDB.MongoDBUserDefinitionResource GetMongoDBUserDefinitionResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.CosmosDB.MongoMIRoleAssignmentResource GetMongoMIRoleAssignmentResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.CosmosDB.MongoMIRoleDefinitionResource GetMongoMIRoleDefinitionResource(Azure.Core.ResourceIdentifier id) { throw null; } public virtual Azure.ResourceManager.CosmosDB.NetworkSecurityPerimeterConfigurationResource GetNetworkSecurityPerimeterConfigurationResource(Azure.Core.ResourceIdentifier id) { throw null; } public virtual Azure.ResourceManager.CosmosDB.RestorableCosmosDBAccountResource GetRestorableCosmosDBAccountResource(Azure.Core.ResourceIdentifier id) { throw null; } } @@ -2451,6 +3059,9 @@ protected MockableCosmosDBResourceGroupResource() { } public virtual Azure.Response GetCosmosDBThroughputPool(string throughputPoolName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> GetCosmosDBThroughputPoolAsync(string throughputPoolName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.ResourceManager.CosmosDB.CosmosDBThroughputPoolCollection GetCosmosDBThroughputPools() { throw null; } + public virtual Azure.Response GetFleetResource(string fleetName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetFleetResourceAsync(string fleetName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.CosmosDB.FleetResourceCollection GetFleetResources() { throw null; } } public partial class MockableCosmosDBSubscriptionResource : Azure.ResourceManager.ArmResource { @@ -2464,6 +3075,8 @@ protected MockableCosmosDBSubscriptionResource() { } public virtual Azure.ResourceManager.CosmosDB.CosmosDBLocationCollection GetCosmosDBLocations() { throw null; } public virtual Azure.Pageable GetCosmosDBThroughputPools(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.AsyncPageable GetCosmosDBThroughputPoolsAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetFleetResources(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetFleetResourcesAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Pageable GetRestorableCosmosDBAccounts(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.AsyncPageable GetRestorableCosmosDBAccountsAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } } @@ -2544,6 +3157,8 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer public static partial class ArmCosmosDBModelFactory { public static Azure.ResourceManager.CosmosDB.Models.AutoscaleSettingsResourceInfo AutoscaleSettingsResourceInfo(int maxThroughput = 0, Azure.ResourceManager.CosmosDB.Models.ThroughputPolicyResourceInfo autoUpgradeThroughputPolicy = null, int? targetMaxThroughput = default(int?)) { throw null; } + public static Azure.ResourceManager.CosmosDB.Models.BaseCopyJobTask BaseCopyJobTask(long? totalCount = default(long?), long? processedCount = default(long?)) { throw null; } + public static Azure.ResourceManager.CosmosDB.Models.BlobToCassandraRUCopyJobTask BlobToCassandraRUCopyJobTask(long? totalCount = default(long?), long? processedCount = default(long?), string sourceContainerName = null, Azure.ResourceManager.CosmosDB.Models.CosmosDBCassandraTable destination = null) { throw null; } public static Azure.ResourceManager.CosmosDB.Models.CapacityModeChangeTransitionState CapacityModeChangeTransitionState(Azure.ResourceManager.CosmosDB.Models.CapacityModeTransitionStatus? capacityModeTransitionStatus = default(Azure.ResourceManager.CosmosDB.Models.CapacityModeTransitionStatus?), Azure.ResourceManager.CosmosDB.Models.CapacityMode? currentCapacityMode = default(Azure.ResourceManager.CosmosDB.Models.CapacityMode?), Azure.ResourceManager.CosmosDB.Models.CapacityMode? previousCapacityMode = default(Azure.ResourceManager.CosmosDB.Models.CapacityMode?), System.DateTimeOffset? capacityModeTransitionBeginTimestamp = default(System.DateTimeOffset?), System.DateTimeOffset? capacityModeTransitionEndTimestamp = default(System.DateTimeOffset?), System.DateTimeOffset? capacityModeLastSuccessfulTransitionEndTimestamp = default(System.DateTimeOffset?)) { throw null; } public static Azure.ResourceManager.CosmosDB.Models.CassandraClusterBackupResourceInfo CassandraClusterBackupResourceInfo(string backupId = null, Azure.ResourceManager.CosmosDB.Models.CassandraClusterBackupState? backupState = default(Azure.ResourceManager.CosmosDB.Models.CassandraClusterBackupState?), System.DateTimeOffset? backupStartTimestamp = default(System.DateTimeOffset?), System.DateTimeOffset? backupStopTimestamp = default(System.DateTimeOffset?), System.DateTimeOffset? backupExpiryTimestamp = default(System.DateTimeOffset?)) { throw null; } public static Azure.ResourceManager.CosmosDB.Models.CassandraClusterCommand CassandraClusterCommand(string command = null, string commandId = null, System.BinaryData arguments = null, string host = null, bool? isAdmin = default(bool?), bool? shouldStopCassandraBeforeStart = default(bool?), bool? isReadWrite = default(bool?), string result = null, Azure.ResourceManager.CosmosDB.Models.CassandraClusterCommandStatus? status = default(Azure.ResourceManager.CosmosDB.Models.CassandraClusterCommandStatus?), string outputFile = null) { throw null; } @@ -2560,17 +3175,23 @@ public static partial class ArmCosmosDBModelFactory public static Azure.ResourceManager.CosmosDB.Models.CassandraKeyspaceCreateOrUpdateContent CassandraKeyspaceCreateOrUpdateContent(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IDictionary tags = null, Azure.Core.AzureLocation location = default(Azure.Core.AzureLocation), string resourceKeyspaceName = null, Azure.ResourceManager.CosmosDB.Models.CosmosDBCreateUpdateConfig options = null, Azure.ResourceManager.Models.ManagedServiceIdentity identity = null) { throw null; } public static Azure.ResourceManager.CosmosDB.CassandraKeyspaceData CassandraKeyspaceData(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.CosmosDB.Models.ExtendedCassandraKeyspaceResourceInfo resource = null, Azure.ResourceManager.CosmosDB.Models.CassandraKeyspacePropertiesConfig options = null, Azure.ResourceManager.Models.ManagedServiceIdentity identity = null) { throw null; } public static Azure.ResourceManager.CosmosDB.Models.CassandraReaperStatus CassandraReaperStatus(bool? isHealthy = default(bool?), System.Collections.Generic.IReadOnlyDictionary repairRunIds = null, System.Collections.Generic.IReadOnlyDictionary repairSchedules = null) { throw null; } + public static Azure.ResourceManager.CosmosDB.CassandraRoleAssignmentResourceData CassandraRoleAssignmentResourceData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, string roleDefinitionId = null, string scope = null, System.Guid? principalId = default(System.Guid?), string provisioningState = null) { throw null; } + public static Azure.ResourceManager.CosmosDB.CassandraRoleDefinitionResourceData CassandraRoleDefinitionResourceData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, string idPropertiesId = null, string roleName = null, Azure.ResourceManager.CosmosDB.Models.CosmosDBSqlRoleDefinitionType? typePropertiesType = default(Azure.ResourceManager.CosmosDB.Models.CosmosDBSqlRoleDefinitionType?), System.Collections.Generic.IEnumerable assignableScopes = null, System.Collections.Generic.IEnumerable permissions = null) { throw null; } + public static Azure.ResourceManager.CosmosDB.Models.CassandraRUToBlobCopyJobTask CassandraRUToBlobCopyJobTask(long? totalCount = default(long?), long? processedCount = default(long?), Azure.ResourceManager.CosmosDB.Models.CosmosDBCassandraTable source = null, string destinationContainerName = null) { throw null; } + public static Azure.ResourceManager.CosmosDB.Models.CassandraRUToCassandraRUCopyJobTask CassandraRUToCassandraRUCopyJobTask(long? totalCount = default(long?), long? processedCount = default(long?), Azure.ResourceManager.CosmosDB.Models.CosmosDBCassandraTable source = null, Azure.ResourceManager.CosmosDB.Models.CosmosDBCassandraTable destination = null) { throw null; } public static Azure.ResourceManager.CosmosDB.Models.CassandraTableCreateOrUpdateContent CassandraTableCreateOrUpdateContent(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.CosmosDB.Models.CassandraTableResourceInfo resource = null, Azure.ResourceManager.CosmosDB.Models.CosmosDBCreateUpdateConfig options = null, Azure.ResourceManager.Models.ManagedServiceIdentity identity = null) { throw null; } public static Azure.ResourceManager.CosmosDB.CassandraTableData CassandraTableData(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.CosmosDB.Models.ExtendedCassandraTableResourceInfo resource = null, Azure.ResourceManager.CosmosDB.Models.CassandraTablePropertiesConfig options = null, Azure.ResourceManager.Models.ManagedServiceIdentity identity = null) { throw null; } public static Azure.ResourceManager.CosmosDB.Models.CassandraViewGetPropertiesResource CassandraViewGetPropertiesResource(string id = null, string viewDefinition = null, string rid = null, float? timestamp = default(float?), Azure.ETag? etag = default(Azure.ETag?)) { throw null; } public static Azure.ResourceManager.CosmosDB.Models.CassandraViewGetResultCreateOrUpdateContent CassandraViewGetResultCreateOrUpdateContent(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.CosmosDB.Models.CassandraViewResource resource = null, Azure.ResourceManager.CosmosDB.Models.CosmosDBCreateUpdateConfig options = null, Azure.ResourceManager.Models.ManagedServiceIdentity identity = null) { throw null; } public static Azure.ResourceManager.CosmosDB.CassandraViewGetResultData CassandraViewGetResultData(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.CosmosDB.Models.CassandraViewGetPropertiesResource resource = null, Azure.ResourceManager.CosmosDB.Models.CassandraViewGetPropertiesOptions options = null, Azure.ResourceManager.Models.ManagedServiceIdentity identity = null) { throw null; } + public static Azure.ResourceManager.CosmosDB.CopyJobGetResultData CopyJobGetResultData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.CosmosDB.Models.CopyJobProperties properties = null) { throw null; } + public static Azure.ResourceManager.CosmosDB.Models.CopyJobProperties CopyJobProperties(Azure.ResourceManager.CosmosDB.Models.BaseCopyJobProperties jobProperties = null, Azure.ResourceManager.CosmosDB.Models.CopyJobStatus? status = default(Azure.ResourceManager.CosmosDB.Models.CopyJobStatus?), long? processedCount = default(long?), long? totalCount = default(long?), System.DateTimeOffset? lastUpdatedUtcOn = default(System.DateTimeOffset?), int? workerCount = default(int?), Azure.ResourceManager.CosmosDB.Models.CosmosDBErrorResult error = null, System.TimeSpan? duration = default(System.TimeSpan?), Azure.ResourceManager.CosmosDB.Models.CopyJobMode? mode = default(Azure.ResourceManager.CosmosDB.Models.CopyJobMode?)) { throw null; } public static Azure.ResourceManager.CosmosDB.Models.CosmosDBAccountConnectionString CosmosDBAccountConnectionString(string connectionString = null, string description = null, Azure.ResourceManager.CosmosDB.Models.CosmosDBKind? keyKind = default(Azure.ResourceManager.CosmosDB.Models.CosmosDBKind?), Azure.ResourceManager.CosmosDB.Models.CosmosDBType? keyType = default(Azure.ResourceManager.CosmosDB.Models.CosmosDBType?)) { throw null; } - public static Azure.ResourceManager.CosmosDB.Models.CosmosDBAccountCreateOrUpdateContent CosmosDBAccountCreateOrUpdateContent(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.CosmosDB.Models.CosmosDBAccountKind? kind = default(Azure.ResourceManager.CosmosDB.Models.CosmosDBAccountKind?), Azure.ResourceManager.CosmosDB.Models.ConsistencyPolicy consistencyPolicy = null, System.Collections.Generic.IEnumerable locations = null, Azure.ResourceManager.CosmosDB.Models.CosmosDBAccountOfferType databaseAccountOfferType = default(Azure.ResourceManager.CosmosDB.Models.CosmosDBAccountOfferType), System.Collections.Generic.IEnumerable ipRules = null, bool? isVirtualNetworkFilterEnabled = default(bool?), bool? enableAutomaticFailover = default(bool?), System.Collections.Generic.IEnumerable capabilities = null, System.Collections.Generic.IEnumerable virtualNetworkRules = null, bool? enableMultipleWriteLocations = default(bool?), bool? enableCassandraConnector = default(bool?), Azure.ResourceManager.CosmosDB.Models.ConnectorOffer? connectorOffer = default(Azure.ResourceManager.CosmosDB.Models.ConnectorOffer?), bool? disableKeyBasedMetadataWriteAccess = default(bool?), System.Uri keyVaultKeyUri = null, string defaultIdentity = null, Azure.ResourceManager.CosmosDB.Models.CosmosDBPublicNetworkAccess? publicNetworkAccess = default(Azure.ResourceManager.CosmosDB.Models.CosmosDBPublicNetworkAccess?), bool? isFreeTierEnabled = default(bool?), Azure.ResourceManager.CosmosDB.Models.CosmosDBServerVersion? apiServerVersion = default(Azure.ResourceManager.CosmosDB.Models.CosmosDBServerVersion?), bool? isAnalyticalStorageEnabled = default(bool?), Azure.ResourceManager.CosmosDB.Models.AnalyticalStorageSchemaType? analyticalStorageSchemaType = default(Azure.ResourceManager.CosmosDB.Models.AnalyticalStorageSchemaType?), Azure.ResourceManager.CosmosDB.Models.CosmosDBAccountCreateMode? createMode = default(Azure.ResourceManager.CosmosDB.Models.CosmosDBAccountCreateMode?), Azure.ResourceManager.CosmosDB.Models.CosmosDBAccountBackupPolicy backupPolicy = null, System.Collections.Generic.IEnumerable cors = null, Azure.ResourceManager.CosmosDB.Models.NetworkAclBypass? networkAclBypass = default(Azure.ResourceManager.CosmosDB.Models.NetworkAclBypass?), System.Collections.Generic.IEnumerable networkAclBypassResourceIds = null, Azure.ResourceManager.CosmosDB.Models.EnableFullTextQuery? diagnosticLogEnableFullTextQuery = default(Azure.ResourceManager.CosmosDB.Models.EnableFullTextQuery?), bool? disableLocalAuth = default(bool?), Azure.ResourceManager.CosmosDB.Models.CosmosDBAccountRestoreParameters restoreParameters = null, int? capacityTotalThroughputLimit = default(int?), Azure.ResourceManager.CosmosDB.Models.CapacityMode? capacityMode = default(Azure.ResourceManager.CosmosDB.Models.CapacityMode?), bool? enableMaterializedViews = default(bool?), Azure.ResourceManager.CosmosDB.Models.DatabaseAccountKeysMetadata keysMetadata = null, bool? enablePartitionMerge = default(bool?), bool? enableBurstCapacity = default(bool?), Azure.ResourceManager.CosmosDB.Models.CosmosDBMinimalTlsVersion? minimalTlsVersion = default(Azure.ResourceManager.CosmosDB.Models.CosmosDBMinimalTlsVersion?), string customerManagedKeyStatus = null, bool? enablePriorityBasedExecution = default(bool?), Azure.ResourceManager.CosmosDB.Models.DefaultPriorityLevel? defaultPriorityLevel = default(Azure.ResourceManager.CosmosDB.Models.DefaultPriorityLevel?), bool? enablePerRegionPerPartitionAutoscale = default(bool?), Azure.ResourceManager.Models.ManagedServiceIdentity identity = null) { throw null; } - public static Azure.ResourceManager.CosmosDB.CosmosDBAccountData CosmosDBAccountData(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.CosmosDB.Models.CosmosDBAccountKind? kind = default(Azure.ResourceManager.CosmosDB.Models.CosmosDBAccountKind?), string provisioningState = null, string documentEndpoint = null, Azure.ResourceManager.CosmosDB.Models.CosmosDBAccountOfferType? databaseAccountOfferType = default(Azure.ResourceManager.CosmosDB.Models.CosmosDBAccountOfferType?), System.Collections.Generic.IEnumerable ipRules = null, bool? isVirtualNetworkFilterEnabled = default(bool?), bool? enableAutomaticFailover = default(bool?), Azure.ResourceManager.CosmosDB.Models.ConsistencyPolicy consistencyPolicy = null, System.Collections.Generic.IEnumerable capabilities = null, System.Collections.Generic.IEnumerable writeLocations = null, System.Collections.Generic.IEnumerable readLocations = null, System.Collections.Generic.IEnumerable locations = null, System.Collections.Generic.IEnumerable failoverPolicies = null, System.Collections.Generic.IEnumerable virtualNetworkRules = null, System.Collections.Generic.IEnumerable privateEndpointConnections = null, bool? enableMultipleWriteLocations = default(bool?), bool? enableCassandraConnector = default(bool?), Azure.ResourceManager.CosmosDB.Models.ConnectorOffer? connectorOffer = default(Azure.ResourceManager.CosmosDB.Models.ConnectorOffer?), bool? disableKeyBasedMetadataWriteAccess = default(bool?), System.Uri keyVaultKeyUri = null, string defaultIdentity = null, Azure.ResourceManager.CosmosDB.Models.CosmosDBPublicNetworkAccess? publicNetworkAccess = default(Azure.ResourceManager.CosmosDB.Models.CosmosDBPublicNetworkAccess?), bool? isFreeTierEnabled = default(bool?), Azure.ResourceManager.CosmosDB.Models.CosmosDBServerVersion? apiServerVersion = default(Azure.ResourceManager.CosmosDB.Models.CosmosDBServerVersion?), bool? isAnalyticalStorageEnabled = default(bool?), Azure.ResourceManager.CosmosDB.Models.AnalyticalStorageSchemaType? analyticalStorageSchemaType = default(Azure.ResourceManager.CosmosDB.Models.AnalyticalStorageSchemaType?), System.Guid? instanceId = default(System.Guid?), Azure.ResourceManager.CosmosDB.Models.CosmosDBAccountCreateMode? createMode = default(Azure.ResourceManager.CosmosDB.Models.CosmosDBAccountCreateMode?), Azure.ResourceManager.CosmosDB.Models.CosmosDBAccountRestoreParameters restoreParameters = null, Azure.ResourceManager.CosmosDB.Models.CosmosDBAccountBackupPolicy backupPolicy = null, System.Collections.Generic.IEnumerable cors = null, Azure.ResourceManager.CosmosDB.Models.NetworkAclBypass? networkAclBypass = default(Azure.ResourceManager.CosmosDB.Models.NetworkAclBypass?), System.Collections.Generic.IEnumerable networkAclBypassResourceIds = null, Azure.ResourceManager.CosmosDB.Models.EnableFullTextQuery? diagnosticLogEnableFullTextQuery = default(Azure.ResourceManager.CosmosDB.Models.EnableFullTextQuery?), bool? disableLocalAuth = default(bool?), int? capacityTotalThroughputLimit = default(int?), Azure.ResourceManager.CosmosDB.Models.CapacityMode? capacityMode = default(Azure.ResourceManager.CosmosDB.Models.CapacityMode?), Azure.ResourceManager.CosmosDB.Models.CapacityModeChangeTransitionState capacityModeChangeTransitionState = null, bool? enableMaterializedViews = default(bool?), Azure.ResourceManager.CosmosDB.Models.DatabaseAccountKeysMetadata keysMetadata = null, bool? enablePartitionMerge = default(bool?), bool? enableBurstCapacity = default(bool?), Azure.ResourceManager.CosmosDB.Models.CosmosDBMinimalTlsVersion? minimalTlsVersion = default(Azure.ResourceManager.CosmosDB.Models.CosmosDBMinimalTlsVersion?), string customerManagedKeyStatus = null, bool? enablePriorityBasedExecution = default(bool?), Azure.ResourceManager.CosmosDB.Models.DefaultPriorityLevel? defaultPriorityLevel = default(Azure.ResourceManager.CosmosDB.Models.DefaultPriorityLevel?), bool? enablePerRegionPerPartitionAutoscale = default(bool?), Azure.ResourceManager.Models.ManagedServiceIdentity identity = null) { throw null; } + public static Azure.ResourceManager.CosmosDB.Models.CosmosDBAccountCreateOrUpdateContent CosmosDBAccountCreateOrUpdateContent(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.CosmosDB.Models.CosmosDBAccountKind? kind = default(Azure.ResourceManager.CosmosDB.Models.CosmosDBAccountKind?), Azure.ResourceManager.CosmosDB.Models.ConsistencyPolicy consistencyPolicy = null, System.Collections.Generic.IEnumerable locations = null, Azure.ResourceManager.CosmosDB.Models.CosmosDBAccountOfferType databaseAccountOfferType = default(Azure.ResourceManager.CosmosDB.Models.CosmosDBAccountOfferType), System.Collections.Generic.IEnumerable ipRules = null, bool? isVirtualNetworkFilterEnabled = default(bool?), bool? enableAutomaticFailover = default(bool?), System.Collections.Generic.IEnumerable capabilities = null, System.Collections.Generic.IEnumerable virtualNetworkRules = null, bool? enableMultipleWriteLocations = default(bool?), bool? enableCassandraConnector = default(bool?), Azure.ResourceManager.CosmosDB.Models.ConnectorOffer? connectorOffer = default(Azure.ResourceManager.CosmosDB.Models.ConnectorOffer?), bool? disableKeyBasedMetadataWriteAccess = default(bool?), System.Uri keyVaultKeyUri = null, string defaultIdentity = null, Azure.ResourceManager.CosmosDB.Models.CosmosDBPublicNetworkAccess? publicNetworkAccess = default(Azure.ResourceManager.CosmosDB.Models.CosmosDBPublicNetworkAccess?), bool? isFreeTierEnabled = default(bool?), Azure.ResourceManager.CosmosDB.Models.CosmosDBServerVersion? apiServerVersion = default(Azure.ResourceManager.CosmosDB.Models.CosmosDBServerVersion?), bool? isAnalyticalStorageEnabled = default(bool?), Azure.ResourceManager.CosmosDB.Models.AnalyticalStorageSchemaType? analyticalStorageSchemaType = default(Azure.ResourceManager.CosmosDB.Models.AnalyticalStorageSchemaType?), Azure.ResourceManager.CosmosDB.Models.CosmosDBAccountCreateMode? createMode = default(Azure.ResourceManager.CosmosDB.Models.CosmosDBAccountCreateMode?), Azure.ResourceManager.CosmosDB.Models.CosmosDBAccountBackupPolicy backupPolicy = null, System.Collections.Generic.IEnumerable cors = null, Azure.ResourceManager.CosmosDB.Models.NetworkAclBypass? networkAclBypass = default(Azure.ResourceManager.CosmosDB.Models.NetworkAclBypass?), System.Collections.Generic.IEnumerable networkAclBypassResourceIds = null, Azure.ResourceManager.CosmosDB.Models.EnableFullTextQuery? diagnosticLogEnableFullTextQuery = default(Azure.ResourceManager.CosmosDB.Models.EnableFullTextQuery?), bool? disableLocalAuth = default(bool?), Azure.ResourceManager.CosmosDB.Models.CosmosDBAccountRestoreParameters restoreParameters = null, int? capacityTotalThroughputLimit = default(int?), Azure.ResourceManager.CosmosDB.Models.CapacityMode? capacityMode = default(Azure.ResourceManager.CosmosDB.Models.CapacityMode?), bool? enableMaterializedViews = default(bool?), Azure.ResourceManager.CosmosDB.Models.DatabaseAccountKeysMetadata keysMetadata = null, bool? enablePartitionMerge = default(bool?), bool? enableBurstCapacity = default(bool?), Azure.ResourceManager.CosmosDB.Models.CosmosDBMinimalTlsVersion? minimalTlsVersion = default(Azure.ResourceManager.CosmosDB.Models.CosmosDBMinimalTlsVersion?), string customerManagedKeyStatus = null, bool? enablePriorityBasedExecution = default(bool?), Azure.ResourceManager.CosmosDB.Models.DefaultPriorityLevel? defaultPriorityLevel = default(Azure.ResourceManager.CosmosDB.Models.DefaultPriorityLevel?), bool? enablePerRegionPerPartitionAutoscale = default(bool?), bool? enableAllVersionsAndDeletesChangeFeed = default(bool?), Azure.ResourceManager.Models.ManagedServiceIdentity identity = null) { throw null; } + public static Azure.ResourceManager.CosmosDB.CosmosDBAccountData CosmosDBAccountData(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.CosmosDB.Models.CosmosDBAccountKind? kind = default(Azure.ResourceManager.CosmosDB.Models.CosmosDBAccountKind?), string provisioningState = null, string documentEndpoint = null, Azure.ResourceManager.CosmosDB.Models.CosmosDBAccountOfferType? databaseAccountOfferType = default(Azure.ResourceManager.CosmosDB.Models.CosmosDBAccountOfferType?), System.Collections.Generic.IEnumerable ipRules = null, bool? isVirtualNetworkFilterEnabled = default(bool?), bool? enableAutomaticFailover = default(bool?), Azure.ResourceManager.CosmosDB.Models.ConsistencyPolicy consistencyPolicy = null, System.Collections.Generic.IEnumerable capabilities = null, System.Collections.Generic.IEnumerable writeLocations = null, System.Collections.Generic.IEnumerable readLocations = null, System.Collections.Generic.IEnumerable locations = null, System.Collections.Generic.IEnumerable failoverPolicies = null, System.Collections.Generic.IEnumerable virtualNetworkRules = null, System.Collections.Generic.IEnumerable privateEndpointConnections = null, bool? enableMultipleWriteLocations = default(bool?), bool? enableCassandraConnector = default(bool?), Azure.ResourceManager.CosmosDB.Models.ConnectorOffer? connectorOffer = default(Azure.ResourceManager.CosmosDB.Models.ConnectorOffer?), bool? disableKeyBasedMetadataWriteAccess = default(bool?), System.Uri keyVaultKeyUri = null, string defaultIdentity = null, Azure.ResourceManager.CosmosDB.Models.CosmosDBPublicNetworkAccess? publicNetworkAccess = default(Azure.ResourceManager.CosmosDB.Models.CosmosDBPublicNetworkAccess?), bool? isFreeTierEnabled = default(bool?), Azure.ResourceManager.CosmosDB.Models.CosmosDBServerVersion? apiServerVersion = default(Azure.ResourceManager.CosmosDB.Models.CosmosDBServerVersion?), bool? isAnalyticalStorageEnabled = default(bool?), Azure.ResourceManager.CosmosDB.Models.AnalyticalStorageSchemaType? analyticalStorageSchemaType = default(Azure.ResourceManager.CosmosDB.Models.AnalyticalStorageSchemaType?), System.Guid? instanceId = default(System.Guid?), Azure.ResourceManager.CosmosDB.Models.CosmosDBAccountCreateMode? createMode = default(Azure.ResourceManager.CosmosDB.Models.CosmosDBAccountCreateMode?), Azure.ResourceManager.CosmosDB.Models.CosmosDBAccountRestoreParameters restoreParameters = null, Azure.ResourceManager.CosmosDB.Models.CosmosDBAccountBackupPolicy backupPolicy = null, System.Collections.Generic.IEnumerable cors = null, Azure.ResourceManager.CosmosDB.Models.NetworkAclBypass? networkAclBypass = default(Azure.ResourceManager.CosmosDB.Models.NetworkAclBypass?), System.Collections.Generic.IEnumerable networkAclBypassResourceIds = null, Azure.ResourceManager.CosmosDB.Models.EnableFullTextQuery? diagnosticLogEnableFullTextQuery = default(Azure.ResourceManager.CosmosDB.Models.EnableFullTextQuery?), bool? disableLocalAuth = default(bool?), int? capacityTotalThroughputLimit = default(int?), Azure.ResourceManager.CosmosDB.Models.CapacityMode? capacityMode = default(Azure.ResourceManager.CosmosDB.Models.CapacityMode?), Azure.ResourceManager.CosmosDB.Models.CapacityModeChangeTransitionState capacityModeChangeTransitionState = null, bool? enableMaterializedViews = default(bool?), Azure.ResourceManager.CosmosDB.Models.DatabaseAccountKeysMetadata keysMetadata = null, bool? enablePartitionMerge = default(bool?), bool? enableBurstCapacity = default(bool?), Azure.ResourceManager.CosmosDB.Models.CosmosDBMinimalTlsVersion? minimalTlsVersion = default(Azure.ResourceManager.CosmosDB.Models.CosmosDBMinimalTlsVersion?), string customerManagedKeyStatus = null, bool? enablePriorityBasedExecution = default(bool?), Azure.ResourceManager.CosmosDB.Models.DefaultPriorityLevel? defaultPriorityLevel = default(Azure.ResourceManager.CosmosDB.Models.DefaultPriorityLevel?), bool? enablePerRegionPerPartitionAutoscale = default(bool?), bool? enableAllVersionsAndDeletesChangeFeed = default(bool?), Azure.ResourceManager.Models.ManagedServiceIdentity identity = null) { throw null; } public static Azure.ResourceManager.CosmosDB.Models.CosmosDBAccountKeyList CosmosDBAccountKeyList(string primaryReadonlyMasterKey = null, string secondaryReadonlyMasterKey = null, string primaryMasterKey = null, string secondaryMasterKey = null) { throw null; } public static Azure.ResourceManager.CosmosDB.Models.CosmosDBAccountLocation CosmosDBAccountLocation(string id = null, Azure.Core.AzureLocation? locationName = default(Azure.Core.AzureLocation?), string documentEndpoint = null, string provisioningState = null, int? failoverPriority = default(int?), bool? isZoneRedundant = default(bool?)) { throw null; } - public static Azure.ResourceManager.CosmosDB.Models.CosmosDBAccountPatch CosmosDBAccountPatch(System.Collections.Generic.IDictionary tags = null, Azure.Core.AzureLocation? location = default(Azure.Core.AzureLocation?), Azure.ResourceManager.Models.ManagedServiceIdentity identity = null, Azure.ResourceManager.CosmosDB.Models.ConsistencyPolicy consistencyPolicy = null, System.Collections.Generic.IEnumerable locations = null, System.Collections.Generic.IEnumerable ipRules = null, bool? isVirtualNetworkFilterEnabled = default(bool?), bool? enableAutomaticFailover = default(bool?), System.Collections.Generic.IEnumerable capabilities = null, System.Collections.Generic.IEnumerable virtualNetworkRules = null, bool? enableMultipleWriteLocations = default(bool?), bool? enableCassandraConnector = default(bool?), Azure.ResourceManager.CosmosDB.Models.ConnectorOffer? connectorOffer = default(Azure.ResourceManager.CosmosDB.Models.ConnectorOffer?), bool? disableKeyBasedMetadataWriteAccess = default(bool?), System.Uri keyVaultKeyUri = null, string defaultIdentity = null, Azure.ResourceManager.CosmosDB.Models.CosmosDBPublicNetworkAccess? publicNetworkAccess = default(Azure.ResourceManager.CosmosDB.Models.CosmosDBPublicNetworkAccess?), bool? isFreeTierEnabled = default(bool?), Azure.ResourceManager.CosmosDB.Models.CosmosDBServerVersion? apiServerVersion = default(Azure.ResourceManager.CosmosDB.Models.CosmosDBServerVersion?), bool? isAnalyticalStorageEnabled = default(bool?), Azure.ResourceManager.CosmosDB.Models.AnalyticalStorageSchemaType? analyticalStorageSchemaType = default(Azure.ResourceManager.CosmosDB.Models.AnalyticalStorageSchemaType?), Azure.ResourceManager.CosmosDB.Models.CosmosDBAccountBackupPolicy backupPolicy = null, System.Collections.Generic.IEnumerable cors = null, Azure.ResourceManager.CosmosDB.Models.NetworkAclBypass? networkAclBypass = default(Azure.ResourceManager.CosmosDB.Models.NetworkAclBypass?), System.Collections.Generic.IEnumerable networkAclBypassResourceIds = null, Azure.ResourceManager.CosmosDB.Models.EnableFullTextQuery? diagnosticLogEnableFullTextQuery = default(Azure.ResourceManager.CosmosDB.Models.EnableFullTextQuery?), bool? disableLocalAuth = default(bool?), int? capacityTotalThroughputLimit = default(int?), Azure.ResourceManager.CosmosDB.Models.CapacityMode? capacityMode = default(Azure.ResourceManager.CosmosDB.Models.CapacityMode?), bool? enableMaterializedViews = default(bool?), Azure.ResourceManager.CosmosDB.Models.DatabaseAccountKeysMetadata keysMetadata = null, bool? enablePartitionMerge = default(bool?), bool? enableBurstCapacity = default(bool?), Azure.ResourceManager.CosmosDB.Models.CosmosDBMinimalTlsVersion? minimalTlsVersion = default(Azure.ResourceManager.CosmosDB.Models.CosmosDBMinimalTlsVersion?), string customerManagedKeyStatus = null, bool? enablePriorityBasedExecution = default(bool?), Azure.ResourceManager.CosmosDB.Models.DefaultPriorityLevel? defaultPriorityLevel = default(Azure.ResourceManager.CosmosDB.Models.DefaultPriorityLevel?), bool? enablePerRegionPerPartitionAutoscale = default(bool?)) { throw null; } + public static Azure.ResourceManager.CosmosDB.Models.CosmosDBAccountPatch CosmosDBAccountPatch(System.Collections.Generic.IDictionary tags = null, Azure.Core.AzureLocation? location = default(Azure.Core.AzureLocation?), Azure.ResourceManager.Models.ManagedServiceIdentity identity = null, Azure.ResourceManager.CosmosDB.Models.ConsistencyPolicy consistencyPolicy = null, System.Collections.Generic.IEnumerable locations = null, System.Collections.Generic.IEnumerable ipRules = null, bool? isVirtualNetworkFilterEnabled = default(bool?), bool? enableAutomaticFailover = default(bool?), System.Collections.Generic.IEnumerable capabilities = null, System.Collections.Generic.IEnumerable virtualNetworkRules = null, bool? enableMultipleWriteLocations = default(bool?), bool? enableCassandraConnector = default(bool?), Azure.ResourceManager.CosmosDB.Models.ConnectorOffer? connectorOffer = default(Azure.ResourceManager.CosmosDB.Models.ConnectorOffer?), bool? disableKeyBasedMetadataWriteAccess = default(bool?), System.Uri keyVaultKeyUri = null, string defaultIdentity = null, Azure.ResourceManager.CosmosDB.Models.CosmosDBPublicNetworkAccess? publicNetworkAccess = default(Azure.ResourceManager.CosmosDB.Models.CosmosDBPublicNetworkAccess?), bool? isFreeTierEnabled = default(bool?), Azure.ResourceManager.CosmosDB.Models.CosmosDBServerVersion? apiServerVersion = default(Azure.ResourceManager.CosmosDB.Models.CosmosDBServerVersion?), bool? isAnalyticalStorageEnabled = default(bool?), Azure.ResourceManager.CosmosDB.Models.AnalyticalStorageSchemaType? analyticalStorageSchemaType = default(Azure.ResourceManager.CosmosDB.Models.AnalyticalStorageSchemaType?), Azure.ResourceManager.CosmosDB.Models.CosmosDBAccountBackupPolicy backupPolicy = null, System.Collections.Generic.IEnumerable cors = null, Azure.ResourceManager.CosmosDB.Models.NetworkAclBypass? networkAclBypass = default(Azure.ResourceManager.CosmosDB.Models.NetworkAclBypass?), System.Collections.Generic.IEnumerable networkAclBypassResourceIds = null, Azure.ResourceManager.CosmosDB.Models.EnableFullTextQuery? diagnosticLogEnableFullTextQuery = default(Azure.ResourceManager.CosmosDB.Models.EnableFullTextQuery?), bool? disableLocalAuth = default(bool?), int? capacityTotalThroughputLimit = default(int?), Azure.ResourceManager.CosmosDB.Models.CapacityMode? capacityMode = default(Azure.ResourceManager.CosmosDB.Models.CapacityMode?), bool? enableMaterializedViews = default(bool?), Azure.ResourceManager.CosmosDB.Models.DatabaseAccountKeysMetadata keysMetadata = null, bool? enablePartitionMerge = default(bool?), bool? enableBurstCapacity = default(bool?), Azure.ResourceManager.CosmosDB.Models.CosmosDBMinimalTlsVersion? minimalTlsVersion = default(Azure.ResourceManager.CosmosDB.Models.CosmosDBMinimalTlsVersion?), string customerManagedKeyStatus = null, bool? enablePriorityBasedExecution = default(bool?), Azure.ResourceManager.CosmosDB.Models.DefaultPriorityLevel? defaultPriorityLevel = default(Azure.ResourceManager.CosmosDB.Models.DefaultPriorityLevel?), bool? enablePerRegionPerPartitionAutoscale = default(bool?), bool? enableAllVersionsAndDeletesChangeFeed = default(bool?)) { throw null; } public static Azure.ResourceManager.CosmosDB.Models.CosmosDBAccountReadOnlyKeyList CosmosDBAccountReadOnlyKeyList(string primaryReadonlyMasterKey = null, string secondaryReadonlyMasterKey = null) { throw null; } public static Azure.ResourceManager.CosmosDB.Models.CosmosDBBackupInformation CosmosDBBackupInformation(System.DateTimeOffset? continuousBackupInformationLatestRestorableTimestamp = default(System.DateTimeOffset?)) { throw null; } public static Azure.ResourceManager.CosmosDB.Models.CosmosDBBaseMetric CosmosDBBaseMetric(System.DateTimeOffset? startOn = default(System.DateTimeOffset?), System.DateTimeOffset? endOn = default(System.DateTimeOffset?), string timeGrain = null, Azure.ResourceManager.CosmosDB.Models.CosmosDBMetricUnitType? unit = default(Azure.ResourceManager.CosmosDB.Models.CosmosDBMetricUnitType?), Azure.ResourceManager.CosmosDB.Models.CosmosDBMetricName name = null, System.Collections.Generic.IEnumerable metricValues = null) { throw null; } @@ -2621,7 +3242,7 @@ public static partial class ArmCosmosDBModelFactory public static Azure.ResourceManager.CosmosDB.Models.DataTransferServiceProperties DataTransferServiceProperties(System.DateTimeOffset? createdOn = default(System.DateTimeOffset?), Azure.ResourceManager.CosmosDB.Models.CosmosDBServiceSize? instanceSize = default(Azure.ResourceManager.CosmosDB.Models.CosmosDBServiceSize?), int? instanceCount = default(int?), Azure.ResourceManager.CosmosDB.Models.CosmosDBServiceStatus? status = default(Azure.ResourceManager.CosmosDB.Models.CosmosDBServiceStatus?), System.Collections.Generic.IDictionary additionalProperties = null, System.Collections.Generic.IEnumerable locations = null) { throw null; } public static Azure.ResourceManager.CosmosDB.Models.ExtendedCassandraKeyspaceResourceInfo ExtendedCassandraKeyspaceResourceInfo(string keyspaceName = null, string rid = null, float? timestamp = default(float?), Azure.ETag? etag = default(Azure.ETag?)) { throw null; } public static Azure.ResourceManager.CosmosDB.Models.ExtendedCassandraTableResourceInfo ExtendedCassandraTableResourceInfo(string tableName = null, int? defaultTtl = default(int?), Azure.ResourceManager.CosmosDB.Models.CassandraSchema schema = null, int? analyticalStorageTtl = default(int?), string rid = null, float? timestamp = default(float?), Azure.ETag? etag = default(Azure.ETag?)) { throw null; } - public static Azure.ResourceManager.CosmosDB.Models.ExtendedCosmosDBSqlContainerResourceInfo ExtendedCosmosDBSqlContainerResourceInfo(string containerName = null, Azure.ResourceManager.CosmosDB.Models.CosmosDBIndexingPolicy indexingPolicy = null, Azure.ResourceManager.CosmosDB.Models.CosmosDBContainerPartitionKey partitionKey = null, int? defaultTtl = default(int?), System.Collections.Generic.IEnumerable uniqueKeys = null, Azure.ResourceManager.CosmosDB.Models.ConflictResolutionPolicy conflictResolutionPolicy = null, Azure.ResourceManager.CosmosDB.Models.CosmosDBClientEncryptionPolicy clientEncryptionPolicy = null, long? analyticalStorageTtl = default(long?), Azure.ResourceManager.CosmosDB.Models.ResourceRestoreParameters restoreParameters = null, Azure.ResourceManager.CosmosDB.Models.CosmosDBAccountCreateMode? createMode = default(Azure.ResourceManager.CosmosDB.Models.CosmosDBAccountCreateMode?), Azure.ResourceManager.CosmosDB.Models.MaterializedViewDefinition materializedViewDefinition = null, System.Collections.Generic.IEnumerable computedProperties = null, System.Collections.Generic.IEnumerable vectorEmbeddings = null, string rid = null, float? timestamp = default(float?), Azure.ETag? etag = default(Azure.ETag?)) { throw null; } + public static Azure.ResourceManager.CosmosDB.Models.ExtendedCosmosDBSqlContainerResourceInfo ExtendedCosmosDBSqlContainerResourceInfo(string containerName = null, Azure.ResourceManager.CosmosDB.Models.CosmosDBIndexingPolicy indexingPolicy = null, Azure.ResourceManager.CosmosDB.Models.CosmosDBContainerPartitionKey partitionKey = null, int? defaultTtl = default(int?), System.Collections.Generic.IEnumerable uniqueKeys = null, Azure.ResourceManager.CosmosDB.Models.ConflictResolutionPolicy conflictResolutionPolicy = null, Azure.ResourceManager.CosmosDB.Models.CosmosDBClientEncryptionPolicy clientEncryptionPolicy = null, long? analyticalStorageTtl = default(long?), Azure.ResourceManager.CosmosDB.Models.ResourceRestoreParameters restoreParameters = null, Azure.ResourceManager.CosmosDB.Models.CosmosDBAccountCreateMode? createMode = default(Azure.ResourceManager.CosmosDB.Models.CosmosDBAccountCreateMode?), Azure.ResourceManager.CosmosDB.Models.MaterializedViewDefinition materializedViewDefinition = null, System.Collections.Generic.IEnumerable materializedViews = null, System.Collections.Generic.IEnumerable computedProperties = null, System.Collections.Generic.IEnumerable vectorEmbeddings = null, Azure.ResourceManager.CosmosDB.Models.FullTextPolicy fullTextPolicy = null, string rid = null, float? timestamp = default(float?), Azure.ETag? etag = default(Azure.ETag?)) { throw null; } public static Azure.ResourceManager.CosmosDB.Models.ExtendedCosmosDBSqlDatabaseResourceInfo ExtendedCosmosDBSqlDatabaseResourceInfo(string databaseName = null, Azure.ResourceManager.CosmosDB.Models.ResourceRestoreParameters restoreParameters = null, Azure.ResourceManager.CosmosDB.Models.CosmosDBAccountCreateMode? createMode = default(Azure.ResourceManager.CosmosDB.Models.CosmosDBAccountCreateMode?), string colls = null, string users = null, string rid = null, float? timestamp = default(float?), Azure.ETag? etag = default(Azure.ETag?)) { throw null; } public static Azure.ResourceManager.CosmosDB.Models.ExtendedCosmosDBSqlStoredProcedureResourceInfo ExtendedCosmosDBSqlStoredProcedureResourceInfo(string storedProcedureName = null, string body = null, string rid = null, float? timestamp = default(float?), Azure.ETag? etag = default(Azure.ETag?)) { throw null; } public static Azure.ResourceManager.CosmosDB.Models.ExtendedCosmosDBSqlTriggerResourceInfo ExtendedCosmosDBSqlTriggerResourceInfo(string triggerName = null, string body = null, Azure.ResourceManager.CosmosDB.Models.CosmosDBSqlTriggerType? triggerType = default(Azure.ResourceManager.CosmosDB.Models.CosmosDBSqlTriggerType?), Azure.ResourceManager.CosmosDB.Models.CosmosDBSqlTriggerOperation? triggerOperation = default(Azure.ResourceManager.CosmosDB.Models.CosmosDBSqlTriggerOperation?), string rid = null, float? timestamp = default(float?), Azure.ETag? etag = default(Azure.ETag?)) { throw null; } @@ -2638,6 +3259,10 @@ public static partial class ArmCosmosDBModelFactory public static Azure.ResourceManager.CosmosDB.Models.ExtendedRestorableSqlDatabaseResourceInfo ExtendedRestorableSqlDatabaseResourceInfo(string rid = null, Azure.ResourceManager.CosmosDB.Models.CosmosDBOperationType? operationType = default(Azure.ResourceManager.CosmosDB.Models.CosmosDBOperationType?), string canUndelete = null, string canUndeleteReason = null, string eventTimestamp = null, string databaseName = null, string databaseId = null, Azure.ResourceManager.CosmosDB.Models.RestorableSqlDatabasePropertiesResourceDatabase database = null) { throw null; } public static Azure.ResourceManager.CosmosDB.Models.ExtendedRestorableTableResourceInfo ExtendedRestorableTableResourceInfo(string rid = null, Azure.ResourceManager.CosmosDB.Models.CosmosDBOperationType? operationType = default(Azure.ResourceManager.CosmosDB.Models.CosmosDBOperationType?), string canUndelete = null, string canUndeleteReason = null, string eventTimestamp = null, string tableName = null, string tableId = null) { throw null; } public static Azure.ResourceManager.CosmosDB.Models.ExtendedThroughputSettingsResourceInfo ExtendedThroughputSettingsResourceInfo(int? throughput = default(int?), Azure.ResourceManager.CosmosDB.Models.AutoscaleSettingsResourceInfo autoscaleSettings = null, string minimumThroughput = null, string offerReplacePending = null, string instantMaximumThroughput = null, string softAllowedMaximumThroughput = null, System.Collections.Generic.IEnumerable throughputBuckets = null, string rid = null, float? timestamp = default(float?), Azure.ETag? etag = default(Azure.ETag?)) { throw null; } + public static Azure.ResourceManager.CosmosDB.FleetAnalyticsResourceData FleetAnalyticsResourceData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.CosmosDB.Models.CosmosDBStatus? provisioningState = default(Azure.ResourceManager.CosmosDB.Models.CosmosDBStatus?), Azure.ResourceManager.CosmosDB.Models.FleetAnalyticsPropertiesStorageLocationType? storageLocationType = default(Azure.ResourceManager.CosmosDB.Models.FleetAnalyticsPropertiesStorageLocationType?), System.Uri storageLocationUri = null) { throw null; } + public static Azure.ResourceManager.CosmosDB.FleetResourceData FleetResourceData(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.CosmosDB.Models.CosmosDBStatus? provisioningState = default(Azure.ResourceManager.CosmosDB.Models.CosmosDBStatus?)) { throw null; } + public static Azure.ResourceManager.CosmosDB.FleetspaceAccountResourceData FleetspaceAccountResourceData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.CosmosDB.Models.CosmosDBStatus? provisioningState = default(Azure.ResourceManager.CosmosDB.Models.CosmosDBStatus?), string accountResourceIdentifier = null, string accountLocation = null) { throw null; } + public static Azure.ResourceManager.CosmosDB.FleetspaceResourceData FleetspaceResourceData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.CosmosDB.Models.CosmosDBStatus? provisioningState = default(Azure.ResourceManager.CosmosDB.Models.CosmosDBStatus?), Azure.ResourceManager.CosmosDB.Models.FleetspacePropertiesFleetspaceApiKind? fleetspaceApiKind = default(Azure.ResourceManager.CosmosDB.Models.FleetspacePropertiesFleetspaceApiKind?), Azure.ResourceManager.CosmosDB.Models.FleetspacePropertiesThroughputPoolConfiguration throughputPoolConfiguration = null) { throw null; } public static Azure.ResourceManager.CosmosDB.Models.GraphApiComputeRegionalService GraphApiComputeRegionalService(string name = null, Azure.Core.AzureLocation? location = default(Azure.Core.AzureLocation?), Azure.ResourceManager.CosmosDB.Models.CosmosDBServiceStatus? status = default(Azure.ResourceManager.CosmosDB.Models.CosmosDBServiceStatus?), string graphApiComputeEndpoint = null) { throw null; } public static Azure.ResourceManager.CosmosDB.Models.GraphApiComputeServiceProperties GraphApiComputeServiceProperties(System.DateTimeOffset? createdOn = default(System.DateTimeOffset?), Azure.ResourceManager.CosmosDB.Models.CosmosDBServiceSize? instanceSize = default(Azure.ResourceManager.CosmosDB.Models.CosmosDBServiceSize?), int? instanceCount = default(int?), Azure.ResourceManager.CosmosDB.Models.CosmosDBServiceStatus? status = default(Azure.ResourceManager.CosmosDB.Models.CosmosDBServiceStatus?), System.Collections.Generic.IDictionary additionalProperties = null, string graphApiComputeEndpoint = null, System.Collections.Generic.IEnumerable locations = null) { throw null; } public static Azure.ResourceManager.CosmosDB.Models.GraphResourceGetResultCreateOrUpdateContent GraphResourceGetResultCreateOrUpdateContent(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.Core.ResourceIdentifier resourceId = null, Azure.ResourceManager.CosmosDB.Models.CosmosDBCreateUpdateConfig options = null, Azure.ResourceManager.Models.ManagedServiceIdentity identity = null) { throw null; } @@ -2646,6 +3271,8 @@ public static partial class ArmCosmosDBModelFactory public static Azure.ResourceManager.CosmosDB.GremlinDatabaseData GremlinDatabaseData(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.CosmosDB.Models.ExtendedGremlinDatabaseResourceInfo resource = null, Azure.ResourceManager.CosmosDB.Models.GremlinDatabasePropertiesConfig options = null, Azure.ResourceManager.Models.ManagedServiceIdentity identity = null) { throw null; } public static Azure.ResourceManager.CosmosDB.Models.GremlinGraphCreateOrUpdateContent GremlinGraphCreateOrUpdateContent(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.CosmosDB.Models.GremlinGraphResourceInfo resource = null, Azure.ResourceManager.CosmosDB.Models.CosmosDBCreateUpdateConfig options = null, Azure.ResourceManager.Models.ManagedServiceIdentity identity = null) { throw null; } public static Azure.ResourceManager.CosmosDB.GremlinGraphData GremlinGraphData(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.CosmosDB.Models.ExtendedGremlinGraphResourceInfo resource = null, Azure.ResourceManager.CosmosDB.Models.GremlinGraphPropertiesConfig options = null, Azure.ResourceManager.Models.ManagedServiceIdentity identity = null) { throw null; } + public static Azure.ResourceManager.CosmosDB.GremlinRoleAssignmentResourceData GremlinRoleAssignmentResourceData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, string roleDefinitionId = null, string scope = null, System.Guid? principalId = default(System.Guid?), string provisioningState = null) { throw null; } + public static Azure.ResourceManager.CosmosDB.GremlinRoleDefinitionResourceData GremlinRoleDefinitionResourceData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, string idPropertiesId = null, string roleName = null, Azure.ResourceManager.CosmosDB.Models.CosmosDBSqlRoleDefinitionType? typePropertiesType = default(Azure.ResourceManager.CosmosDB.Models.CosmosDBSqlRoleDefinitionType?), System.Collections.Generic.IEnumerable assignableScopes = null, System.Collections.Generic.IEnumerable permissions = null) { throw null; } public static Azure.ResourceManager.CosmosDB.Models.MaterializedViewDefinition MaterializedViewDefinition(string sourceCollectionRid = null, string sourceCollectionId = null, string definition = null) { throw null; } public static Azure.ResourceManager.CosmosDB.Models.MaterializedViewsBuilderRegionalService MaterializedViewsBuilderRegionalService(string name = null, Azure.Core.AzureLocation? location = default(Azure.Core.AzureLocation?), Azure.ResourceManager.CosmosDB.Models.CosmosDBServiceStatus? status = default(Azure.ResourceManager.CosmosDB.Models.CosmosDBServiceStatus?)) { throw null; } public static Azure.ResourceManager.CosmosDB.Models.MaterializedViewsBuilderServiceProperties MaterializedViewsBuilderServiceProperties(System.DateTimeOffset? createdOn = default(System.DateTimeOffset?), Azure.ResourceManager.CosmosDB.Models.CosmosDBServiceSize? instanceSize = default(Azure.ResourceManager.CosmosDB.Models.CosmosDBServiceSize?), int? instanceCount = default(int?), Azure.ResourceManager.CosmosDB.Models.CosmosDBServiceStatus? status = default(Azure.ResourceManager.CosmosDB.Models.CosmosDBServiceStatus?), System.Collections.Generic.IDictionary additionalProperties = null, System.Collections.Generic.IEnumerable locations = null) { throw null; } @@ -2655,8 +3282,13 @@ public static partial class ArmCosmosDBModelFactory public static Azure.ResourceManager.CosmosDB.MongoDBDatabaseData MongoDBDatabaseData(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.CosmosDB.Models.ExtendedMongoDBDatabaseResourceInfo resource = null, Azure.ResourceManager.CosmosDB.Models.MongoDBDatabasePropertiesConfig options = null, Azure.ResourceManager.Models.ManagedServiceIdentity identity = null) { throw null; } public static Azure.ResourceManager.CosmosDB.MongoDBRoleDefinitionData MongoDBRoleDefinitionData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, string roleName = null, Azure.ResourceManager.CosmosDB.Models.MongoDBRoleDefinitionType? roleDefinitionType = default(Azure.ResourceManager.CosmosDB.Models.MongoDBRoleDefinitionType?), string databaseName = null, System.Collections.Generic.IEnumerable privileges = null, System.Collections.Generic.IEnumerable roles = null) { throw null; } public static Azure.ResourceManager.CosmosDB.MongoDBUserDefinitionData MongoDBUserDefinitionData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, string userName = null, string password = null, string databaseName = null, string customData = null, System.Collections.Generic.IEnumerable roles = null, string mechanisms = null) { throw null; } + public static Azure.ResourceManager.CosmosDB.MongoMIRoleAssignmentResourceData MongoMIRoleAssignmentResourceData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, string roleDefinitionId = null, string scope = null, System.Guid? principalId = default(System.Guid?), string provisioningState = null) { throw null; } + public static Azure.ResourceManager.CosmosDB.MongoMIRoleDefinitionResourceData MongoMIRoleDefinitionResourceData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, string idPropertiesId = null, string roleName = null, Azure.ResourceManager.CosmosDB.Models.CosmosDBSqlRoleDefinitionType? typePropertiesType = default(Azure.ResourceManager.CosmosDB.Models.CosmosDBSqlRoleDefinitionType?), System.Collections.Generic.IEnumerable assignableScopes = null, System.Collections.Generic.IEnumerable permissions = null) { throw null; } + public static Azure.ResourceManager.CosmosDB.Models.MongoRUToMongoRUCopyJobTask MongoRUToMongoRUCopyJobTask(long? totalCount = default(long?), long? processedCount = default(long?), Azure.ResourceManager.CosmosDB.Models.CosmosDBMongoCollection source = null, Azure.ResourceManager.CosmosDB.Models.CosmosDBMongoCollection destination = null) { throw null; } + public static Azure.ResourceManager.CosmosDB.Models.MongoRUToMongoVCoreCopyJobTask MongoRUToMongoVCoreCopyJobTask(long? totalCount = default(long?), long? processedCount = default(long?), Azure.ResourceManager.CosmosDB.Models.CosmosDBMongoCollection source = null, Azure.ResourceManager.CosmosDB.Models.CosmosDBMongoVCoreCollection destination = null) { throw null; } public static Azure.ResourceManager.CosmosDB.NetworkSecurityPerimeterConfigurationData NetworkSecurityPerimeterConfigurationData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.CosmosDB.Models.NetworkSecurityPerimeterConfigurationProperties properties = null) { throw null; } public static Azure.ResourceManager.CosmosDB.Models.NetworkSecurityPerimeterConfigurationProperties NetworkSecurityPerimeterConfigurationProperties(Azure.ResourceManager.CosmosDB.Models.NetworkSecurityPerimeterConfigurationProvisioningState? provisioningState = default(Azure.ResourceManager.CosmosDB.Models.NetworkSecurityPerimeterConfigurationProvisioningState?), System.Collections.Generic.IEnumerable provisioningIssues = null, Azure.ResourceManager.CosmosDB.Models.NetworkSecurityPerimeter networkSecurityPerimeter = null, Azure.ResourceManager.CosmosDB.Models.ResourceAssociation resourceAssociation = null, Azure.ResourceManager.CosmosDB.Models.NetworkSecurityProfile profile = null) { throw null; } + public static Azure.ResourceManager.CosmosDB.Models.NoSqlRUToNoSqlRUCopyJobTask NoSqlRUToNoSqlRUCopyJobTask(long? totalCount = default(long?), long? processedCount = default(long?), Azure.ResourceManager.CosmosDB.Models.CosmosDBNoSqlContainer source = null, Azure.ResourceManager.CosmosDB.Models.CosmosDBNoSqlContainer destination = null) { throw null; } public static Azure.ResourceManager.CosmosDB.Models.PartitionMetric PartitionMetric(System.DateTimeOffset? startOn = default(System.DateTimeOffset?), System.DateTimeOffset? endOn = default(System.DateTimeOffset?), string timeGrain = null, Azure.ResourceManager.CosmosDB.Models.CosmosDBMetricUnitType? unit = default(Azure.ResourceManager.CosmosDB.Models.CosmosDBMetricUnitType?), Azure.ResourceManager.CosmosDB.Models.CosmosDBMetricName name = null, System.Collections.Generic.IEnumerable metricValues = null, System.Guid? partitionId = default(System.Guid?), string partitionKeyRangeId = null) { throw null; } public static Azure.ResourceManager.CosmosDB.Models.PartitionUsage PartitionUsage(Azure.ResourceManager.CosmosDB.Models.CosmosDBMetricUnitType? unit = default(Azure.ResourceManager.CosmosDB.Models.CosmosDBMetricUnitType?), Azure.ResourceManager.CosmosDB.Models.CosmosDBMetricName name = null, string quotaPeriod = null, long? limit = default(long?), long? currentValue = default(long?), System.Guid? partitionId = default(System.Guid?), string partitionKeyRangeId = null) { throw null; } public static Azure.ResourceManager.CosmosDB.Models.PercentileMetricValue PercentileMetricValue(int? count = default(int?), double? average = default(double?), double? maximum = default(double?), double? minimum = default(double?), System.DateTimeOffset? timestamp = default(System.DateTimeOffset?), double? total = default(double?), double? p10 = default(double?), double? p25 = default(double?), double? p50 = default(double?), double? p75 = default(double?), double? p90 = default(double?), double? p95 = default(double?), double? p99 = default(double?)) { throw null; } @@ -2675,7 +3307,7 @@ public static partial class ArmCosmosDBModelFactory public static Azure.ResourceManager.CosmosDB.Models.RestorableMongoDBDatabase RestorableMongoDBDatabase(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.CosmosDB.Models.ExtendedRestorableMongoDBDatabaseResourceInfo resource = null) { throw null; } public static Azure.ResourceManager.CosmosDB.Models.RestorableMongoDBResourceData RestorableMongoDBResourceData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, string databaseName = null, System.Collections.Generic.IEnumerable collectionNames = null) { throw null; } public static Azure.ResourceManager.CosmosDB.Models.RestorableSqlContainer RestorableSqlContainer(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.CosmosDB.Models.ExtendedRestorableSqlContainerResourceInfo resource = null) { throw null; } - public static Azure.ResourceManager.CosmosDB.Models.RestorableSqlContainerPropertiesResourceContainer RestorableSqlContainerPropertiesResourceContainer(string containerName = null, Azure.ResourceManager.CosmosDB.Models.CosmosDBIndexingPolicy indexingPolicy = null, Azure.ResourceManager.CosmosDB.Models.CosmosDBContainerPartitionKey partitionKey = null, int? defaultTtl = default(int?), System.Collections.Generic.IEnumerable uniqueKeys = null, Azure.ResourceManager.CosmosDB.Models.ConflictResolutionPolicy conflictResolutionPolicy = null, Azure.ResourceManager.CosmosDB.Models.CosmosDBClientEncryptionPolicy clientEncryptionPolicy = null, long? analyticalStorageTtl = default(long?), Azure.ResourceManager.CosmosDB.Models.ResourceRestoreParameters restoreParameters = null, Azure.ResourceManager.CosmosDB.Models.CosmosDBAccountCreateMode? createMode = default(Azure.ResourceManager.CosmosDB.Models.CosmosDBAccountCreateMode?), Azure.ResourceManager.CosmosDB.Models.MaterializedViewDefinition materializedViewDefinition = null, System.Collections.Generic.IEnumerable computedProperties = null, System.Collections.Generic.IEnumerable vectorEmbeddings = null, string self = null, string rid = null, float? timestamp = default(float?), Azure.ETag? etag = default(Azure.ETag?)) { throw null; } + public static Azure.ResourceManager.CosmosDB.Models.RestorableSqlContainerPropertiesResourceContainer RestorableSqlContainerPropertiesResourceContainer(string containerName = null, Azure.ResourceManager.CosmosDB.Models.CosmosDBIndexingPolicy indexingPolicy = null, Azure.ResourceManager.CosmosDB.Models.CosmosDBContainerPartitionKey partitionKey = null, int? defaultTtl = default(int?), System.Collections.Generic.IEnumerable uniqueKeys = null, Azure.ResourceManager.CosmosDB.Models.ConflictResolutionPolicy conflictResolutionPolicy = null, Azure.ResourceManager.CosmosDB.Models.CosmosDBClientEncryptionPolicy clientEncryptionPolicy = null, long? analyticalStorageTtl = default(long?), Azure.ResourceManager.CosmosDB.Models.ResourceRestoreParameters restoreParameters = null, Azure.ResourceManager.CosmosDB.Models.CosmosDBAccountCreateMode? createMode = default(Azure.ResourceManager.CosmosDB.Models.CosmosDBAccountCreateMode?), Azure.ResourceManager.CosmosDB.Models.MaterializedViewDefinition materializedViewDefinition = null, System.Collections.Generic.IEnumerable materializedViews = null, System.Collections.Generic.IEnumerable computedProperties = null, System.Collections.Generic.IEnumerable vectorEmbeddings = null, Azure.ResourceManager.CosmosDB.Models.FullTextPolicy fullTextPolicy = null, string self = null, string rid = null, float? timestamp = default(float?), Azure.ETag? etag = default(Azure.ETag?)) { throw null; } public static Azure.ResourceManager.CosmosDB.Models.RestorableSqlDatabase RestorableSqlDatabase(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.CosmosDB.Models.ExtendedRestorableSqlDatabaseResourceInfo resource = null) { throw null; } public static Azure.ResourceManager.CosmosDB.Models.RestorableSqlDatabasePropertiesResourceDatabase RestorableSqlDatabasePropertiesResourceDatabase(string databaseName = null, Azure.ResourceManager.CosmosDB.Models.ResourceRestoreParameters restoreParameters = null, Azure.ResourceManager.CosmosDB.Models.CosmosDBAccountCreateMode? createMode = default(Azure.ResourceManager.CosmosDB.Models.CosmosDBAccountCreateMode?), string colls = null, string users = null, string self = null, string rid = null, float? timestamp = default(float?), Azure.ETag? etag = default(Azure.ETag?)) { throw null; } public static Azure.ResourceManager.CosmosDB.Models.RestorableSqlResourceData RestorableSqlResourceData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, string databaseName = null, System.Collections.Generic.IEnumerable collectionNames = null) { throw null; } @@ -2719,6 +3351,17 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } + public partial class AzureBlobContainer : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public AzureBlobContainer(string containerName) { } + public string ContainerName { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.CosmosDB.Models.AzureBlobContainer 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.CosmosDB.Models.AzureBlobContainer 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 AzureBlobDataTransferDataSourceSink : Azure.ResourceManager.CosmosDB.Models.DataTransferDataSourceSink, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public AzureBlobDataTransferDataSourceSink(string containerName) { } @@ -2731,6 +3374,17 @@ protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter write string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } + public partial class AzureBlobSourceSinkDetails : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public AzureBlobSourceSinkDetails(System.Uri endpointUri) { } + public System.Uri EndpointUri { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.CosmosDB.Models.AzureBlobSourceSinkDetails 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.CosmosDB.Models.AzureBlobSourceSinkDetails 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 BackupPolicyMigrationState : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public BackupPolicyMigrationState() { } @@ -2782,6 +3436,28 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer public static bool operator !=(Azure.ResourceManager.CosmosDB.Models.BackupPolicyType left, Azure.ResourceManager.CosmosDB.Models.BackupPolicyType right) { throw null; } public override string ToString() { throw null; } } + public abstract partial class BaseCopyJobProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + protected BaseCopyJobProperties() { } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.CosmosDB.Models.BaseCopyJobProperties 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.CosmosDB.Models.BaseCopyJobProperties 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 BaseCopyJobTask : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public BaseCopyJobTask() { } + public long? ProcessedCount { get { throw null; } } + public long? TotalCount { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.CosmosDB.Models.BaseCopyJobTask 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.CosmosDB.Models.BaseCopyJobTask 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 BaseCosmosDataTransferDataSourceSink : Azure.ResourceManager.CosmosDB.Models.DataTransferDataSourceSink, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public BaseCosmosDataTransferDataSourceSink() { } @@ -2793,6 +3469,31 @@ protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter write string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } + public partial class BlobToCassandraRUCopyJobProperties : Azure.ResourceManager.CosmosDB.Models.BaseCopyJobProperties, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public BlobToCassandraRUCopyJobProperties(Azure.ResourceManager.CosmosDB.Models.AzureBlobSourceSinkDetails sourceDetails, System.Collections.Generic.IEnumerable tasks) { } + public string DestinationDetailsRemoteAccountName { get { throw null; } set { } } + public System.Uri SourceDetailsEndpointUri { get { throw null; } set { } } + public System.Collections.Generic.IList Tasks { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.CosmosDB.Models.BlobToCassandraRUCopyJobProperties 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.CosmosDB.Models.BlobToCassandraRUCopyJobProperties 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 BlobToCassandraRUCopyJobTask : Azure.ResourceManager.CosmosDB.Models.BaseCopyJobTask, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public BlobToCassandraRUCopyJobTask(Azure.ResourceManager.CosmosDB.Models.AzureBlobContainer source, Azure.ResourceManager.CosmosDB.Models.CosmosDBCassandraTable destination) { } + public Azure.ResourceManager.CosmosDB.Models.CosmosDBCassandraTable Destination { get { throw null; } set { } } + public string SourceContainerName { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.CosmosDB.Models.BlobToCassandraRUCopyJobTask 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.CosmosDB.Models.BlobToCassandraRUCopyJobTask System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] public readonly partial struct CapacityMode : System.IEquatable { @@ -3337,6 +4038,56 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } + public partial class CassandraRUToBlobCopyJobProperties : Azure.ResourceManager.CosmosDB.Models.BaseCopyJobProperties, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public CassandraRUToBlobCopyJobProperties(Azure.ResourceManager.CosmosDB.Models.AzureBlobSourceSinkDetails destinationDetails, System.Collections.Generic.IEnumerable tasks) { } + public System.Uri DestinationDetailsEndpointUri { get { throw null; } set { } } + public string SourceDetailsRemoteAccountName { get { throw null; } set { } } + public System.Collections.Generic.IList Tasks { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.CosmosDB.Models.CassandraRUToBlobCopyJobProperties 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.CosmosDB.Models.CassandraRUToBlobCopyJobProperties 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 CassandraRUToBlobCopyJobTask : Azure.ResourceManager.CosmosDB.Models.BaseCopyJobTask, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public CassandraRUToBlobCopyJobTask(Azure.ResourceManager.CosmosDB.Models.CosmosDBCassandraTable source, Azure.ResourceManager.CosmosDB.Models.AzureBlobContainer destination) { } + public string DestinationContainerName { get { throw null; } set { } } + public Azure.ResourceManager.CosmosDB.Models.CosmosDBCassandraTable Source { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.CosmosDB.Models.CassandraRUToBlobCopyJobTask 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.CosmosDB.Models.CassandraRUToBlobCopyJobTask 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 CassandraRUToCassandraRUCopyJobProperties : Azure.ResourceManager.CosmosDB.Models.BaseCopyJobProperties, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public CassandraRUToCassandraRUCopyJobProperties(System.Collections.Generic.IEnumerable tasks) { } + public string DestinationDetailsRemoteAccountName { get { throw null; } set { } } + public string SourceDetailsRemoteAccountName { get { throw null; } set { } } + public System.Collections.Generic.IList Tasks { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.CosmosDB.Models.CassandraRUToCassandraRUCopyJobProperties 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.CosmosDB.Models.CassandraRUToCassandraRUCopyJobProperties 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 CassandraRUToCassandraRUCopyJobTask : Azure.ResourceManager.CosmosDB.Models.BaseCopyJobTask, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public CassandraRUToCassandraRUCopyJobTask(Azure.ResourceManager.CosmosDB.Models.CosmosDBCassandraTable source, Azure.ResourceManager.CosmosDB.Models.CosmosDBCassandraTable destination) { } + public Azure.ResourceManager.CosmosDB.Models.CosmosDBCassandraTable Destination { get { throw null; } set { } } + public Azure.ResourceManager.CosmosDB.Models.CosmosDBCassandraTable Source { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.CosmosDB.Models.CassandraRUToCassandraRUCopyJobTask 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.CosmosDB.Models.CassandraRUToCassandraRUCopyJobTask 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 CassandraSchema : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public CassandraSchema() { } @@ -3566,6 +4317,66 @@ protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter write public static bool operator !=(Azure.ResourceManager.CosmosDB.Models.ContinuousTier left, Azure.ResourceManager.CosmosDB.Models.ContinuousTier right) { throw null; } public override string ToString() { throw null; } } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct CopyJobMode : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public CopyJobMode(string value) { throw null; } + public static Azure.ResourceManager.CosmosDB.Models.CopyJobMode Offline { get { throw null; } } + public static Azure.ResourceManager.CosmosDB.Models.CopyJobMode Online { get { throw null; } } + public bool Equals(Azure.ResourceManager.CosmosDB.Models.CopyJobMode other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.CosmosDB.Models.CopyJobMode left, Azure.ResourceManager.CosmosDB.Models.CopyJobMode right) { throw null; } + public static implicit operator Azure.ResourceManager.CosmosDB.Models.CopyJobMode (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.CosmosDB.Models.CopyJobMode left, Azure.ResourceManager.CosmosDB.Models.CopyJobMode right) { throw null; } + public override string ToString() { throw null; } + } + public partial class CopyJobProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public CopyJobProperties(Azure.ResourceManager.CosmosDB.Models.BaseCopyJobProperties jobProperties) { } + public System.TimeSpan? Duration { get { throw null; } } + public Azure.ResourceManager.CosmosDB.Models.CosmosDBErrorResult Error { get { throw null; } } + public Azure.ResourceManager.CosmosDB.Models.BaseCopyJobProperties JobProperties { get { throw null; } set { } } + public System.DateTimeOffset? LastUpdatedUtcOn { get { throw null; } } + public Azure.ResourceManager.CosmosDB.Models.CopyJobMode? Mode { get { throw null; } set { } } + public long? ProcessedCount { get { throw null; } } + public Azure.ResourceManager.CosmosDB.Models.CopyJobStatus? Status { get { throw null; } } + public long? TotalCount { get { throw null; } } + public int? WorkerCount { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.CosmosDB.Models.CopyJobProperties 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.CosmosDB.Models.CopyJobProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct CopyJobStatus : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public CopyJobStatus(string value) { throw null; } + public static Azure.ResourceManager.CosmosDB.Models.CopyJobStatus Cancelled { get { throw null; } } + public static Azure.ResourceManager.CosmosDB.Models.CopyJobStatus Completed { get { throw null; } } + public static Azure.ResourceManager.CosmosDB.Models.CopyJobStatus Faulted { get { throw null; } } + public static Azure.ResourceManager.CosmosDB.Models.CopyJobStatus Partitioning { get { throw null; } } + public static Azure.ResourceManager.CosmosDB.Models.CopyJobStatus Paused { get { throw null; } } + public static Azure.ResourceManager.CosmosDB.Models.CopyJobStatus Pending { get { throw null; } } + public static Azure.ResourceManager.CosmosDB.Models.CopyJobStatus Running { get { throw null; } } + public bool Equals(Azure.ResourceManager.CosmosDB.Models.CopyJobStatus other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.CosmosDB.Models.CopyJobStatus left, Azure.ResourceManager.CosmosDB.Models.CopyJobStatus right) { throw null; } + public static implicit operator Azure.ResourceManager.CosmosDB.Models.CopyJobStatus (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.CosmosDB.Models.CopyJobStatus left, Azure.ResourceManager.CosmosDB.Models.CopyJobStatus right) { throw null; } + public override string ToString() { throw null; } + } public partial class CosmosCassandraDataTransferDataSourceSink : Azure.ResourceManager.CosmosDB.Models.BaseCosmosDataTransferDataSourceSink, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public CosmosCassandraDataTransferDataSourceSink(string keyspaceName, string tableName) { } @@ -3667,6 +4478,7 @@ public CosmosDBAccountCreateOrUpdateContent(Azure.Core.AzureLocation location, S public Azure.ResourceManager.CosmosDB.Models.EnableFullTextQuery? DiagnosticLogEnableFullTextQuery { get { throw null; } set { } } public bool? DisableKeyBasedMetadataWriteAccess { get { throw null; } set { } } public bool? DisableLocalAuth { get { throw null; } set { } } + public bool? EnableAllVersionsAndDeletesChangeFeed { get { throw null; } set { } } public bool? EnableAutomaticFailover { get { throw null; } set { } } public bool? EnableBurstCapacity { get { throw null; } set { } } public bool? EnableCassandraConnector { get { throw null; } set { } } @@ -3799,6 +4611,7 @@ public CosmosDBAccountPatch() { } public Azure.ResourceManager.CosmosDB.Models.EnableFullTextQuery? DiagnosticLogEnableFullTextQuery { get { throw null; } set { } } public bool? DisableKeyBasedMetadataWriteAccess { get { throw null; } set { } } public bool? DisableLocalAuth { get { throw null; } set { } } + public bool? EnableAllVersionsAndDeletesChangeFeed { get { throw null; } set { } } public bool? EnableAutomaticFailover { get { throw null; } set { } } public bool? EnableBurstCapacity { get { throw null; } set { } } public bool? EnableCassandraConnector { get { throw null; } set { } } @@ -3979,6 +4792,18 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } + public partial class CosmosDBCassandraTable : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public CosmosDBCassandraTable(string keyspaceName, string tableName) { } + public string KeyspaceName { get { throw null; } set { } } + public string TableName { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.CosmosDB.Models.CosmosDBCassandraTable 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.CosmosDB.Models.CosmosDBCassandraTable 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 CosmosDBChaosFaultSupportedAction { Enable = 0, @@ -4364,6 +5189,42 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer public static bool operator !=(Azure.ResourceManager.CosmosDB.Models.CosmosDBMinimalTlsVersion left, Azure.ResourceManager.CosmosDB.Models.CosmosDBMinimalTlsVersion right) { throw null; } public override string ToString() { throw null; } } + public partial class CosmosDBMongoCollection : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public CosmosDBMongoCollection(string databaseName, string collectionName) { } + public string CollectionName { get { throw null; } set { } } + public string DatabaseName { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.CosmosDB.Models.CosmosDBMongoCollection 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.CosmosDB.Models.CosmosDBMongoCollection 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 CosmosDBMongoVCoreCollection : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public CosmosDBMongoVCoreCollection(string databaseName, string collectionName) { } + public string CollectionName { get { throw null; } set { } } + public string DatabaseName { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.CosmosDB.Models.CosmosDBMongoVCoreCollection 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.CosmosDB.Models.CosmosDBMongoVCoreCollection 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 CosmosDBNoSqlContainer : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public CosmosDBNoSqlContainer(string databaseName, string containerName) { } + public string ContainerName { get { throw null; } set { } } + public string DatabaseName { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.CosmosDB.Models.CosmosDBNoSqlContainer 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.CosmosDB.Models.CosmosDBNoSqlContainer System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] public readonly partial struct CosmosDBOperationType : System.IEquatable { @@ -4682,8 +5543,10 @@ public CosmosDBSqlContainerResourceInfo(string containerName) { } public string ContainerName { get { throw null; } set { } } public Azure.ResourceManager.CosmosDB.Models.CosmosDBAccountCreateMode? CreateMode { get { throw null; } set { } } public int? DefaultTtl { get { throw null; } set { } } + public Azure.ResourceManager.CosmosDB.Models.FullTextPolicy FullTextPolicy { get { throw null; } set { } } public Azure.ResourceManager.CosmosDB.Models.CosmosDBIndexingPolicy IndexingPolicy { get { throw null; } set { } } public Azure.ResourceManager.CosmosDB.Models.MaterializedViewDefinition MaterializedViewDefinition { get { throw null; } set { } } + public System.Collections.Generic.IList MaterializedViews { get { throw null; } } public Azure.ResourceManager.CosmosDB.Models.CosmosDBContainerPartitionKey PartitionKey { get { throw null; } set { } } public Azure.ResourceManager.CosmosDB.Models.ResourceRestoreParameters RestoreParameters { get { throw null; } set { } } public System.Collections.Generic.IList UniqueKeys { get { throw null; } } @@ -4899,6 +5762,7 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer private readonly int _dummyPrimitive; public CosmosDBStatus(string value) { throw null; } public static Azure.ResourceManager.CosmosDB.Models.CosmosDBStatus Canceled { get { throw null; } } + public static Azure.ResourceManager.CosmosDB.Models.CosmosDBStatus Creating { get { throw null; } } public static Azure.ResourceManager.CosmosDB.Models.CosmosDBStatus Deleting { get { throw null; } } public static Azure.ResourceManager.CosmosDB.Models.CosmosDBStatus Failed { get { throw null; } } public static Azure.ResourceManager.CosmosDB.Models.CosmosDBStatus Initializing { get { throw null; } } @@ -5600,6 +6464,121 @@ protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter write string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct FleetAnalyticsPropertiesStorageLocationType : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public FleetAnalyticsPropertiesStorageLocationType(string value) { throw null; } + public static Azure.ResourceManager.CosmosDB.Models.FleetAnalyticsPropertiesStorageLocationType FabricLakehouse { get { throw null; } } + public static Azure.ResourceManager.CosmosDB.Models.FleetAnalyticsPropertiesStorageLocationType StorageAccount { get { throw null; } } + public bool Equals(Azure.ResourceManager.CosmosDB.Models.FleetAnalyticsPropertiesStorageLocationType other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.CosmosDB.Models.FleetAnalyticsPropertiesStorageLocationType left, Azure.ResourceManager.CosmosDB.Models.FleetAnalyticsPropertiesStorageLocationType right) { throw null; } + public static implicit operator Azure.ResourceManager.CosmosDB.Models.FleetAnalyticsPropertiesStorageLocationType (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.CosmosDB.Models.FleetAnalyticsPropertiesStorageLocationType left, Azure.ResourceManager.CosmosDB.Models.FleetAnalyticsPropertiesStorageLocationType right) { throw null; } + public override string ToString() { throw null; } + } + public partial class FleetResourcePatch : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public FleetResourcePatch() { } + public Azure.ResourceManager.CosmosDB.Models.CosmosDBStatus? ProvisioningState { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.CosmosDB.Models.FleetResourcePatch 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.CosmosDB.Models.FleetResourcePatch System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct FleetspacePropertiesFleetspaceApiKind : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public FleetspacePropertiesFleetspaceApiKind(string value) { throw null; } + public static Azure.ResourceManager.CosmosDB.Models.FleetspacePropertiesFleetspaceApiKind NoSQL { get { throw null; } } + public bool Equals(Azure.ResourceManager.CosmosDB.Models.FleetspacePropertiesFleetspaceApiKind other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.CosmosDB.Models.FleetspacePropertiesFleetspaceApiKind left, Azure.ResourceManager.CosmosDB.Models.FleetspacePropertiesFleetspaceApiKind right) { throw null; } + public static implicit operator Azure.ResourceManager.CosmosDB.Models.FleetspacePropertiesFleetspaceApiKind (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.CosmosDB.Models.FleetspacePropertiesFleetspaceApiKind left, Azure.ResourceManager.CosmosDB.Models.FleetspacePropertiesFleetspaceApiKind right) { throw null; } + public override string ToString() { throw null; } + } + public partial class FleetspacePropertiesThroughputPoolConfiguration : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public FleetspacePropertiesThroughputPoolConfiguration() { } + public System.Collections.Generic.IList DataRegions { get { throw null; } } + public int? MaxThroughput { get { throw null; } set { } } + public int? MinThroughput { get { throw null; } set { } } + public Azure.ResourceManager.CosmosDB.Models.FleetspacePropertiesThroughputPoolConfigurationServiceTier? ServiceTier { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.CosmosDB.Models.FleetspacePropertiesThroughputPoolConfiguration 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.CosmosDB.Models.FleetspacePropertiesThroughputPoolConfiguration System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct FleetspacePropertiesThroughputPoolConfigurationServiceTier : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public FleetspacePropertiesThroughputPoolConfigurationServiceTier(string value) { throw null; } + public static Azure.ResourceManager.CosmosDB.Models.FleetspacePropertiesThroughputPoolConfigurationServiceTier BusinessCritical { get { throw null; } } + public static Azure.ResourceManager.CosmosDB.Models.FleetspacePropertiesThroughputPoolConfigurationServiceTier GeneralPurpose { get { throw null; } } + public bool Equals(Azure.ResourceManager.CosmosDB.Models.FleetspacePropertiesThroughputPoolConfigurationServiceTier other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.CosmosDB.Models.FleetspacePropertiesThroughputPoolConfigurationServiceTier left, Azure.ResourceManager.CosmosDB.Models.FleetspacePropertiesThroughputPoolConfigurationServiceTier right) { throw null; } + public static implicit operator Azure.ResourceManager.CosmosDB.Models.FleetspacePropertiesThroughputPoolConfigurationServiceTier (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.CosmosDB.Models.FleetspacePropertiesThroughputPoolConfigurationServiceTier left, Azure.ResourceManager.CosmosDB.Models.FleetspacePropertiesThroughputPoolConfigurationServiceTier right) { throw null; } + public override string ToString() { throw null; } + } + public partial class FleetspaceResourcePatch : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public FleetspaceResourcePatch() { } + public Azure.ResourceManager.CosmosDB.Models.FleetspacePropertiesFleetspaceApiKind? FleetspaceApiKind { get { throw null; } set { } } + public Azure.ResourceManager.CosmosDB.Models.CosmosDBStatus? ProvisioningState { get { throw null; } set { } } + public Azure.ResourceManager.CosmosDB.Models.FleetspacePropertiesThroughputPoolConfiguration ThroughputPoolConfiguration { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.CosmosDB.Models.FleetspaceResourcePatch 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.CosmosDB.Models.FleetspaceResourcePatch 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 FullTextPath : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public FullTextPath(string path) { } + public string Language { get { throw null; } set { } } + public string Path { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.CosmosDB.Models.FullTextPath 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.CosmosDB.Models.FullTextPath 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 FullTextPolicy : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public FullTextPolicy() { } + public string DefaultLanguage { get { throw null; } set { } } + public System.Collections.Generic.IList FullTextPaths { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.CosmosDB.Models.FullTextPolicy 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.CosmosDB.Models.FullTextPolicy 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 GraphApiComputeRegionalService : Azure.ResourceManager.CosmosDB.Models.CosmosDBRegionalService, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { internal GraphApiComputeRegionalService() { } @@ -5780,6 +6759,18 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } + public partial class MaterializedViewDetails : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public MaterializedViewDetails() { } + public string Id { get { throw null; } set { } } + public string Rid { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.CosmosDB.Models.MaterializedViewDetails 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.CosmosDB.Models.MaterializedViewDetails 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 MaterializedViewsBuilderRegionalService : Azure.ResourceManager.CosmosDB.Models.CosmosDBRegionalService, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { internal MaterializedViewsBuilderRegionalService() { } @@ -5994,6 +6985,68 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } + public partial class MongoRUToMongoRUCopyJobProperties : Azure.ResourceManager.CosmosDB.Models.BaseCopyJobProperties, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public MongoRUToMongoRUCopyJobProperties(System.Collections.Generic.IEnumerable tasks) { } + public string DestinationDetailsRemoteAccountName { get { throw null; } set { } } + public string SourceDetailsRemoteAccountName { get { throw null; } set { } } + public System.Collections.Generic.IList Tasks { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.CosmosDB.Models.MongoRUToMongoRUCopyJobProperties 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.CosmosDB.Models.MongoRUToMongoRUCopyJobProperties 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 MongoRUToMongoRUCopyJobTask : Azure.ResourceManager.CosmosDB.Models.BaseCopyJobTask, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public MongoRUToMongoRUCopyJobTask(Azure.ResourceManager.CosmosDB.Models.CosmosDBMongoCollection source, Azure.ResourceManager.CosmosDB.Models.CosmosDBMongoCollection destination) { } + public Azure.ResourceManager.CosmosDB.Models.CosmosDBMongoCollection Destination { get { throw null; } set { } } + public Azure.ResourceManager.CosmosDB.Models.CosmosDBMongoCollection Source { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.CosmosDB.Models.MongoRUToMongoRUCopyJobTask 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.CosmosDB.Models.MongoRUToMongoRUCopyJobTask 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 MongoRUToMongoVCoreCopyJobProperties : Azure.ResourceManager.CosmosDB.Models.BaseCopyJobProperties, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public MongoRUToMongoVCoreCopyJobProperties(Azure.ResourceManager.CosmosDB.Models.MongoVCoreSourceSinkDetails destinationDetails, System.Collections.Generic.IEnumerable tasks) { } + public Azure.ResourceManager.CosmosDB.Models.MongoVCoreSourceSinkDetails DestinationDetails { get { throw null; } set { } } + public string SourceDetailsRemoteAccountName { get { throw null; } set { } } + public System.Collections.Generic.IList Tasks { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.CosmosDB.Models.MongoRUToMongoVCoreCopyJobProperties 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.CosmosDB.Models.MongoRUToMongoVCoreCopyJobProperties 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 MongoRUToMongoVCoreCopyJobTask : Azure.ResourceManager.CosmosDB.Models.BaseCopyJobTask, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public MongoRUToMongoVCoreCopyJobTask(Azure.ResourceManager.CosmosDB.Models.CosmosDBMongoCollection source, Azure.ResourceManager.CosmosDB.Models.CosmosDBMongoVCoreCollection destination) { } + public Azure.ResourceManager.CosmosDB.Models.CosmosDBMongoVCoreCollection Destination { get { throw null; } set { } } + public Azure.ResourceManager.CosmosDB.Models.CosmosDBMongoCollection Source { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.CosmosDB.Models.MongoRUToMongoVCoreCopyJobTask 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.CosmosDB.Models.MongoRUToMongoVCoreCopyJobTask 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 MongoVCoreSourceSinkDetails : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public MongoVCoreSourceSinkDetails() { } + public System.Uri ConnectionStringKeyVaultUri { get { throw null; } set { } } + public string HostName { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.CosmosDB.Models.MongoVCoreSourceSinkDetails 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.CosmosDB.Models.MongoVCoreSourceSinkDetails 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 NetworkAclBypass { None = 0, @@ -6065,6 +7118,31 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } + public partial class NoSqlRUToNoSqlRUCopyJobProperties : Azure.ResourceManager.CosmosDB.Models.BaseCopyJobProperties, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public NoSqlRUToNoSqlRUCopyJobProperties(System.Collections.Generic.IEnumerable tasks) { } + public string DestinationDetailsRemoteAccountName { get { throw null; } set { } } + public string SourceDetailsRemoteAccountName { get { throw null; } set { } } + public System.Collections.Generic.IList Tasks { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.CosmosDB.Models.NoSqlRUToNoSqlRUCopyJobProperties 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.CosmosDB.Models.NoSqlRUToNoSqlRUCopyJobProperties 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 NoSqlRUToNoSqlRUCopyJobTask : Azure.ResourceManager.CosmosDB.Models.BaseCopyJobTask, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public NoSqlRUToNoSqlRUCopyJobTask(Azure.ResourceManager.CosmosDB.Models.CosmosDBNoSqlContainer source, Azure.ResourceManager.CosmosDB.Models.CosmosDBNoSqlContainer destination) { } + public Azure.ResourceManager.CosmosDB.Models.CosmosDBNoSqlContainer Destination { get { throw null; } set { } } + public Azure.ResourceManager.CosmosDB.Models.CosmosDBNoSqlContainer Source { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.CosmosDB.Models.NoSqlRUToNoSqlRUCopyJobTask 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.CosmosDB.Models.NoSqlRUToNoSqlRUCopyJobTask 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 PartitionMetric : Azure.ResourceManager.CosmosDB.Models.CosmosDBBaseMetric, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { internal PartitionMetric() { } @@ -6130,6 +7208,19 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } + public partial class Permission : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public Permission() { } + public System.Collections.Generic.IList DataActions { get { throw null; } } + public string Id { get { throw null; } set { } } + public System.Collections.Generic.IList NotDataActions { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.CosmosDB.Models.Permission 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.CosmosDB.Models.Permission 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 PhysicalPartitionStorageInfo : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { internal PhysicalPartitionStorageInfo() { } @@ -6157,6 +7248,7 @@ public partial class PhysicalPartitionThroughputInfoResource : System.ClientMode { public PhysicalPartitionThroughputInfoResource(string id) { } public string Id { get { throw null; } set { } } + public double? TargetThroughput { get { throw null; } set { } } public double? Throughput { get { throw null; } set { } } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.PhysicalPartitionThroughputInfoResource System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CassandraClusterCollection.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CassandraClusterCollection.cs index aca0bb177176..a318ed97456f 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CassandraClusterCollection.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CassandraClusterCollection.cs @@ -21,7 +21,7 @@ public partial class Sample_CassandraClusterCollection [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_CosmosDBManagedCassandraClusterCreate() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBManagedCassandraClusterCreate.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/CosmosDBManagedCassandraClusterCreate.json // this example is just showing the usage of "CassandraClusters_CreateUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -86,7 +86,7 @@ public async Task CreateOrUpdate_CosmosDBManagedCassandraClusterCreate() [Ignore("Only validating compilation of examples")] public async Task Get_CosmosDBManagedCassandraClusterGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBManagedCassandraClusterGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/CosmosDBManagedCassandraClusterGet.json // this example is just showing the usage of "CassandraClusters_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 @@ -119,7 +119,7 @@ public async Task Get_CosmosDBManagedCassandraClusterGet() [Ignore("Only validating compilation of examples")] public async Task GetAll_CosmosDBManagedCassandraClusterListByResourceGroup() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBManagedCassandraClusterListByResourceGroup.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/CosmosDBManagedCassandraClusterListByResourceGroup.json // this example is just showing the usage of "CassandraClusters_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 @@ -154,7 +154,7 @@ public async Task GetAll_CosmosDBManagedCassandraClusterListByResourceGroup() [Ignore("Only validating compilation of examples")] public async Task Exists_CosmosDBManagedCassandraClusterGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBManagedCassandraClusterGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/CosmosDBManagedCassandraClusterGet.json // this example is just showing the usage of "CassandraClusters_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -183,7 +183,7 @@ public async Task Exists_CosmosDBManagedCassandraClusterGet() [Ignore("Only validating compilation of examples")] public async Task GetIfExists_CosmosDBManagedCassandraClusterGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBManagedCassandraClusterGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/CosmosDBManagedCassandraClusterGet.json // this example is just showing the usage of "CassandraClusters_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CassandraClusterResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CassandraClusterResource.cs index 052c1990bd41..faf358164355 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CassandraClusterResource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CassandraClusterResource.cs @@ -20,7 +20,7 @@ public partial class Sample_CassandraClusterResource [Ignore("Only validating compilation of examples")] public async Task Get_CosmosDBManagedCassandraClusterGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBManagedCassandraClusterGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/CosmosDBManagedCassandraClusterGet.json // this example is just showing the usage of "CassandraClusters_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -50,7 +50,7 @@ public async Task Get_CosmosDBManagedCassandraClusterGet() [Ignore("Only validating compilation of examples")] public async Task Delete_CosmosDBManagedCassandraClusterDelete() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBManagedCassandraClusterDelete.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/CosmosDBManagedCassandraClusterDelete.json // this example is just showing the usage of "CassandraClusters_Delete" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -76,7 +76,7 @@ public async Task Delete_CosmosDBManagedCassandraClusterDelete() [Ignore("Only validating compilation of examples")] public async Task Update_CosmosDBManagedCassandraClusterPatch() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBManagedCassandraClusterPatch.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/CosmosDBManagedCassandraClusterPatch.json // this example is just showing the usage of "CassandraClusters_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 @@ -133,7 +133,7 @@ public async Task Update_CosmosDBManagedCassandraClusterPatch() [Ignore("Only validating compilation of examples")] public async Task InvokeCommand_CosmosDBManagedCassandraCommand() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBManagedCassandraCommand.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/CosmosDBManagedCassandraCommand.json // this example is just showing the usage of "CassandraClusters_InvokeCommand" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -167,7 +167,7 @@ public async Task InvokeCommand_CosmosDBManagedCassandraCommand() [Ignore("Only validating compilation of examples")] public async Task GetCommand_CosmosDBManagedCassandraListCommand() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBManagedCassandraListCommand.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/CosmosDBManagedCassandraListCommand.json // this example is just showing the usage of "CassandraClusters_ListCommand" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -196,7 +196,7 @@ public async Task GetCommand_CosmosDBManagedCassandraListCommand() [Ignore("Only validating compilation of examples")] public async Task GetCommandAsync_CosmosDBManagedCassandraCommandResult() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBManagedCassandraCommandResult.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/CosmosDBManagedCassandraCommandResult.json // this example is just showing the usage of "CassandraClusters_GetCommandAsync" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -223,7 +223,7 @@ public async Task GetCommandAsync_CosmosDBManagedCassandraCommandResult() [Ignore("Only validating compilation of examples")] public async Task GetBackups_CosmosDBManagedCassandraBackupsList() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBManagedCassandraBackupsList.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/CosmosDBManagedCassandraBackupsList.json // this example is just showing the usage of "CassandraClusters_ListBackups" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -252,7 +252,7 @@ public async Task GetBackups_CosmosDBManagedCassandraBackupsList() [Ignore("Only validating compilation of examples")] public async Task GetBackup_CosmosDBManagedCassandraBackup() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBManagedCassandraBackup.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/CosmosDBManagedCassandraBackup.json // this example is just showing the usage of "CassandraClusters_GetBackup" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -279,7 +279,7 @@ public async Task GetBackup_CosmosDBManagedCassandraBackup() [Ignore("Only validating compilation of examples")] public async Task Deallocate_CosmosDBManagedCassandraClusterDeallocate() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBManagedCassandraClusterDeallocate.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/CosmosDBManagedCassandraClusterDeallocate.json // this example is just showing the usage of "CassandraClusters_Deallocate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -305,7 +305,7 @@ public async Task Deallocate_CosmosDBManagedCassandraClusterDeallocate() [Ignore("Only validating compilation of examples")] public async Task Start_CosmosDBManagedCassandraClusterStart() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBManagedCassandraClusterStart.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/CosmosDBManagedCassandraClusterStart.json // this example is just showing the usage of "CassandraClusters_Start" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -331,7 +331,7 @@ public async Task Start_CosmosDBManagedCassandraClusterStart() [Ignore("Only validating compilation of examples")] public async Task Status_CosmosDBManagedCassandraStatus() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBManagedCassandraStatus.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/CosmosDBManagedCassandraStatus.json // this example is just showing the usage of "CassandraClusters_Status" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CassandraDataCenterCollection.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CassandraDataCenterCollection.cs index c9c78d1dd58b..146624f32be1 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CassandraDataCenterCollection.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CassandraDataCenterCollection.cs @@ -20,7 +20,7 @@ public partial class Sample_CassandraDataCenterCollection [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_CosmosDBManagedCassandraDataCenterCreate() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBManagedCassandraDataCenterCreate.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/CosmosDBManagedCassandraDataCenterCreate.json // this example is just showing the usage of "CassandraDataCenters_CreateUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -65,7 +65,7 @@ public async Task CreateOrUpdate_CosmosDBManagedCassandraDataCenterCreate() [Ignore("Only validating compilation of examples")] public async Task Get_CosmosDBManagedCassandraDataCenterGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBManagedCassandraDataCenterGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/CosmosDBManagedCassandraDataCenterGet.json // this example is just showing the usage of "CassandraDataCenters_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -99,7 +99,7 @@ public async Task Get_CosmosDBManagedCassandraDataCenterGet() [Ignore("Only validating compilation of examples")] public async Task GetAll_CosmosDBManagedCassandraDataCenterList() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBManagedCassandraDataCenterList.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/CosmosDBManagedCassandraDataCenterList.json // this example is just showing the usage of "CassandraDataCenters_List" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -135,7 +135,7 @@ public async Task GetAll_CosmosDBManagedCassandraDataCenterList() [Ignore("Only validating compilation of examples")] public async Task Exists_CosmosDBManagedCassandraDataCenterGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBManagedCassandraDataCenterGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/CosmosDBManagedCassandraDataCenterGet.json // this example is just showing the usage of "CassandraDataCenters_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -165,7 +165,7 @@ public async Task Exists_CosmosDBManagedCassandraDataCenterGet() [Ignore("Only validating compilation of examples")] public async Task GetIfExists_CosmosDBManagedCassandraDataCenterGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBManagedCassandraDataCenterGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/CosmosDBManagedCassandraDataCenterGet.json // this example is just showing the usage of "CassandraDataCenters_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CassandraDataCenterResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CassandraDataCenterResource.cs index e51603f5a666..ef16d459cab2 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CassandraDataCenterResource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CassandraDataCenterResource.cs @@ -20,7 +20,7 @@ public partial class Sample_CassandraDataCenterResource [Ignore("Only validating compilation of examples")] public async Task Get_CosmosDBManagedCassandraDataCenterGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBManagedCassandraDataCenterGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/CosmosDBManagedCassandraDataCenterGet.json // this example is just showing the usage of "CassandraDataCenters_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -51,7 +51,7 @@ public async Task Get_CosmosDBManagedCassandraDataCenterGet() [Ignore("Only validating compilation of examples")] public async Task Delete_CosmosDBManagedCassandraDataCenterDelete() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBManagedCassandraDataCenterDelete.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/CosmosDBManagedCassandraDataCenterDelete.json // this example is just showing the usage of "CassandraDataCenters_Delete" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -78,7 +78,7 @@ public async Task Delete_CosmosDBManagedCassandraDataCenterDelete() [Ignore("Only validating compilation of examples")] public async Task Update_CosmosDBManagedCassandraDataCenterUpdate() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBManagedCassandraDataCenterPatch.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/CosmosDBManagedCassandraDataCenterPatch.json // this example is just showing the usage of "CassandraDataCenters_Update" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CassandraKeyspaceCollection.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CassandraKeyspaceCollection.cs index 77cf29159cb5..d5bf2a867a41 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CassandraKeyspaceCollection.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CassandraKeyspaceCollection.cs @@ -20,7 +20,7 @@ public partial class Sample_CassandraKeyspaceCollection [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_CosmosDBCassandraKeyspaceCreateUpdate() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBCassandraKeyspaceCreateUpdate.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/CosmosDBCassandraKeyspaceCreateUpdate.json // this example is just showing the usage of "CassandraResources_CreateUpdateCassandraKeyspace" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -60,7 +60,7 @@ public async Task CreateOrUpdate_CosmosDBCassandraKeyspaceCreateUpdate() [Ignore("Only validating compilation of examples")] public async Task Get_CosmosDBCassandraKeyspaceGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBCassandraKeyspaceGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/CosmosDBCassandraKeyspaceGet.json // this example is just showing the usage of "CassandraResources_GetCassandraKeyspace" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -94,7 +94,7 @@ public async Task Get_CosmosDBCassandraKeyspaceGet() [Ignore("Only validating compilation of examples")] public async Task GetAll_CosmosDBCassandraKeyspaceList() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBCassandraKeyspaceList.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/CosmosDBCassandraKeyspaceList.json // this example is just showing the usage of "CassandraResources_ListCassandraKeyspaces" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -130,7 +130,7 @@ public async Task GetAll_CosmosDBCassandraKeyspaceList() [Ignore("Only validating compilation of examples")] public async Task Exists_CosmosDBCassandraKeyspaceGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBCassandraKeyspaceGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/CosmosDBCassandraKeyspaceGet.json // this example is just showing the usage of "CassandraResources_GetCassandraKeyspace" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -160,7 +160,7 @@ public async Task Exists_CosmosDBCassandraKeyspaceGet() [Ignore("Only validating compilation of examples")] public async Task GetIfExists_CosmosDBCassandraKeyspaceGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBCassandraKeyspaceGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/CosmosDBCassandraKeyspaceGet.json // this example is just showing the usage of "CassandraResources_GetCassandraKeyspace" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CassandraKeyspaceResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CassandraKeyspaceResource.cs index 8b8f5ea3f719..d7bd23d37f0a 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CassandraKeyspaceResource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CassandraKeyspaceResource.cs @@ -20,7 +20,7 @@ public partial class Sample_CassandraKeyspaceResource [Ignore("Only validating compilation of examples")] public async Task Get_CosmosDBCassandraKeyspaceGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBCassandraKeyspaceGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/CosmosDBCassandraKeyspaceGet.json // this example is just showing the usage of "CassandraResources_GetCassandraKeyspace" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -51,7 +51,7 @@ public async Task Get_CosmosDBCassandraKeyspaceGet() [Ignore("Only validating compilation of examples")] public async Task Delete_CosmosDBCassandraKeyspaceDelete() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBCassandraKeyspaceDelete.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/CosmosDBCassandraKeyspaceDelete.json // this example is just showing the usage of "CassandraResources_DeleteCassandraKeyspace" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -78,7 +78,7 @@ public async Task Delete_CosmosDBCassandraKeyspaceDelete() [Ignore("Only validating compilation of examples")] public async Task Update_CosmosDBCassandraKeyspaceCreateUpdate() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBCassandraKeyspaceCreateUpdate.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/CosmosDBCassandraKeyspaceCreateUpdate.json // this example is just showing the usage of "CassandraResources_CreateUpdateCassandraKeyspace" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CassandraKeyspaceThroughputSettingResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CassandraKeyspaceThroughputSettingResource.cs index 3192b1d45a54..55badecc5da3 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CassandraKeyspaceThroughputSettingResource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CassandraKeyspaceThroughputSettingResource.cs @@ -20,7 +20,7 @@ public partial class Sample_CassandraKeyspaceThroughputSettingResource [Ignore("Only validating compilation of examples")] public async Task Get_CosmosDBCassandraKeyspaceThroughputGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBCassandraKeyspaceThroughputGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/CosmosDBCassandraKeyspaceThroughputGet.json // this example is just showing the usage of "CassandraResources_GetCassandraKeyspaceThroughput" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -51,7 +51,7 @@ public async Task Get_CosmosDBCassandraKeyspaceThroughputGet() [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_CosmosDBCassandraKeyspaceThroughputUpdate() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBCassandraKeyspaceThroughputUpdate.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/CosmosDBCassandraKeyspaceThroughputUpdate.json // this example is just showing the usage of "CassandraResources_UpdateCassandraKeyspaceThroughput" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -90,7 +90,7 @@ public async Task CreateOrUpdate_CosmosDBCassandraKeyspaceThroughputUpdate() [Ignore("Only validating compilation of examples")] public async Task MigrateCassandraKeyspaceToAutoscale_CosmosDBCassandraKeyspaceMigrateToAutoscale() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBCassandraKeyspaceMigrateToAutoscale.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/CosmosDBCassandraKeyspaceMigrateToAutoscale.json // this example is just showing the usage of "CassandraResources_MigrateCassandraKeyspaceToAutoscale" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -122,7 +122,7 @@ public async Task MigrateCassandraKeyspaceToAutoscale_CosmosDBCassandraKeyspaceM [Ignore("Only validating compilation of examples")] public async Task MigrateCassandraKeyspaceToManualThroughput_CosmosDBCassandraKeyspaceMigrateToManualThroughput() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBCassandraKeyspaceMigrateToManualThroughput.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/CosmosDBCassandraKeyspaceMigrateToManualThroughput.json // this example is just showing the usage of "CassandraResources_MigrateCassandraKeyspaceToManualThroughput" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CassandraRoleAssignmentResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CassandraRoleAssignmentResource.cs new file mode 100644 index 000000000000..3149aa34a25f --- /dev/null +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CassandraRoleAssignmentResource.cs @@ -0,0 +1,114 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using NUnit.Framework; + +namespace Azure.ResourceManager.CosmosDB.Samples +{ + public partial class Sample_CassandraRoleAssignmentResource + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_CosmosDBCassandraRoleAssignmentGet() + { + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/cassandrarbac/CosmosDBCassandraRoleAssignmentGet.json + // this example is just showing the usage of "CassandraResources_GetCassandraRoleAssignment" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details 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 CassandraRoleAssignmentResource created on azure + // for more information of creating CassandraRoleAssignmentResource, please refer to the document of CassandraRoleAssignmentResource + string subscriptionId = "ffffffff-ffff-ffff-ffff-ffffffffffff"; + string resourceGroupName = "myResourceGroupName"; + string accountName = "myAccountName"; + string roleAssignmentId = "myRoleAssignmentId"; + ResourceIdentifier cassandraRoleAssignmentResourceId = CassandraRoleAssignmentResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName, roleAssignmentId); + CassandraRoleAssignmentResource cassandraRoleAssignmentResource = client.GetCassandraRoleAssignmentResource(cassandraRoleAssignmentResourceId); + + // invoke the operation + CassandraRoleAssignmentResource result = await cassandraRoleAssignmentResource.GetAsync(); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + CassandraRoleAssignmentResourceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Delete_CosmosDBCassandraRoleAssignmentDelete() + { + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/cassandrarbac/CosmosDBCassandraRoleAssignmentDelete.json + // this example is just showing the usage of "CassandraResources_DeleteCassandraRoleAssignment" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details 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 CassandraRoleAssignmentResource created on azure + // for more information of creating CassandraRoleAssignmentResource, please refer to the document of CassandraRoleAssignmentResource + string subscriptionId = "ffffffff-ffff-ffff-ffff-ffffffffffff"; + string resourceGroupName = "myResourceGroupName"; + string accountName = "myAccountName"; + string roleAssignmentId = "myRoleAssignmentId"; + ResourceIdentifier cassandraRoleAssignmentResourceId = CassandraRoleAssignmentResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName, roleAssignmentId); + CassandraRoleAssignmentResource cassandraRoleAssignmentResource = client.GetCassandraRoleAssignmentResource(cassandraRoleAssignmentResourceId); + + // invoke the operation + await cassandraRoleAssignmentResource.DeleteAsync(WaitUntil.Completed); + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Update_CosmosDBCassandraRoleAssignmentCreateUpdate() + { + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/cassandrarbac/CosmosDBCassandraRoleAssignmentCreateUpdate.json + // this example is just showing the usage of "CassandraResources_CreateUpdateCassandraRoleAssignment" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details 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 CassandraRoleAssignmentResource created on azure + // for more information of creating CassandraRoleAssignmentResource, please refer to the document of CassandraRoleAssignmentResource + string subscriptionId = "ffffffff-ffff-ffff-ffff-ffffffffffff"; + string resourceGroupName = "myResourceGroupName"; + string accountName = "myAccountName"; + string roleAssignmentId = "myRoleAssignmentId"; + ResourceIdentifier cassandraRoleAssignmentResourceId = CassandraRoleAssignmentResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName, roleAssignmentId); + CassandraRoleAssignmentResource cassandraRoleAssignmentResource = client.GetCassandraRoleAssignmentResource(cassandraRoleAssignmentResourceId); + + // invoke the operation + CassandraRoleAssignmentResourceData data = new CassandraRoleAssignmentResourceData + { + RoleDefinitionId = "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/myResourceGroupName/providers/Microsoft.DocumentDB/databaseAccounts/myAccountName/cassandraRoleDefinitions/myRoleDefinitionId", + Scope = "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/myResourceGroupName/providers/Microsoft.DocumentDB/databaseAccounts/myAccountName/dbs/purchases/colls/redmond-purchases", + PrincipalId = Guid.Parse("myPrincipalId"), + }; + ArmOperation lro = await cassandraRoleAssignmentResource.UpdateAsync(WaitUntil.Completed, data); + CassandraRoleAssignmentResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + CassandraRoleAssignmentResourceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } +} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CassandraRoleAssignmentResourceCollection.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CassandraRoleAssignmentResourceCollection.cs new file mode 100644 index 000000000000..595c9efeec02 --- /dev/null +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CassandraRoleAssignmentResourceCollection.cs @@ -0,0 +1,201 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using NUnit.Framework; + +namespace Azure.ResourceManager.CosmosDB.Samples +{ + public partial class Sample_CassandraRoleAssignmentResourceCollection + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task CreateOrUpdate_CosmosDBCassandraRoleAssignmentCreateUpdate() + { + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/cassandrarbac/CosmosDBCassandraRoleAssignmentCreateUpdate.json + // this example is just showing the usage of "CassandraResources_CreateUpdateCassandraRoleAssignment" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details 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 CosmosDBAccountResource created on azure + // for more information of creating CosmosDBAccountResource, please refer to the document of CosmosDBAccountResource + string subscriptionId = "ffffffff-ffff-ffff-ffff-ffffffffffff"; + string resourceGroupName = "myResourceGroupName"; + string accountName = "myAccountName"; + ResourceIdentifier cosmosDBAccountResourceId = CosmosDBAccountResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName); + CosmosDBAccountResource cosmosDBAccount = client.GetCosmosDBAccountResource(cosmosDBAccountResourceId); + + // get the collection of this CassandraRoleAssignmentResource + CassandraRoleAssignmentResourceCollection collection = cosmosDBAccount.GetCassandraRoleAssignmentResources(); + + // invoke the operation + string roleAssignmentId = "myRoleAssignmentId"; + CassandraRoleAssignmentResourceData data = new CassandraRoleAssignmentResourceData + { + RoleDefinitionId = "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/myResourceGroupName/providers/Microsoft.DocumentDB/databaseAccounts/myAccountName/cassandraRoleDefinitions/myRoleDefinitionId", + Scope = "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/myResourceGroupName/providers/Microsoft.DocumentDB/databaseAccounts/myAccountName/dbs/purchases/colls/redmond-purchases", + PrincipalId = Guid.Parse("myPrincipalId"), + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, roleAssignmentId, data); + CassandraRoleAssignmentResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + CassandraRoleAssignmentResourceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_CosmosDBCassandraRoleAssignmentGet() + { + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/cassandrarbac/CosmosDBCassandraRoleAssignmentGet.json + // this example is just showing the usage of "CassandraResources_GetCassandraRoleAssignment" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details 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 CosmosDBAccountResource created on azure + // for more information of creating CosmosDBAccountResource, please refer to the document of CosmosDBAccountResource + string subscriptionId = "ffffffff-ffff-ffff-ffff-ffffffffffff"; + string resourceGroupName = "myResourceGroupName"; + string accountName = "myAccountName"; + ResourceIdentifier cosmosDBAccountResourceId = CosmosDBAccountResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName); + CosmosDBAccountResource cosmosDBAccount = client.GetCosmosDBAccountResource(cosmosDBAccountResourceId); + + // get the collection of this CassandraRoleAssignmentResource + CassandraRoleAssignmentResourceCollection collection = cosmosDBAccount.GetCassandraRoleAssignmentResources(); + + // invoke the operation + string roleAssignmentId = "myRoleAssignmentId"; + CassandraRoleAssignmentResource result = await collection.GetAsync(roleAssignmentId); + + // 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 + CassandraRoleAssignmentResourceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetAll_CosmosDBCassandraRoleAssignmentList() + { + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/cassandrarbac/CosmosDBCassandraRoleAssignmentList.json + // this example is just showing the usage of "CassandraResources_ListCassandraRoleAssignments" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details 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 CosmosDBAccountResource created on azure + // for more information of creating CosmosDBAccountResource, please refer to the document of CosmosDBAccountResource + string subscriptionId = "ffffffff-ffff-ffff-ffff-ffffffffffff"; + string resourceGroupName = "myResourceGroupName"; + string accountName = "myAccountName"; + ResourceIdentifier cosmosDBAccountResourceId = CosmosDBAccountResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName); + CosmosDBAccountResource cosmosDBAccount = client.GetCosmosDBAccountResource(cosmosDBAccountResourceId); + + // get the collection of this CassandraRoleAssignmentResource + CassandraRoleAssignmentResourceCollection collection = cosmosDBAccount.GetCassandraRoleAssignmentResources(); + + // invoke the operation and iterate over the result + await foreach (CassandraRoleAssignmentResource item in collection.GetAllAsync()) + { + // the variable item is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + CassandraRoleAssignmentResourceData resourceData = item.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Exists_CosmosDBCassandraRoleAssignmentGet() + { + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/cassandrarbac/CosmosDBCassandraRoleAssignmentGet.json + // this example is just showing the usage of "CassandraResources_GetCassandraRoleAssignment" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details 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 CosmosDBAccountResource created on azure + // for more information of creating CosmosDBAccountResource, please refer to the document of CosmosDBAccountResource + string subscriptionId = "ffffffff-ffff-ffff-ffff-ffffffffffff"; + string resourceGroupName = "myResourceGroupName"; + string accountName = "myAccountName"; + ResourceIdentifier cosmosDBAccountResourceId = CosmosDBAccountResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName); + CosmosDBAccountResource cosmosDBAccount = client.GetCosmosDBAccountResource(cosmosDBAccountResourceId); + + // get the collection of this CassandraRoleAssignmentResource + CassandraRoleAssignmentResourceCollection collection = cosmosDBAccount.GetCassandraRoleAssignmentResources(); + + // invoke the operation + string roleAssignmentId = "myRoleAssignmentId"; + bool result = await collection.ExistsAsync(roleAssignmentId); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetIfExists_CosmosDBCassandraRoleAssignmentGet() + { + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/cassandrarbac/CosmosDBCassandraRoleAssignmentGet.json + // this example is just showing the usage of "CassandraResources_GetCassandraRoleAssignment" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details 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 CosmosDBAccountResource created on azure + // for more information of creating CosmosDBAccountResource, please refer to the document of CosmosDBAccountResource + string subscriptionId = "ffffffff-ffff-ffff-ffff-ffffffffffff"; + string resourceGroupName = "myResourceGroupName"; + string accountName = "myAccountName"; + ResourceIdentifier cosmosDBAccountResourceId = CosmosDBAccountResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName); + CosmosDBAccountResource cosmosDBAccount = client.GetCosmosDBAccountResource(cosmosDBAccountResourceId); + + // get the collection of this CassandraRoleAssignmentResource + CassandraRoleAssignmentResourceCollection collection = cosmosDBAccount.GetCassandraRoleAssignmentResources(); + + // invoke the operation + string roleAssignmentId = "myRoleAssignmentId"; + NullableResponse response = await collection.GetIfExistsAsync(roleAssignmentId); + CassandraRoleAssignmentResource result = response.HasValue ? response.Value : null; + + if (result == null) + { + Console.WriteLine("Succeeded with null as result"); + } + else + { + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + CassandraRoleAssignmentResourceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + } +} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CassandraRoleDefinitionResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CassandraRoleDefinitionResource.cs new file mode 100644 index 000000000000..698ca430dcb3 --- /dev/null +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CassandraRoleDefinitionResource.cs @@ -0,0 +1,120 @@ +// 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.CosmosDB.Models; +using NUnit.Framework; + +namespace Azure.ResourceManager.CosmosDB.Samples +{ + public partial class Sample_CassandraRoleDefinitionResource + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_CosmosDBCassandraRoleDefinitionGet() + { + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/cassandrarbac/CosmosDBCassandraRoleDefinitionGet.json + // this example is just showing the usage of "CassandraResources_GetCassandraRoleDefinition" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details 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 CassandraRoleDefinitionResource created on azure + // for more information of creating CassandraRoleDefinitionResource, please refer to the document of CassandraRoleDefinitionResource + string subscriptionId = "ffffffff-ffff-ffff-ffff-ffffffffffff"; + string resourceGroupName = "myResourceGroupName"; + string accountName = "myAccountName"; + string roleDefinitionId = "myRoleDefinitionId"; + ResourceIdentifier cassandraRoleDefinitionResourceId = CassandraRoleDefinitionResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName, roleDefinitionId); + CassandraRoleDefinitionResource cassandraRoleDefinitionResource = client.GetCassandraRoleDefinitionResource(cassandraRoleDefinitionResourceId); + + // invoke the operation + CassandraRoleDefinitionResource result = await cassandraRoleDefinitionResource.GetAsync(); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + CassandraRoleDefinitionResourceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Delete_CosmosDBCassandraRoleDefinitionDelete() + { + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/cassandrarbac/CosmosDBCassandraRoleDefinitionDelete.json + // this example is just showing the usage of "CassandraResources_DeleteCassandraRoleDefinition" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details 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 CassandraRoleDefinitionResource created on azure + // for more information of creating CassandraRoleDefinitionResource, please refer to the document of CassandraRoleDefinitionResource + string subscriptionId = "ffffffff-ffff-ffff-ffff-ffffffffffff"; + string resourceGroupName = "myResourceGroupName"; + string accountName = "myAccountName"; + string roleDefinitionId = "myRoleDefinitionId"; + ResourceIdentifier cassandraRoleDefinitionResourceId = CassandraRoleDefinitionResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName, roleDefinitionId); + CassandraRoleDefinitionResource cassandraRoleDefinitionResource = client.GetCassandraRoleDefinitionResource(cassandraRoleDefinitionResourceId); + + // invoke the operation + await cassandraRoleDefinitionResource.DeleteAsync(WaitUntil.Completed); + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Update_CosmosDBCassandraRoleDefinitionCreateUpdate() + { + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/cassandrarbac/CosmosDBCassandraRoleDefinitionCreateUpdate.json + // this example is just showing the usage of "CassandraResources_CreateUpdateCassandraRoleDefinition" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details 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 CassandraRoleDefinitionResource created on azure + // for more information of creating CassandraRoleDefinitionResource, please refer to the document of CassandraRoleDefinitionResource + string subscriptionId = "ffffffff-ffff-ffff-ffff-ffffffffffff"; + string resourceGroupName = "myResourceGroupName"; + string accountName = "myAccountName"; + string roleDefinitionId = "myRoleDefinitionId"; + ResourceIdentifier cassandraRoleDefinitionResourceId = CassandraRoleDefinitionResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName, roleDefinitionId); + CassandraRoleDefinitionResource cassandraRoleDefinitionResource = client.GetCassandraRoleDefinitionResource(cassandraRoleDefinitionResourceId); + + // invoke the operation + CassandraRoleDefinitionResourceData data = new CassandraRoleDefinitionResourceData + { + RoleName = "myRoleName", + TypePropertiesType = CosmosDBSqlRoleDefinitionType.CustomRole, + AssignableScopes = { "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/myResourceGroupName/providers/Microsoft.DocumentDB/databaseAccounts/myAccountName/dbs/sales", "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/myResourceGroupName/providers/Microsoft.DocumentDB/databaseAccounts/myAccountName/dbs/purchases" }, + Permissions = {new Permission +{ +DataActions = {"Microsoft.DocumentDB/databaseAccounts/cassandraDatabases/containers/entities/create", "Microsoft.DocumentDB/databaseAccounts/cassandraDatabases/containers/entities/read"}, +NotDataActions = {}, +}}, + }; + ArmOperation lro = await cassandraRoleDefinitionResource.UpdateAsync(WaitUntil.Completed, data); + CassandraRoleDefinitionResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + CassandraRoleDefinitionResourceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } +} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CassandraRoleDefinitionResourceCollection.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CassandraRoleDefinitionResourceCollection.cs new file mode 100644 index 000000000000..4f5695e992b0 --- /dev/null +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CassandraRoleDefinitionResourceCollection.cs @@ -0,0 +1,207 @@ +// 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.CosmosDB.Models; +using NUnit.Framework; + +namespace Azure.ResourceManager.CosmosDB.Samples +{ + public partial class Sample_CassandraRoleDefinitionResourceCollection + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task CreateOrUpdate_CosmosDBCassandraRoleDefinitionCreateUpdate() + { + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/cassandrarbac/CosmosDBCassandraRoleDefinitionCreateUpdate.json + // this example is just showing the usage of "CassandraResources_CreateUpdateCassandraRoleDefinition" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details 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 CosmosDBAccountResource created on azure + // for more information of creating CosmosDBAccountResource, please refer to the document of CosmosDBAccountResource + string subscriptionId = "ffffffff-ffff-ffff-ffff-ffffffffffff"; + string resourceGroupName = "myResourceGroupName"; + string accountName = "myAccountName"; + ResourceIdentifier cosmosDBAccountResourceId = CosmosDBAccountResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName); + CosmosDBAccountResource cosmosDBAccount = client.GetCosmosDBAccountResource(cosmosDBAccountResourceId); + + // get the collection of this CassandraRoleDefinitionResource + CassandraRoleDefinitionResourceCollection collection = cosmosDBAccount.GetCassandraRoleDefinitionResources(); + + // invoke the operation + string roleDefinitionId = "myRoleDefinitionId"; + CassandraRoleDefinitionResourceData data = new CassandraRoleDefinitionResourceData + { + RoleName = "myRoleName", + TypePropertiesType = CosmosDBSqlRoleDefinitionType.CustomRole, + AssignableScopes = { "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/myResourceGroupName/providers/Microsoft.DocumentDB/databaseAccounts/myAccountName/dbs/sales", "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/myResourceGroupName/providers/Microsoft.DocumentDB/databaseAccounts/myAccountName/dbs/purchases" }, + Permissions = {new Permission +{ +DataActions = {"Microsoft.DocumentDB/databaseAccounts/cassandraDatabases/containers/entities/create", "Microsoft.DocumentDB/databaseAccounts/cassandraDatabases/containers/entities/read"}, +NotDataActions = {}, +}}, + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, roleDefinitionId, data); + CassandraRoleDefinitionResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + CassandraRoleDefinitionResourceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_CosmosDBCassandraRoleDefinitionGet() + { + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/cassandrarbac/CosmosDBCassandraRoleDefinitionGet.json + // this example is just showing the usage of "CassandraResources_GetCassandraRoleDefinition" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details 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 CosmosDBAccountResource created on azure + // for more information of creating CosmosDBAccountResource, please refer to the document of CosmosDBAccountResource + string subscriptionId = "ffffffff-ffff-ffff-ffff-ffffffffffff"; + string resourceGroupName = "myResourceGroupName"; + string accountName = "myAccountName"; + ResourceIdentifier cosmosDBAccountResourceId = CosmosDBAccountResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName); + CosmosDBAccountResource cosmosDBAccount = client.GetCosmosDBAccountResource(cosmosDBAccountResourceId); + + // get the collection of this CassandraRoleDefinitionResource + CassandraRoleDefinitionResourceCollection collection = cosmosDBAccount.GetCassandraRoleDefinitionResources(); + + // invoke the operation + string roleDefinitionId = "myRoleDefinitionId"; + CassandraRoleDefinitionResource result = await collection.GetAsync(roleDefinitionId); + + // 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 + CassandraRoleDefinitionResourceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetAll_CosmosDBCassandraRoleDefinitionList() + { + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/cassandrarbac/CosmosDBCassandraRoleDefinitionList.json + // this example is just showing the usage of "CassandraResources_ListCassandraRoleDefinitions" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details 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 CosmosDBAccountResource created on azure + // for more information of creating CosmosDBAccountResource, please refer to the document of CosmosDBAccountResource + string subscriptionId = "ffffffff-ffff-ffff-ffff-ffffffffffff"; + string resourceGroupName = "myResourceGroupName"; + string accountName = "myAccountName"; + ResourceIdentifier cosmosDBAccountResourceId = CosmosDBAccountResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName); + CosmosDBAccountResource cosmosDBAccount = client.GetCosmosDBAccountResource(cosmosDBAccountResourceId); + + // get the collection of this CassandraRoleDefinitionResource + CassandraRoleDefinitionResourceCollection collection = cosmosDBAccount.GetCassandraRoleDefinitionResources(); + + // invoke the operation and iterate over the result + await foreach (CassandraRoleDefinitionResource item in collection.GetAllAsync()) + { + // the variable item is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + CassandraRoleDefinitionResourceData resourceData = item.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Exists_CosmosDBCassandraRoleDefinitionGet() + { + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/cassandrarbac/CosmosDBCassandraRoleDefinitionGet.json + // this example is just showing the usage of "CassandraResources_GetCassandraRoleDefinition" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details 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 CosmosDBAccountResource created on azure + // for more information of creating CosmosDBAccountResource, please refer to the document of CosmosDBAccountResource + string subscriptionId = "ffffffff-ffff-ffff-ffff-ffffffffffff"; + string resourceGroupName = "myResourceGroupName"; + string accountName = "myAccountName"; + ResourceIdentifier cosmosDBAccountResourceId = CosmosDBAccountResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName); + CosmosDBAccountResource cosmosDBAccount = client.GetCosmosDBAccountResource(cosmosDBAccountResourceId); + + // get the collection of this CassandraRoleDefinitionResource + CassandraRoleDefinitionResourceCollection collection = cosmosDBAccount.GetCassandraRoleDefinitionResources(); + + // invoke the operation + string roleDefinitionId = "myRoleDefinitionId"; + bool result = await collection.ExistsAsync(roleDefinitionId); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetIfExists_CosmosDBCassandraRoleDefinitionGet() + { + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/cassandrarbac/CosmosDBCassandraRoleDefinitionGet.json + // this example is just showing the usage of "CassandraResources_GetCassandraRoleDefinition" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details 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 CosmosDBAccountResource created on azure + // for more information of creating CosmosDBAccountResource, please refer to the document of CosmosDBAccountResource + string subscriptionId = "ffffffff-ffff-ffff-ffff-ffffffffffff"; + string resourceGroupName = "myResourceGroupName"; + string accountName = "myAccountName"; + ResourceIdentifier cosmosDBAccountResourceId = CosmosDBAccountResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName); + CosmosDBAccountResource cosmosDBAccount = client.GetCosmosDBAccountResource(cosmosDBAccountResourceId); + + // get the collection of this CassandraRoleDefinitionResource + CassandraRoleDefinitionResourceCollection collection = cosmosDBAccount.GetCassandraRoleDefinitionResources(); + + // invoke the operation + string roleDefinitionId = "myRoleDefinitionId"; + NullableResponse response = await collection.GetIfExistsAsync(roleDefinitionId); + CassandraRoleDefinitionResource result = response.HasValue ? response.Value : null; + + if (result == null) + { + Console.WriteLine("Succeeded with null as result"); + } + else + { + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + CassandraRoleDefinitionResourceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + } +} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CassandraTableCollection.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CassandraTableCollection.cs index 8c32afefefa5..da8c99b598e6 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CassandraTableCollection.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CassandraTableCollection.cs @@ -20,7 +20,7 @@ public partial class Sample_CassandraTableCollection [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_CosmosDBCassandraTableCreateUpdate() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBCassandraTableCreateUpdate.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/CosmosDBCassandraTableCreateUpdate.json // this example is just showing the usage of "CassandraResources_CreateUpdateCassandraTable" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -82,7 +82,7 @@ public async Task CreateOrUpdate_CosmosDBCassandraTableCreateUpdate() [Ignore("Only validating compilation of examples")] public async Task Get_CosmosDBCassandraTableGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBCassandraTableGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/CosmosDBCassandraTableGet.json // this example is just showing the usage of "CassandraResources_GetCassandraTable" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -117,7 +117,7 @@ public async Task Get_CosmosDBCassandraTableGet() [Ignore("Only validating compilation of examples")] public async Task GetAll_CosmosDBCassandraTableList() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBCassandraTableList.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/CosmosDBCassandraTableList.json // this example is just showing the usage of "CassandraResources_ListCassandraTables" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -154,7 +154,7 @@ public async Task GetAll_CosmosDBCassandraTableList() [Ignore("Only validating compilation of examples")] public async Task Exists_CosmosDBCassandraTableGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBCassandraTableGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/CosmosDBCassandraTableGet.json // this example is just showing the usage of "CassandraResources_GetCassandraTable" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -185,7 +185,7 @@ public async Task Exists_CosmosDBCassandraTableGet() [Ignore("Only validating compilation of examples")] public async Task GetIfExists_CosmosDBCassandraTableGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBCassandraTableGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/CosmosDBCassandraTableGet.json // this example is just showing the usage of "CassandraResources_GetCassandraTable" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CassandraTableResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CassandraTableResource.cs index 5f2cb3d9dddc..4af039cd7c24 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CassandraTableResource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CassandraTableResource.cs @@ -20,7 +20,7 @@ public partial class Sample_CassandraTableResource [Ignore("Only validating compilation of examples")] public async Task Get_CosmosDBCassandraTableGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBCassandraTableGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/CosmosDBCassandraTableGet.json // this example is just showing the usage of "CassandraResources_GetCassandraTable" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -52,7 +52,7 @@ public async Task Get_CosmosDBCassandraTableGet() [Ignore("Only validating compilation of examples")] public async Task Delete_CosmosDBCassandraTableDelete() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBCassandraTableDelete.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/CosmosDBCassandraTableDelete.json // this example is just showing the usage of "CassandraResources_DeleteCassandraTable" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -80,7 +80,7 @@ public async Task Delete_CosmosDBCassandraTableDelete() [Ignore("Only validating compilation of examples")] public async Task Update_CosmosDBCassandraTableCreateUpdate() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBCassandraTableCreateUpdate.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/CosmosDBCassandraTableCreateUpdate.json // this example is just showing the usage of "CassandraResources_CreateUpdateCassandraTable" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CassandraTableThroughputSettingResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CassandraTableThroughputSettingResource.cs index 6738bb6f8a53..b593ce968cd1 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CassandraTableThroughputSettingResource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CassandraTableThroughputSettingResource.cs @@ -20,7 +20,7 @@ public partial class Sample_CassandraTableThroughputSettingResource [Ignore("Only validating compilation of examples")] public async Task Get_CosmosDBCassandraTableThroughputGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBCassandraTableThroughputGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/CosmosDBCassandraTableThroughputGet.json // this example is just showing the usage of "CassandraResources_GetCassandraTableThroughput" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -52,7 +52,7 @@ public async Task Get_CosmosDBCassandraTableThroughputGet() [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_CosmosDBCassandraTableThroughputUpdate() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBCassandraTableThroughputUpdate.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/CosmosDBCassandraTableThroughputUpdate.json // this example is just showing the usage of "CassandraResources_UpdateCassandraTableThroughput" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -92,7 +92,7 @@ public async Task CreateOrUpdate_CosmosDBCassandraTableThroughputUpdate() [Ignore("Only validating compilation of examples")] public async Task MigrateCassandraTableToAutoscale_CosmosDBCassandraTableMigrateToAutoscale() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBCassandraTableMigrateToAutoscale.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/CosmosDBCassandraTableMigrateToAutoscale.json // this example is just showing the usage of "CassandraResources_MigrateCassandraTableToAutoscale" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -125,7 +125,7 @@ public async Task MigrateCassandraTableToAutoscale_CosmosDBCassandraTableMigrate [Ignore("Only validating compilation of examples")] public async Task MigrateCassandraTableToManualThroughput_CosmosDBCassandraTableMigrateToManualThroughput() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBCassandraTableMigrateToManualThroughput.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/CosmosDBCassandraTableMigrateToManualThroughput.json // this example is just showing the usage of "CassandraResources_MigrateCassandraTableToManualThroughput" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CassandraViewGetResultCollection.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CassandraViewGetResultCollection.cs index 51d008fe61ff..5d3c44b34f95 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CassandraViewGetResultCollection.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CassandraViewGetResultCollection.cs @@ -20,7 +20,7 @@ public partial class Sample_CassandraViewGetResultCollection [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_CosmosDBCassandraViewCreateUpdate() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBCassandraViewCreateUpdate.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/CosmosDBCassandraViewCreateUpdate.json // this example is just showing the usage of "CassandraResources_CreateUpdateCassandraView" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -61,7 +61,7 @@ public async Task CreateOrUpdate_CosmosDBCassandraViewCreateUpdate() [Ignore("Only validating compilation of examples")] public async Task Get_CosmosDBCassandraViewGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBCassandraViewGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/CosmosDBCassandraViewGet.json // this example is just showing the usage of "CassandraResources_GetCassandraView" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -96,7 +96,7 @@ public async Task Get_CosmosDBCassandraViewGet() [Ignore("Only validating compilation of examples")] public async Task GetAll_CosmosDBCassandraViewList() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBCassandraViewList.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/CosmosDBCassandraViewList.json // this example is just showing the usage of "CassandraResources_ListCassandraViews" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -133,7 +133,7 @@ public async Task GetAll_CosmosDBCassandraViewList() [Ignore("Only validating compilation of examples")] public async Task Exists_CosmosDBCassandraViewGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBCassandraViewGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/CosmosDBCassandraViewGet.json // this example is just showing the usage of "CassandraResources_GetCassandraView" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -164,7 +164,7 @@ public async Task Exists_CosmosDBCassandraViewGet() [Ignore("Only validating compilation of examples")] public async Task GetIfExists_CosmosDBCassandraViewGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBCassandraViewGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/CosmosDBCassandraViewGet.json // this example is just showing the usage of "CassandraResources_GetCassandraView" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CassandraViewGetResultResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CassandraViewGetResultResource.cs index 9d6f7e897df5..bcbe87f48282 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CassandraViewGetResultResource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CassandraViewGetResultResource.cs @@ -20,7 +20,7 @@ public partial class Sample_CassandraViewGetResultResource [Ignore("Only validating compilation of examples")] public async Task Get_CosmosDBCassandraViewGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBCassandraViewGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/CosmosDBCassandraViewGet.json // this example is just showing the usage of "CassandraResources_GetCassandraView" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -52,7 +52,7 @@ public async Task Get_CosmosDBCassandraViewGet() [Ignore("Only validating compilation of examples")] public async Task Delete_CosmosDBCassandraViewDelete() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBCassandraViewDelete.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/CosmosDBCassandraViewDelete.json // this example is just showing the usage of "CassandraResources_DeleteCassandraView" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -80,7 +80,7 @@ public async Task Delete_CosmosDBCassandraViewDelete() [Ignore("Only validating compilation of examples")] public async Task Update_CosmosDBCassandraViewCreateUpdate() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBCassandraViewCreateUpdate.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/CosmosDBCassandraViewCreateUpdate.json // this example is just showing the usage of "CassandraResources_CreateUpdateCassandraView" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CassandraViewThroughputSettingResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CassandraViewThroughputSettingResource.cs index 5ccf2216b9b6..2ee8720e00fd 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CassandraViewThroughputSettingResource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CassandraViewThroughputSettingResource.cs @@ -20,7 +20,7 @@ public partial class Sample_CassandraViewThroughputSettingResource [Ignore("Only validating compilation of examples")] public async Task Get_CosmosDBCassandraViewThroughputGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBCassandraViewThroughputGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/CosmosDBCassandraViewThroughputGet.json // this example is just showing the usage of "CassandraResources_GetCassandraViewThroughput" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -52,7 +52,7 @@ public async Task Get_CosmosDBCassandraViewThroughputGet() [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_CosmosDBCassandraViewThroughputUpdate() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBCassandraViewThroughputUpdate.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/CosmosDBCassandraViewThroughputUpdate.json // this example is just showing the usage of "CassandraResources_UpdateCassandraViewThroughput" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -92,7 +92,7 @@ public async Task CreateOrUpdate_CosmosDBCassandraViewThroughputUpdate() [Ignore("Only validating compilation of examples")] public async Task MigrateCassandraViewToAutoscale_CosmosDBCassandraViewMigrateToAutoscale() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBCassandraViewMigrateToAutoscale.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/CosmosDBCassandraViewMigrateToAutoscale.json // this example is just showing the usage of "CassandraResources_MigrateCassandraViewToAutoscale" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -125,7 +125,7 @@ public async Task MigrateCassandraViewToAutoscale_CosmosDBCassandraViewMigrateTo [Ignore("Only validating compilation of examples")] public async Task MigrateCassandraViewToManualThroughput_CosmosDBCassandraViewMigrateToManualThroughput() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBCassandraViewMigrateToManualThroughput.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/CosmosDBCassandraViewMigrateToManualThroughput.json // this example is just showing the usage of "CassandraResources_MigrateCassandraViewToManualThroughput" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CopyJobGetResultCollection.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CopyJobGetResultCollection.cs new file mode 100644 index 000000000000..6c3a7927c473 --- /dev/null +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CopyJobGetResultCollection.cs @@ -0,0 +1,204 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.CosmosDB.Models; +using NUnit.Framework; + +namespace Azure.ResourceManager.CosmosDB.Samples +{ + public partial class Sample_CopyJobGetResultCollection + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task CreateOrUpdate_CosmosDBCopyJobCreate() + { + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/copy-jobs/CosmosDBCopyJobCreate.json + // this example is just showing the usage of "CopyJobs_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(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this CosmosDBAccountResource created on azure + // for more information of creating CosmosDBAccountResource, please refer to the document of CosmosDBAccountResource + string subscriptionId = "subid"; + string resourceGroupName = "rg1"; + string accountName = "ddb1"; + ResourceIdentifier cosmosDBAccountResourceId = CosmosDBAccountResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName); + CosmosDBAccountResource cosmosDBAccount = client.GetCosmosDBAccountResource(cosmosDBAccountResourceId); + + // get the collection of this CopyJobGetResultResource + CopyJobGetResultCollection collection = cosmosDBAccount.GetCopyJobGetResults(); + + // invoke the operation + string jobName = "j1"; + CopyJobGetResultData data = new CopyJobGetResultData(new CopyJobProperties(new NoSqlRUToNoSqlRUCopyJobProperties(new NoSqlRUToNoSqlRUCopyJobTask[] + { +new NoSqlRUToNoSqlRUCopyJobTask(new CosmosDBNoSqlContainer("sourceDb1", "sourceTable1"), new CosmosDBNoSqlContainer("destDB1", "destTable1")), +new NoSqlRUToNoSqlRUCopyJobTask(new CosmosDBNoSqlContainer("sourceDb2", "sourceTable2"), new CosmosDBNoSqlContainer("destDB2", "destTable2")) + })) + { + Mode = CopyJobMode.Offline, + }); + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, jobName, data); + CopyJobGetResultResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + CopyJobGetResultData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_CosmosDBCopyJobGet() + { + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/copy-jobs/CosmosDBCopyJobGet.json + // this example is just showing the usage of "CopyJobs_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this CosmosDBAccountResource created on azure + // for more information of creating CosmosDBAccountResource, please refer to the document of CosmosDBAccountResource + string subscriptionId = "subid"; + string resourceGroupName = "rg1"; + string accountName = "ddb1"; + ResourceIdentifier cosmosDBAccountResourceId = CosmosDBAccountResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName); + CosmosDBAccountResource cosmosDBAccount = client.GetCosmosDBAccountResource(cosmosDBAccountResourceId); + + // get the collection of this CopyJobGetResultResource + CopyJobGetResultCollection collection = cosmosDBAccount.GetCopyJobGetResults(); + + // invoke the operation + string jobName = "j1"; + CopyJobGetResultResource result = await collection.GetAsync(jobName); + + // 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 + CopyJobGetResultData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetAll_CosmosDBCopyJobFeed() + { + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/copy-jobs/CosmosDBCopyJobFeed.json + // this example is just showing the usage of "CopyJobs_ListByDatabaseAccount" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details 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 CosmosDBAccountResource created on azure + // for more information of creating CosmosDBAccountResource, please refer to the document of CosmosDBAccountResource + string subscriptionId = "subid"; + string resourceGroupName = "rg1"; + string accountName = "ddb1"; + ResourceIdentifier cosmosDBAccountResourceId = CosmosDBAccountResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName); + CosmosDBAccountResource cosmosDBAccount = client.GetCosmosDBAccountResource(cosmosDBAccountResourceId); + + // get the collection of this CopyJobGetResultResource + CopyJobGetResultCollection collection = cosmosDBAccount.GetCopyJobGetResults(); + + // invoke the operation and iterate over the result + await foreach (CopyJobGetResultResource item in collection.GetAllAsync()) + { + // the variable item is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + CopyJobGetResultData resourceData = item.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Exists_CosmosDBCopyJobGet() + { + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/copy-jobs/CosmosDBCopyJobGet.json + // this example is just showing the usage of "CopyJobs_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this CosmosDBAccountResource created on azure + // for more information of creating CosmosDBAccountResource, please refer to the document of CosmosDBAccountResource + string subscriptionId = "subid"; + string resourceGroupName = "rg1"; + string accountName = "ddb1"; + ResourceIdentifier cosmosDBAccountResourceId = CosmosDBAccountResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName); + CosmosDBAccountResource cosmosDBAccount = client.GetCosmosDBAccountResource(cosmosDBAccountResourceId); + + // get the collection of this CopyJobGetResultResource + CopyJobGetResultCollection collection = cosmosDBAccount.GetCopyJobGetResults(); + + // invoke the operation + string jobName = "j1"; + bool result = await collection.ExistsAsync(jobName); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetIfExists_CosmosDBCopyJobGet() + { + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/copy-jobs/CosmosDBCopyJobGet.json + // this example is just showing the usage of "CopyJobs_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this CosmosDBAccountResource created on azure + // for more information of creating CosmosDBAccountResource, please refer to the document of CosmosDBAccountResource + string subscriptionId = "subid"; + string resourceGroupName = "rg1"; + string accountName = "ddb1"; + ResourceIdentifier cosmosDBAccountResourceId = CosmosDBAccountResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName); + CosmosDBAccountResource cosmosDBAccount = client.GetCosmosDBAccountResource(cosmosDBAccountResourceId); + + // get the collection of this CopyJobGetResultResource + CopyJobGetResultCollection collection = cosmosDBAccount.GetCopyJobGetResults(); + + // invoke the operation + string jobName = "j1"; + NullableResponse response = await collection.GetIfExistsAsync(jobName); + CopyJobGetResultResource result = response.HasValue ? response.Value : null; + + if (result == null) + { + Console.WriteLine("Succeeded with null as result"); + } + else + { + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + CopyJobGetResultData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + } +} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CopyJobGetResultResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CopyJobGetResultResource.cs new file mode 100644 index 000000000000..aaf4d91effc8 --- /dev/null +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CopyJobGetResultResource.cs @@ -0,0 +1,214 @@ +// 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.CosmosDB.Models; +using NUnit.Framework; + +namespace Azure.ResourceManager.CosmosDB.Samples +{ + public partial class Sample_CopyJobGetResultResource + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_CosmosDBCopyJobGet() + { + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/copy-jobs/CosmosDBCopyJobGet.json + // this example is just showing the usage of "CopyJobs_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this CopyJobGetResultResource created on azure + // for more information of creating CopyJobGetResultResource, please refer to the document of CopyJobGetResultResource + string subscriptionId = "subid"; + string resourceGroupName = "rg1"; + string accountName = "ddb1"; + string jobName = "j1"; + ResourceIdentifier copyJobGetResultResourceId = CopyJobGetResultResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName, jobName); + CopyJobGetResultResource copyJobGetResult = client.GetCopyJobGetResultResource(copyJobGetResultResourceId); + + // invoke the operation + CopyJobGetResultResource result = await copyJobGetResult.GetAsync(); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + CopyJobGetResultData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Update_CosmosDBCopyJobCreate() + { + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/copy-jobs/CosmosDBCopyJobCreate.json + // this example is just showing the usage of "CopyJobs_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(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this CopyJobGetResultResource created on azure + // for more information of creating CopyJobGetResultResource, please refer to the document of CopyJobGetResultResource + string subscriptionId = "subid"; + string resourceGroupName = "rg1"; + string accountName = "ddb1"; + string jobName = "j1"; + ResourceIdentifier copyJobGetResultResourceId = CopyJobGetResultResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName, jobName); + CopyJobGetResultResource copyJobGetResult = client.GetCopyJobGetResultResource(copyJobGetResultResourceId); + + // invoke the operation + CopyJobGetResultData data = new CopyJobGetResultData(new CopyJobProperties(new NoSqlRUToNoSqlRUCopyJobProperties(new NoSqlRUToNoSqlRUCopyJobTask[] + { +new NoSqlRUToNoSqlRUCopyJobTask(new CosmosDBNoSqlContainer("sourceDb1", "sourceTable1"), new CosmosDBNoSqlContainer("destDB1", "destTable1")), +new NoSqlRUToNoSqlRUCopyJobTask(new CosmosDBNoSqlContainer("sourceDb2", "sourceTable2"), new CosmosDBNoSqlContainer("destDB2", "destTable2")) + })) + { + Mode = CopyJobMode.Offline, + }); + ArmOperation lro = await copyJobGetResult.UpdateAsync(WaitUntil.Completed, data); + CopyJobGetResultResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + CopyJobGetResultData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Pause_CosmosDBCopyJobPause() + { + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/copy-jobs/CosmosDBCopyJobPause.json + // this example is just showing the usage of "CopyJobs_Pause" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details 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 CopyJobGetResultResource created on azure + // for more information of creating CopyJobGetResultResource, please refer to the document of CopyJobGetResultResource + string subscriptionId = "subid"; + string resourceGroupName = "rg1"; + string accountName = "ddb1"; + string jobName = "j1"; + ResourceIdentifier copyJobGetResultResourceId = CopyJobGetResultResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName, jobName); + CopyJobGetResultResource copyJobGetResult = client.GetCopyJobGetResultResource(copyJobGetResultResourceId); + + // invoke the operation + CopyJobGetResultResource result = await copyJobGetResult.PauseAsync(); + + // 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 + CopyJobGetResultData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Resume_CosmosDBCopyJobResume() + { + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/copy-jobs/CosmosDBCopyJobResume.json + // this example is just showing the usage of "CopyJobs_Resume" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this CopyJobGetResultResource created on azure + // for more information of creating CopyJobGetResultResource, please refer to the document of CopyJobGetResultResource + string subscriptionId = "subid"; + string resourceGroupName = "rg1"; + string accountName = "ddb1"; + string jobName = "j1"; + ResourceIdentifier copyJobGetResultResourceId = CopyJobGetResultResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName, jobName); + CopyJobGetResultResource copyJobGetResult = client.GetCopyJobGetResultResource(copyJobGetResultResourceId); + + // invoke the operation + CopyJobGetResultResource result = await copyJobGetResult.ResumeAsync(); + + // 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 + CopyJobGetResultData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Cancel_CosmosDBCopyJobCancel() + { + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/copy-jobs/CosmosDBCopyJobCancel.json + // this example is just showing the usage of "CopyJobs_Cancel" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details 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 CopyJobGetResultResource created on azure + // for more information of creating CopyJobGetResultResource, please refer to the document of CopyJobGetResultResource + string subscriptionId = "subid"; + string resourceGroupName = "rg1"; + string accountName = "ddb1"; + string jobName = "j1"; + ResourceIdentifier copyJobGetResultResourceId = CopyJobGetResultResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName, jobName); + CopyJobGetResultResource copyJobGetResult = client.GetCopyJobGetResultResource(copyJobGetResultResourceId); + + // invoke the operation + CopyJobGetResultResource result = await copyJobGetResult.CancelAsync(); + + // 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 + CopyJobGetResultData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Complete_CosmosDBCopyJobComplete() + { + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/copy-jobs/CosmosDBCopyJobComplete.json + // this example is just showing the usage of "CopyJobs_Complete" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details 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 CopyJobGetResultResource created on azure + // for more information of creating CopyJobGetResultResource, please refer to the document of CopyJobGetResultResource + string subscriptionId = "e35cc6eb-c8e3-447b-8de6-b83328cd0098"; + string resourceGroupName = "rg1"; + string accountName = "ddb1"; + string jobName = "j1"; + ResourceIdentifier copyJobGetResultResourceId = CopyJobGetResultResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName, jobName); + CopyJobGetResultResource copyJobGetResult = client.GetCopyJobGetResultResource(copyJobGetResultResourceId); + + // invoke the operation + CopyJobGetResultResource result = await copyJobGetResult.CompleteAsync(); + + // 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 + CopyJobGetResultData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } +} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBAccountCollection.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBAccountCollection.cs index e520b6b522ae..3f8d694cdcff 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBAccountCollection.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBAccountCollection.cs @@ -22,7 +22,7 @@ public partial class Sample_CosmosDBAccountCollection [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_CosmosDBDatabaseAccountCreateMax() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBDatabaseAccountCreateMax.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/CosmosDBDatabaseAccountCreateMax.json // this example is just showing the usage of "DatabaseAccounts_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -105,6 +105,7 @@ public async Task CreateOrUpdate_CosmosDBDatabaseAccountCreateMax() EnablePriorityBasedExecution = true, DefaultPriorityLevel = DefaultPriorityLevel.Low, EnablePerRegionPerPartitionAutoscale = true, + EnableAllVersionsAndDeletesChangeFeed = false, Identity = new ManagedServiceIdentity("SystemAssigned,UserAssigned") { UserAssignedIdentities = @@ -128,7 +129,7 @@ public async Task CreateOrUpdate_CosmosDBDatabaseAccountCreateMax() [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_CosmosDBDatabaseAccountCreateMin() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBDatabaseAccountCreateMin.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/CosmosDBDatabaseAccountCreateMin.json // this example is just showing the usage of "DatabaseAccounts_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -174,7 +175,7 @@ public async Task CreateOrUpdate_CosmosDBDatabaseAccountCreateMin() [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_CosmosDBRestoreDatabaseAccountCreateUpdateJson() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBRestoreDatabaseAccountCreateUpdate.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/CosmosDBRestoreDatabaseAccountCreateUpdate.json // this example is just showing the usage of "DatabaseAccounts_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -254,7 +255,7 @@ public async Task CreateOrUpdate_CosmosDBRestoreDatabaseAccountCreateUpdateJson( [Ignore("Only validating compilation of examples")] public async Task Get_CosmosDBDatabaseAccountGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBDatabaseAccountGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/CosmosDBDatabaseAccountGet.json // this example is just showing the usage of "DatabaseAccounts_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 @@ -287,7 +288,7 @@ public async Task Get_CosmosDBDatabaseAccountGet() [Ignore("Only validating compilation of examples")] public async Task GetAll_CosmosDBDatabaseAccountListByResourceGroup() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBDatabaseAccountListByResourceGroup.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/CosmosDBDatabaseAccountListByResourceGroup.json // this example is just showing the usage of "DatabaseAccounts_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 @@ -322,7 +323,7 @@ public async Task GetAll_CosmosDBDatabaseAccountListByResourceGroup() [Ignore("Only validating compilation of examples")] public async Task Exists_CosmosDBDatabaseAccountGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBDatabaseAccountGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/CosmosDBDatabaseAccountGet.json // this example is just showing the usage of "DatabaseAccounts_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 @@ -351,7 +352,7 @@ public async Task Exists_CosmosDBDatabaseAccountGet() [Ignore("Only validating compilation of examples")] public async Task GetIfExists_CosmosDBDatabaseAccountGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBDatabaseAccountGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/CosmosDBDatabaseAccountGet.json // this example is just showing the usage of "DatabaseAccounts_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBAccountResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBAccountResource.cs index 0243bcfe62af..436ee76c2067 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBAccountResource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBAccountResource.cs @@ -21,7 +21,7 @@ public partial class Sample_CosmosDBAccountResource [Ignore("Only validating compilation of examples")] public async Task Get_CosmosDBDatabaseAccountGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBDatabaseAccountGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/CosmosDBDatabaseAccountGet.json // this example is just showing the usage of "DatabaseAccounts_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -51,7 +51,7 @@ public async Task Get_CosmosDBDatabaseAccountGet() [Ignore("Only validating compilation of examples")] public async Task Delete_CosmosDBDatabaseAccountDelete() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBDatabaseAccountDelete.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/CosmosDBDatabaseAccountDelete.json // this example is just showing the usage of "DatabaseAccounts_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 @@ -77,7 +77,7 @@ public async Task Delete_CosmosDBDatabaseAccountDelete() [Ignore("Only validating compilation of examples")] public async Task Update_CosmosDBDatabaseAccountPatch() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBDatabaseAccountPatch.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/CosmosDBDatabaseAccountPatch.json // this example is just showing the usage of "DatabaseAccounts_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 @@ -165,7 +165,7 @@ public async Task Update_CosmosDBDatabaseAccountPatch() [Ignore("Only validating compilation of examples")] public async Task FailoverPriorityChange_CosmosDBDatabaseAccountFailoverPriorityChange() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBDatabaseAccountFailoverPriorityChange.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/CosmosDBDatabaseAccountFailoverPriorityChange.json // this example is just showing the usage of "DatabaseAccounts_FailoverPriorityChange" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -204,7 +204,7 @@ public async Task FailoverPriorityChange_CosmosDBDatabaseAccountFailoverPriority [Ignore("Only validating compilation of examples")] public async Task GetKeys_CosmosDBDatabaseAccountListKeys() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBDatabaseAccountListKeys.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/CosmosDBDatabaseAccountListKeys.json // this example is just showing the usage of "DatabaseAccounts_ListKeys" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -230,7 +230,7 @@ public async Task GetKeys_CosmosDBDatabaseAccountListKeys() [Ignore("Only validating compilation of examples")] public async Task GetConnectionStrings_CosmosDBDatabaseAccountListConnectionStrings() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBDatabaseAccountListConnectionStrings.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/CosmosDBDatabaseAccountListConnectionStrings.json // this example is just showing the usage of "DatabaseAccounts_ListConnectionStrings" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -259,7 +259,7 @@ public async Task GetConnectionStrings_CosmosDBDatabaseAccountListConnectionStri [Ignore("Only validating compilation of examples")] public async Task GetConnectionStrings_CosmosDBDatabaseAccountListConnectionStringsMongo() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBDatabaseAccountListConnectionStringsMongo.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/CosmosDBDatabaseAccountListConnectionStringsMongo.json // this example is just showing the usage of "DatabaseAccounts_ListConnectionStrings" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -288,7 +288,7 @@ public async Task GetConnectionStrings_CosmosDBDatabaseAccountListConnectionStri [Ignore("Only validating compilation of examples")] public async Task OfflineRegion_CosmosDBDatabaseAccountOfflineRegion() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBDatabaseAccountOfflineRegion.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/CosmosDBDatabaseAccountOfflineRegion.json // this example is just showing the usage of "DatabaseAccounts_OfflineRegion" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -315,7 +315,7 @@ public async Task OfflineRegion_CosmosDBDatabaseAccountOfflineRegion() [Ignore("Only validating compilation of examples")] public async Task OnlineRegion_CosmosDBDatabaseAccountOnlineRegion() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBDatabaseAccountOnlineRegion.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/CosmosDBDatabaseAccountOnlineRegion.json // this example is just showing the usage of "DatabaseAccounts_OnlineRegion" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -342,7 +342,7 @@ public async Task OnlineRegion_CosmosDBDatabaseAccountOnlineRegion() [Ignore("Only validating compilation of examples")] public async Task GetReadOnlyKeys_CosmosDBDatabaseAccountListReadOnlyKeys() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBDatabaseAccountListReadOnlyKeys.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/CosmosDBDatabaseAccountListReadOnlyKeys.json // this example is just showing the usage of "DatabaseAccounts_ListReadOnlyKeys" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -368,7 +368,7 @@ public async Task GetReadOnlyKeys_CosmosDBDatabaseAccountListReadOnlyKeys() [Ignore("Only validating compilation of examples")] public async Task RegenerateKey_CosmosDBDatabaseAccountRegenerateKey() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBDatabaseAccountRegenerateKey.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/CosmosDBDatabaseAccountRegenerateKey.json // this example is just showing the usage of "DatabaseAccounts_RegenerateKey" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -395,7 +395,7 @@ public async Task RegenerateKey_CosmosDBDatabaseAccountRegenerateKey() [Ignore("Only validating compilation of examples")] public async Task GetMetrics_CosmosDBDatabaseAccountGetMetrics() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBDatabaseAccountGetMetrics.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/CosmosDBDatabaseAccountGetMetrics.json // this example is just showing the usage of "DatabaseAccounts_ListMetrics" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -425,7 +425,7 @@ public async Task GetMetrics_CosmosDBDatabaseAccountGetMetrics() [Ignore("Only validating compilation of examples")] public async Task GetUsages_CosmosDBDatabaseAccountGetUsages() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBDatabaseAccountGetUsages.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/CosmosDBDatabaseAccountGetUsages.json // this example is just showing the usage of "DatabaseAccounts_ListUsages" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -455,7 +455,7 @@ public async Task GetUsages_CosmosDBDatabaseAccountGetUsages() [Ignore("Only validating compilation of examples")] public async Task GetMetricDefinitions_CosmosDBDatabaseAccountGetMetricDefinitions() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBDatabaseAccountGetMetricDefinitions.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/CosmosDBDatabaseAccountGetMetricDefinitions.json // this example is just showing the usage of "DatabaseAccounts_ListMetricDefinitions" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -484,7 +484,7 @@ public async Task GetMetricDefinitions_CosmosDBDatabaseAccountGetMetricDefinitio [Ignore("Only validating compilation of examples")] public async Task GetMetricsDatabases_CosmosDBDatabaseGetMetrics() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBDatabaseGetMetrics.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/CosmosDBDatabaseGetMetrics.json // this example is just showing the usage of "Database_ListMetrics" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -515,7 +515,7 @@ public async Task GetMetricsDatabases_CosmosDBDatabaseGetMetrics() [Ignore("Only validating compilation of examples")] public async Task GetUsagesDatabases_CosmosDBDatabaseGetUsages() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBDatabaseGetUsages.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/CosmosDBDatabaseGetUsages.json // this example is just showing the usage of "Database_ListUsages" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -546,7 +546,7 @@ public async Task GetUsagesDatabases_CosmosDBDatabaseGetUsages() [Ignore("Only validating compilation of examples")] public async Task GetMetricDefinitionsDatabases_CosmosDBDatabaseGetMetricDefinitions() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBDatabaseGetMetricDefinitions.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/CosmosDBDatabaseGetMetricDefinitions.json // this example is just showing the usage of "Database_ListMetricDefinitions" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -576,7 +576,7 @@ public async Task GetMetricDefinitionsDatabases_CosmosDBDatabaseGetMetricDefinit [Ignore("Only validating compilation of examples")] public async Task GetMetricsCollections_CosmosDBCollectionGetMetrics() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBCollectionGetMetrics.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/CosmosDBCollectionGetMetrics.json // this example is just showing the usage of "Collection_ListMetrics" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -608,7 +608,7 @@ public async Task GetMetricsCollections_CosmosDBCollectionGetMetrics() [Ignore("Only validating compilation of examples")] public async Task GetUsagesCollections_CosmosDBCollectionGetUsages() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBCollectionGetUsages.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/CosmosDBCollectionGetUsages.json // this example is just showing the usage of "Collection_ListUsages" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -640,7 +640,7 @@ public async Task GetUsagesCollections_CosmosDBCollectionGetUsages() [Ignore("Only validating compilation of examples")] public async Task GetMetricDefinitionsCollections_CosmosDBCollectionGetMetricDefinitions() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBCollectionGetMetricDefinitions.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/CosmosDBCollectionGetMetricDefinitions.json // this example is just showing the usage of "Collection_ListMetricDefinitions" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -671,7 +671,7 @@ public async Task GetMetricDefinitionsCollections_CosmosDBCollectionGetMetricDef [Ignore("Only validating compilation of examples")] public async Task GetMetricsCollectionRegions_CosmosDBRegionCollectionGetMetrics() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBRegionCollectionGetMetrics.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/CosmosDBRegionCollectionGetMetrics.json // this example is just showing the usage of "CollectionRegion_ListMetrics" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -704,7 +704,7 @@ public async Task GetMetricsCollectionRegions_CosmosDBRegionCollectionGetMetrics [Ignore("Only validating compilation of examples")] public async Task GetMetricsDatabaseAccountRegions_CosmosDBDatabaseAccountRegionGetMetrics() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBDatabaseAccountRegionGetMetrics.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/CosmosDBDatabaseAccountRegionGetMetrics.json // this example is just showing the usage of "DatabaseAccountRegion_ListMetrics" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -735,7 +735,7 @@ public async Task GetMetricsDatabaseAccountRegions_CosmosDBDatabaseAccountRegion [Ignore("Only validating compilation of examples")] public async Task GetMetricsPercentileSourceTargets_CosmosDBDatabaseAccountRegionGetMetrics() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBPercentileSourceTargetGetMetrics.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/CosmosDBPercentileSourceTargetGetMetrics.json // this example is just showing the usage of "PercentileSourceTarget_ListMetrics" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -767,7 +767,7 @@ public async Task GetMetricsPercentileSourceTargets_CosmosDBDatabaseAccountRegio [Ignore("Only validating compilation of examples")] public async Task GetMetricsPercentileTargets_CosmosDBDatabaseAccountRegionGetMetrics() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBPercentileTargetGetMetrics.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/CosmosDBPercentileTargetGetMetrics.json // this example is just showing the usage of "PercentileTarget_ListMetrics" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -798,7 +798,7 @@ public async Task GetMetricsPercentileTargets_CosmosDBDatabaseAccountRegionGetMe [Ignore("Only validating compilation of examples")] public async Task GetMetricsPercentiles_CosmosDBDatabaseAccountRegionGetMetrics() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBPercentileGetMetrics.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/CosmosDBPercentileGetMetrics.json // this example is just showing the usage of "Percentile_ListMetrics" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -828,7 +828,7 @@ public async Task GetMetricsPercentiles_CosmosDBDatabaseAccountRegionGetMetrics( [Ignore("Only validating compilation of examples")] public async Task GetMetricsCollectionPartitionRegions_CosmosDBDatabaseAccountRegionGetMetrics() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBCollectionPartitionRegionGetMetrics.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/CosmosDBCollectionPartitionRegionGetMetrics.json // this example is just showing the usage of "CollectionPartitionRegion_ListMetrics" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -861,7 +861,7 @@ public async Task GetMetricsCollectionPartitionRegions_CosmosDBDatabaseAccountRe [Ignore("Only validating compilation of examples")] public async Task GetMetricsCollectionPartitions_CosmosDBDatabaseAccountRegionGetMetrics() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBCollectionPartitionGetMetrics.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/CosmosDBCollectionPartitionGetMetrics.json // this example is just showing the usage of "CollectionPartition_ListMetrics" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -893,7 +893,7 @@ public async Task GetMetricsCollectionPartitions_CosmosDBDatabaseAccountRegionGe [Ignore("Only validating compilation of examples")] public async Task GetUsagesCollectionPartitions_CosmosDBCollectionGetUsages() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBCollectionPartitionGetUsages.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/CosmosDBCollectionPartitionGetUsages.json // this example is just showing the usage of "CollectionPartition_ListUsages" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -925,7 +925,7 @@ public async Task GetUsagesCollectionPartitions_CosmosDBCollectionGetUsages() [Ignore("Only validating compilation of examples")] public async Task GetMetricsPartitionKeyRangeIds_CosmosDBDatabaseAccountRegionGetMetrics() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBPKeyRangeIdGetMetrics.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/CosmosDBPKeyRangeIdGetMetrics.json // this example is just showing the usage of "PartitionKeyRangeId_ListMetrics" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -958,7 +958,7 @@ public async Task GetMetricsPartitionKeyRangeIds_CosmosDBDatabaseAccountRegionGe [Ignore("Only validating compilation of examples")] public async Task GetMetricsPartitionKeyRangeIdRegions_CosmosDBDatabaseAccountRegionGetMetrics() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBPKeyRangeIdRegionGetMetrics.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/CosmosDBPKeyRangeIdRegionGetMetrics.json // this example is just showing the usage of "PartitionKeyRangeIdRegion_ListMetrics" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBChaosFaultResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBChaosFaultResource.cs index b7dcbc52b859..370abf654530 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBChaosFaultResource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBChaosFaultResource.cs @@ -20,7 +20,7 @@ public partial class Sample_CosmosDBChaosFaultResource [Ignore("Only validating compilation of examples")] public async Task Get_ChaosFaultGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/ChaosFaultGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/ChaosFaultGet.json // this example is just showing the usage of "ChaosFault_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -51,7 +51,7 @@ public async Task Get_ChaosFaultGet() [Ignore("Only validating compilation of examples")] public async Task Update_ChaosFaultEnableDisable() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/ChaosFaultEnableDisable.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/ChaosFaultEnableDisable.json // this example is just showing the usage of "ChaosFault_EnableDisable" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBChaosFaultResourceCollection.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBChaosFaultResourceCollection.cs index 84b18cde02b6..a4a03b075228 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBChaosFaultResourceCollection.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBChaosFaultResourceCollection.cs @@ -20,7 +20,7 @@ public partial class Sample_CosmosDBChaosFaultResourceCollection [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_ChaosFaultEnableDisable() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/ChaosFaultEnableDisable.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/ChaosFaultEnableDisable.json // this example is just showing the usage of "ChaosFault_EnableDisable" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -62,7 +62,7 @@ public async Task CreateOrUpdate_ChaosFaultEnableDisable() [Ignore("Only validating compilation of examples")] public async Task Get_ChaosFaultGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/ChaosFaultGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/ChaosFaultGet.json // this example is just showing the usage of "ChaosFault_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 @@ -96,7 +96,7 @@ public async Task Get_ChaosFaultGet() [Ignore("Only validating compilation of examples")] public async Task GetAll_ChaosFaultList() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/ChaosFaultList.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/ChaosFaultList.json // this example is just showing the usage of "ChaosFault_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 @@ -132,7 +132,7 @@ public async Task GetAll_ChaosFaultList() [Ignore("Only validating compilation of examples")] public async Task Exists_ChaosFaultGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/ChaosFaultGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/ChaosFaultGet.json // this example is just showing the usage of "ChaosFault_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 @@ -162,7 +162,7 @@ public async Task Exists_ChaosFaultGet() [Ignore("Only validating compilation of examples")] public async Task GetIfExists_ChaosFaultGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/ChaosFaultGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/ChaosFaultGet.json // this example is just showing the usage of "ChaosFault_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBLocationCollection.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBLocationCollection.cs index c1fa6be93db4..93344e4e348d 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBLocationCollection.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBLocationCollection.cs @@ -20,7 +20,7 @@ public partial class Sample_CosmosDBLocationCollection [Ignore("Only validating compilation of examples")] public async Task Get_CosmosDBLocationGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBLocationGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/CosmosDBLocationGet.json // this example is just showing the usage of "Locations_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 @@ -52,7 +52,7 @@ public async Task Get_CosmosDBLocationGet() [Ignore("Only validating compilation of examples")] public async Task GetAll_CosmosDBLocationList() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBLocationList.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/CosmosDBLocationList.json // this example is just showing the usage of "Locations_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 @@ -86,7 +86,7 @@ public async Task GetAll_CosmosDBLocationList() [Ignore("Only validating compilation of examples")] public async Task Exists_CosmosDBLocationGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBLocationGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/CosmosDBLocationGet.json // this example is just showing the usage of "Locations_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 @@ -114,7 +114,7 @@ public async Task Exists_CosmosDBLocationGet() [Ignore("Only validating compilation of examples")] public async Task GetIfExists_CosmosDBLocationGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBLocationGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/CosmosDBLocationGet.json // this example is just showing the usage of "Locations_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBLocationResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBLocationResource.cs index 6b959294f24f..656cf2e6de50 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBLocationResource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBLocationResource.cs @@ -19,7 +19,7 @@ public partial class Sample_CosmosDBLocationResource [Ignore("Only validating compilation of examples")] public async Task Get_CosmosDBLocationGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBLocationGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/CosmosDBLocationGet.json // this example is just showing the usage of "Locations_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBPrivateEndpointConnectionCollection.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBPrivateEndpointConnectionCollection.cs index 7c35640e1e25..415e4b8e0b96 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBPrivateEndpointConnectionCollection.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBPrivateEndpointConnectionCollection.cs @@ -20,7 +20,7 @@ public partial class Sample_CosmosDBPrivateEndpointConnectionCollection [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_ApproveOrRejectAPrivateEndpointConnectionWithAGivenName() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBPrivateEndpointConnectionUpdate.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/CosmosDBPrivateEndpointConnectionUpdate.json // this example is just showing the usage of "PrivateEndpointConnections_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -63,7 +63,7 @@ public async Task CreateOrUpdate_ApproveOrRejectAPrivateEndpointConnectionWithAG [Ignore("Only validating compilation of examples")] public async Task Get_GetsPrivateEndpointConnection() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBPrivateEndpointConnectionGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/CosmosDBPrivateEndpointConnectionGet.json // this example is just showing the usage of "PrivateEndpointConnections_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -97,7 +97,7 @@ public async Task Get_GetsPrivateEndpointConnection() [Ignore("Only validating compilation of examples")] public async Task GetAll_GetsPrivateEndpointConnection() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBPrivateEndpointConnectionListGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/CosmosDBPrivateEndpointConnectionListGet.json // this example is just showing the usage of "PrivateEndpointConnections_ListByDatabaseAccount" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -133,7 +133,7 @@ public async Task GetAll_GetsPrivateEndpointConnection() [Ignore("Only validating compilation of examples")] public async Task Exists_GetsPrivateEndpointConnection() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBPrivateEndpointConnectionGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/CosmosDBPrivateEndpointConnectionGet.json // this example is just showing the usage of "PrivateEndpointConnections_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -163,7 +163,7 @@ public async Task Exists_GetsPrivateEndpointConnection() [Ignore("Only validating compilation of examples")] public async Task GetIfExists_GetsPrivateEndpointConnection() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBPrivateEndpointConnectionGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/CosmosDBPrivateEndpointConnectionGet.json // this example is just showing the usage of "PrivateEndpointConnections_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBPrivateEndpointConnectionResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBPrivateEndpointConnectionResource.cs index 936bb1260bd1..f6efc9c7d23a 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBPrivateEndpointConnectionResource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBPrivateEndpointConnectionResource.cs @@ -20,7 +20,7 @@ public partial class Sample_CosmosDBPrivateEndpointConnectionResource [Ignore("Only validating compilation of examples")] public async Task Get_GetsPrivateEndpointConnection() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBPrivateEndpointConnectionGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/CosmosDBPrivateEndpointConnectionGet.json // this example is just showing the usage of "PrivateEndpointConnections_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -51,7 +51,7 @@ public async Task Get_GetsPrivateEndpointConnection() [Ignore("Only validating compilation of examples")] public async Task Delete_DeletesAPrivateEndpointConnectionWithAGivenName() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBPrivateEndpointConnectionDelete.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/CosmosDBPrivateEndpointConnectionDelete.json // this example is just showing the usage of "PrivateEndpointConnections_Delete" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -78,7 +78,7 @@ public async Task Delete_DeletesAPrivateEndpointConnectionWithAGivenName() [Ignore("Only validating compilation of examples")] public async Task Update_ApproveOrRejectAPrivateEndpointConnectionWithAGivenName() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBPrivateEndpointConnectionUpdate.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/CosmosDBPrivateEndpointConnectionUpdate.json // this example is just showing the usage of "PrivateEndpointConnections_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBPrivateLinkResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBPrivateLinkResource.cs index 00d7ef8def32..2c26c2d60e24 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBPrivateLinkResource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBPrivateLinkResource.cs @@ -19,7 +19,7 @@ public partial class Sample_CosmosDBPrivateLinkResource [Ignore("Only validating compilation of examples")] public async Task Get_GetsPrivateEndpointConnection() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBPrivateLinkResourceGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/CosmosDBPrivateLinkResourceGet.json // this example is just showing the usage of "PrivateLinkResources_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBPrivateLinkResourceCollection.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBPrivateLinkResourceCollection.cs index 52032a900f3b..694c4522a4cb 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBPrivateLinkResourceCollection.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBPrivateLinkResourceCollection.cs @@ -19,7 +19,7 @@ public partial class Sample_CosmosDBPrivateLinkResourceCollection [Ignore("Only validating compilation of examples")] public async Task Get_GetsPrivateEndpointConnection() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBPrivateLinkResourceGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/CosmosDBPrivateLinkResourceGet.json // this example is just showing the usage of "PrivateLinkResources_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 @@ -53,7 +53,7 @@ public async Task Get_GetsPrivateEndpointConnection() [Ignore("Only validating compilation of examples")] public async Task GetAll_GetsPrivateEndpointConnection() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBPrivateLinkResourceListGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/CosmosDBPrivateLinkResourceListGet.json // this example is just showing the usage of "PrivateLinkResources_ListByDatabaseAccount" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -89,7 +89,7 @@ public async Task GetAll_GetsPrivateEndpointConnection() [Ignore("Only validating compilation of examples")] public async Task Exists_GetsPrivateEndpointConnection() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBPrivateLinkResourceGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/CosmosDBPrivateLinkResourceGet.json // this example is just showing the usage of "PrivateLinkResources_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 @@ -119,7 +119,7 @@ public async Task Exists_GetsPrivateEndpointConnection() [Ignore("Only validating compilation of examples")] public async Task GetIfExists_GetsPrivateEndpointConnection() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBPrivateLinkResourceGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/CosmosDBPrivateLinkResourceGet.json // this example is just showing the usage of "PrivateLinkResources_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBServiceCollection.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBServiceCollection.cs index e094e3ffb363..2dcbb72ba3ee 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBServiceCollection.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBServiceCollection.cs @@ -20,7 +20,7 @@ public partial class Sample_CosmosDBServiceCollection [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_DataTransferServiceCreate() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBDataTransferServiceCreate.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/CosmosDBDataTransferServiceCreate.json // this example is just showing the usage of "Service_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 @@ -63,7 +63,7 @@ public async Task CreateOrUpdate_DataTransferServiceCreate() [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_GraphAPIComputeServiceCreate() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBGraphAPIComputeServiceCreate.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/CosmosDBGraphAPIComputeServiceCreate.json // this example is just showing the usage of "Service_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 @@ -106,7 +106,7 @@ public async Task CreateOrUpdate_GraphAPIComputeServiceCreate() [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_MaterializedViewsBuilderServiceCreate() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBMaterializedViewsBuilderServiceCreate.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/CosmosDBMaterializedViewsBuilderServiceCreate.json // this example is just showing the usage of "Service_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 @@ -149,7 +149,7 @@ public async Task CreateOrUpdate_MaterializedViewsBuilderServiceCreate() [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_SqlDedicatedGatewayServiceCreate() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/services/sqldedicatedgateway/CosmosDBSqlDedicatedGatewayServiceCreate.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/services/sqldedicatedgateway/CosmosDBSqlDedicatedGatewayServiceCreate.json // this example is just showing the usage of "Service_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 @@ -193,7 +193,7 @@ public async Task CreateOrUpdate_SqlDedicatedGatewayServiceCreate() [Ignore("Only validating compilation of examples")] public async Task Get_DataTransferServiceGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBDataTransferServiceGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/CosmosDBDataTransferServiceGet.json // this example is just showing the usage of "Service_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 @@ -227,7 +227,7 @@ public async Task Get_DataTransferServiceGet() [Ignore("Only validating compilation of examples")] public async Task Get_GraphAPIComputeServiceGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBGraphAPIComputeServiceGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/CosmosDBGraphAPIComputeServiceGet.json // this example is just showing the usage of "Service_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 @@ -261,7 +261,7 @@ public async Task Get_GraphAPIComputeServiceGet() [Ignore("Only validating compilation of examples")] public async Task Get_MaterializedViewsBuilderServiceGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBMaterializedViewsBuilderServiceGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/CosmosDBMaterializedViewsBuilderServiceGet.json // this example is just showing the usage of "Service_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 @@ -295,7 +295,7 @@ public async Task Get_MaterializedViewsBuilderServiceGet() [Ignore("Only validating compilation of examples")] public async Task Get_SqlDedicatedGatewayServiceGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/services/sqldedicatedgateway/CosmosDBSqlDedicatedGatewayServiceGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/services/sqldedicatedgateway/CosmosDBSqlDedicatedGatewayServiceGet.json // this example is just showing the usage of "Service_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 @@ -329,7 +329,7 @@ public async Task Get_SqlDedicatedGatewayServiceGet() [Ignore("Only validating compilation of examples")] public async Task GetAll_CosmosDBServicesList() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBServicesList.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/CosmosDBServicesList.json // this example is just showing the usage of "Service_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 @@ -365,7 +365,7 @@ public async Task GetAll_CosmosDBServicesList() [Ignore("Only validating compilation of examples")] public async Task Exists_DataTransferServiceGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBDataTransferServiceGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/CosmosDBDataTransferServiceGet.json // this example is just showing the usage of "Service_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 @@ -395,7 +395,7 @@ public async Task Exists_DataTransferServiceGet() [Ignore("Only validating compilation of examples")] public async Task Exists_GraphAPIComputeServiceGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBGraphAPIComputeServiceGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/CosmosDBGraphAPIComputeServiceGet.json // this example is just showing the usage of "Service_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -425,7 +425,7 @@ public async Task Exists_GraphAPIComputeServiceGet() [Ignore("Only validating compilation of examples")] public async Task Exists_MaterializedViewsBuilderServiceGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBMaterializedViewsBuilderServiceGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/CosmosDBMaterializedViewsBuilderServiceGet.json // this example is just showing the usage of "Service_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 @@ -455,7 +455,7 @@ public async Task Exists_MaterializedViewsBuilderServiceGet() [Ignore("Only validating compilation of examples")] public async Task Exists_SqlDedicatedGatewayServiceGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/services/sqldedicatedgateway/CosmosDBSqlDedicatedGatewayServiceGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/services/sqldedicatedgateway/CosmosDBSqlDedicatedGatewayServiceGet.json // this example is just showing the usage of "Service_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 @@ -485,7 +485,7 @@ public async Task Exists_SqlDedicatedGatewayServiceGet() [Ignore("Only validating compilation of examples")] public async Task GetIfExists_DataTransferServiceGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBDataTransferServiceGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/CosmosDBDataTransferServiceGet.json // this example is just showing the usage of "Service_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 @@ -527,7 +527,7 @@ public async Task GetIfExists_DataTransferServiceGet() [Ignore("Only validating compilation of examples")] public async Task GetIfExists_GraphAPIComputeServiceGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBGraphAPIComputeServiceGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/CosmosDBGraphAPIComputeServiceGet.json // this example is just showing the usage of "Service_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 @@ -569,7 +569,7 @@ public async Task GetIfExists_GraphAPIComputeServiceGet() [Ignore("Only validating compilation of examples")] public async Task GetIfExists_MaterializedViewsBuilderServiceGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBMaterializedViewsBuilderServiceGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/CosmosDBMaterializedViewsBuilderServiceGet.json // this example is just showing the usage of "Service_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 @@ -611,7 +611,7 @@ public async Task GetIfExists_MaterializedViewsBuilderServiceGet() [Ignore("Only validating compilation of examples")] public async Task GetIfExists_SqlDedicatedGatewayServiceGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/services/sqldedicatedgateway/CosmosDBSqlDedicatedGatewayServiceGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/services/sqldedicatedgateway/CosmosDBSqlDedicatedGatewayServiceGet.json // this example is just showing the usage of "Service_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBServiceResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBServiceResource.cs index 453e3ce00f60..c7266dde0a8e 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBServiceResource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBServiceResource.cs @@ -20,7 +20,7 @@ public partial class Sample_CosmosDBServiceResource [Ignore("Only validating compilation of examples")] public async Task Get_DataTransferServiceGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBDataTransferServiceGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/CosmosDBDataTransferServiceGet.json // this example is just showing the usage of "Service_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -51,7 +51,7 @@ public async Task Get_DataTransferServiceGet() [Ignore("Only validating compilation of examples")] public async Task Get_GraphAPIComputeServiceGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBGraphAPIComputeServiceGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/CosmosDBGraphAPIComputeServiceGet.json // this example is just showing the usage of "Service_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -82,7 +82,7 @@ public async Task Get_GraphAPIComputeServiceGet() [Ignore("Only validating compilation of examples")] public async Task Get_MaterializedViewsBuilderServiceGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBMaterializedViewsBuilderServiceGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/CosmosDBMaterializedViewsBuilderServiceGet.json // this example is just showing the usage of "Service_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -113,7 +113,7 @@ public async Task Get_MaterializedViewsBuilderServiceGet() [Ignore("Only validating compilation of examples")] public async Task Get_SqlDedicatedGatewayServiceGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/services/sqldedicatedgateway/CosmosDBSqlDedicatedGatewayServiceGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/services/sqldedicatedgateway/CosmosDBSqlDedicatedGatewayServiceGet.json // this example is just showing the usage of "Service_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -144,7 +144,7 @@ public async Task Get_SqlDedicatedGatewayServiceGet() [Ignore("Only validating compilation of examples")] public async Task Delete_DataTransferServiceDelete() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBDataTransferServiceDelete.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/CosmosDBDataTransferServiceDelete.json // this example is just showing the usage of "Service_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 @@ -171,7 +171,7 @@ public async Task Delete_DataTransferServiceDelete() [Ignore("Only validating compilation of examples")] public async Task Delete_GraphAPIComputeServiceDelete() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBGraphAPIComputeServiceDelete.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/CosmosDBGraphAPIComputeServiceDelete.json // this example is just showing the usage of "Service_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 @@ -198,7 +198,7 @@ public async Task Delete_GraphAPIComputeServiceDelete() [Ignore("Only validating compilation of examples")] public async Task Delete_MaterializedViewsBuilderServiceDelete() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBMaterializedViewsBuilderServiceDelete.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/CosmosDBMaterializedViewsBuilderServiceDelete.json // this example is just showing the usage of "Service_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 @@ -225,7 +225,7 @@ public async Task Delete_MaterializedViewsBuilderServiceDelete() [Ignore("Only validating compilation of examples")] public async Task Delete_SqlDedicatedGatewayServiceDelete() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/services/sqldedicatedgateway/CosmosDBSqlDedicatedGatewayServiceDelete.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/services/sqldedicatedgateway/CosmosDBSqlDedicatedGatewayServiceDelete.json // this example is just showing the usage of "Service_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 @@ -252,7 +252,7 @@ public async Task Delete_SqlDedicatedGatewayServiceDelete() [Ignore("Only validating compilation of examples")] public async Task Update_DataTransferServiceCreate() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBDataTransferServiceCreate.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/CosmosDBDataTransferServiceCreate.json // this example is just showing the usage of "Service_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 @@ -292,7 +292,7 @@ public async Task Update_DataTransferServiceCreate() [Ignore("Only validating compilation of examples")] public async Task Update_GraphAPIComputeServiceCreate() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBGraphAPIComputeServiceCreate.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/CosmosDBGraphAPIComputeServiceCreate.json // this example is just showing the usage of "Service_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 @@ -332,7 +332,7 @@ public async Task Update_GraphAPIComputeServiceCreate() [Ignore("Only validating compilation of examples")] public async Task Update_MaterializedViewsBuilderServiceCreate() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBMaterializedViewsBuilderServiceCreate.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/CosmosDBMaterializedViewsBuilderServiceCreate.json // this example is just showing the usage of "Service_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 @@ -372,7 +372,7 @@ public async Task Update_MaterializedViewsBuilderServiceCreate() [Ignore("Only validating compilation of examples")] public async Task Update_SqlDedicatedGatewayServiceCreate() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/services/sqldedicatedgateway/CosmosDBSqlDedicatedGatewayServiceCreate.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/services/sqldedicatedgateway/CosmosDBSqlDedicatedGatewayServiceCreate.json // this example is just showing the usage of "Service_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 diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBSqlClientEncryptionKeyCollection.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBSqlClientEncryptionKeyCollection.cs index 4e6300b82f8e..fa34e8edf43b 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBSqlClientEncryptionKeyCollection.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBSqlClientEncryptionKeyCollection.cs @@ -21,7 +21,7 @@ public partial class Sample_CosmosDBSqlClientEncryptionKeyCollection [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_CosmosDBClientEncryptionKeyCreateUpdate() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlClientEncryptionKeyCreateUpdate.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/CosmosDBSqlClientEncryptionKeyCreateUpdate.json // this example is just showing the usage of "SqlResources_CreateUpdateClientEncryptionKey" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -70,7 +70,7 @@ public async Task CreateOrUpdate_CosmosDBClientEncryptionKeyCreateUpdate() [Ignore("Only validating compilation of examples")] public async Task Get_CosmosDBClientEncryptionKeyGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlClientEncryptionKeyGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/CosmosDBSqlClientEncryptionKeyGet.json // this example is just showing the usage of "SqlResources_GetClientEncryptionKey" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -105,7 +105,7 @@ public async Task Get_CosmosDBClientEncryptionKeyGet() [Ignore("Only validating compilation of examples")] public async Task GetAll_CosmosDBClientEncryptionKeysList() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlClientEncryptionKeysList.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/CosmosDBSqlClientEncryptionKeysList.json // this example is just showing the usage of "SqlResources_ListClientEncryptionKeys" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -142,7 +142,7 @@ public async Task GetAll_CosmosDBClientEncryptionKeysList() [Ignore("Only validating compilation of examples")] public async Task Exists_CosmosDBClientEncryptionKeyGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlClientEncryptionKeyGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/CosmosDBSqlClientEncryptionKeyGet.json // this example is just showing the usage of "SqlResources_GetClientEncryptionKey" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -173,7 +173,7 @@ public async Task Exists_CosmosDBClientEncryptionKeyGet() [Ignore("Only validating compilation of examples")] public async Task GetIfExists_CosmosDBClientEncryptionKeyGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlClientEncryptionKeyGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/CosmosDBSqlClientEncryptionKeyGet.json // this example is just showing the usage of "SqlResources_GetClientEncryptionKey" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBSqlClientEncryptionKeyResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBSqlClientEncryptionKeyResource.cs index cd7aa43c9f8f..c9be390c50c4 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBSqlClientEncryptionKeyResource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBSqlClientEncryptionKeyResource.cs @@ -21,7 +21,7 @@ public partial class Sample_CosmosDBSqlClientEncryptionKeyResource [Ignore("Only validating compilation of examples")] public async Task Get_CosmosDBClientEncryptionKeyGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlClientEncryptionKeyGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/CosmosDBSqlClientEncryptionKeyGet.json // this example is just showing the usage of "SqlResources_GetClientEncryptionKey" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -53,7 +53,7 @@ public async Task Get_CosmosDBClientEncryptionKeyGet() [Ignore("Only validating compilation of examples")] public async Task Update_CosmosDBClientEncryptionKeyCreateUpdate() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlClientEncryptionKeyCreateUpdate.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/CosmosDBSqlClientEncryptionKeyCreateUpdate.json // this example is just showing the usage of "SqlResources_CreateUpdateClientEncryptionKey" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBSqlContainerCollection.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBSqlContainerCollection.cs index e44bdb37d697..d57016022c62 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBSqlContainerCollection.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBSqlContainerCollection.cs @@ -20,7 +20,7 @@ public partial class Sample_CosmosDBSqlContainerCollection [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_CosmosDBSqlContainerCreateUpdate() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlContainerCreateUpdate.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/CosmosDBSqlContainerCreateUpdate.json // this example is just showing the usage of "SqlResources_CreateUpdateSqlContainer" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -91,6 +91,20 @@ public async Task CreateOrUpdate_CosmosDBSqlContainerCreateUpdate() Query = "SELECT VALUE LOWER(c.name) FROM c", }}, VectorEmbeddings = { new CosmosDBVectorEmbedding("/vectorPath1", CosmosDBVectorDataType.Float32, VectorDistanceFunction.Euclidean, 400), new CosmosDBVectorEmbedding("/vectorPath2", CosmosDBVectorDataType.Uint8, VectorDistanceFunction.Cosine, 512), new CosmosDBVectorEmbedding("/vectorPath3", CosmosDBVectorDataType.Int8, VectorDistanceFunction.Dotproduct, 512) }, + FullTextPolicy = new FullTextPolicy + { + DefaultLanguage = "1033", + FullTextPaths = {new FullTextPath("/ftPath1") +{ +Language = "en-US", +}, new FullTextPath("/ftPath2") +{ +Language = "fr-FR", +}, new FullTextPath("/ftPath3") +{ +Language = "de-DE", +}}, + }, }) { Options = new CosmosDBCreateUpdateConfig(), @@ -110,7 +124,7 @@ public async Task CreateOrUpdate_CosmosDBSqlContainerCreateUpdate() [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_CosmosDBSqlContainerRestore() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlContainerRestore.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/CosmosDBSqlContainerRestore.json // this example is just showing the usage of "SqlResources_CreateUpdateSqlContainer" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -160,7 +174,7 @@ public async Task CreateOrUpdate_CosmosDBSqlContainerRestore() [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_CosmosDBSqlMaterializedViewCreateUpdate() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlMaterializedViewCreateUpdate.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/CosmosDBSqlMaterializedViewCreateUpdate.json // this example is just showing the usage of "SqlResources_CreateUpdateSqlContainer" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -230,7 +244,7 @@ public async Task CreateOrUpdate_CosmosDBSqlMaterializedViewCreateUpdate() [Ignore("Only validating compilation of examples")] public async Task Get_CosmosDBSqlContainerGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlContainerGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/CosmosDBSqlContainerGet.json // this example is just showing the usage of "SqlResources_GetSqlContainer" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -265,7 +279,7 @@ public async Task Get_CosmosDBSqlContainerGet() [Ignore("Only validating compilation of examples")] public async Task GetAll_CosmosDBSqlContainerList() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlContainerList.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/CosmosDBSqlContainerList.json // this example is just showing the usage of "SqlResources_ListSqlContainers" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -302,7 +316,7 @@ public async Task GetAll_CosmosDBSqlContainerList() [Ignore("Only validating compilation of examples")] public async Task Exists_CosmosDBSqlContainerGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlContainerGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/CosmosDBSqlContainerGet.json // this example is just showing the usage of "SqlResources_GetSqlContainer" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -333,7 +347,7 @@ public async Task Exists_CosmosDBSqlContainerGet() [Ignore("Only validating compilation of examples")] public async Task GetIfExists_CosmosDBSqlContainerGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlContainerGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/CosmosDBSqlContainerGet.json // this example is just showing the usage of "SqlResources_GetSqlContainer" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBSqlContainerResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBSqlContainerResource.cs index 69d64a9836cd..0cd9e1e15eb9 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBSqlContainerResource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBSqlContainerResource.cs @@ -20,7 +20,7 @@ public partial class Sample_CosmosDBSqlContainerResource [Ignore("Only validating compilation of examples")] public async Task Get_CosmosDBSqlContainerGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlContainerGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/CosmosDBSqlContainerGet.json // this example is just showing the usage of "SqlResources_GetSqlContainer" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -52,7 +52,7 @@ public async Task Get_CosmosDBSqlContainerGet() [Ignore("Only validating compilation of examples")] public async Task Delete_CosmosDBSqlContainerDelete() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlContainerDelete.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/CosmosDBSqlContainerDelete.json // this example is just showing the usage of "SqlResources_DeleteSqlContainer" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -80,7 +80,7 @@ public async Task Delete_CosmosDBSqlContainerDelete() [Ignore("Only validating compilation of examples")] public async Task Update_CosmosDBSqlContainerCreateUpdate() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlContainerCreateUpdate.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/CosmosDBSqlContainerCreateUpdate.json // this example is just showing the usage of "SqlResources_CreateUpdateSqlContainer" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -148,6 +148,20 @@ public async Task Update_CosmosDBSqlContainerCreateUpdate() Query = "SELECT VALUE LOWER(c.name) FROM c", }}, VectorEmbeddings = { new CosmosDBVectorEmbedding("/vectorPath1", CosmosDBVectorDataType.Float32, VectorDistanceFunction.Euclidean, 400), new CosmosDBVectorEmbedding("/vectorPath2", CosmosDBVectorDataType.Uint8, VectorDistanceFunction.Cosine, 512), new CosmosDBVectorEmbedding("/vectorPath3", CosmosDBVectorDataType.Int8, VectorDistanceFunction.Dotproduct, 512) }, + FullTextPolicy = new FullTextPolicy + { + DefaultLanguage = "1033", + FullTextPaths = {new FullTextPath("/ftPath1") +{ +Language = "en-US", +}, new FullTextPath("/ftPath2") +{ +Language = "fr-FR", +}, new FullTextPath("/ftPath3") +{ +Language = "de-DE", +}}, + }, }) { Options = new CosmosDBCreateUpdateConfig(), @@ -167,7 +181,7 @@ public async Task Update_CosmosDBSqlContainerCreateUpdate() [Ignore("Only validating compilation of examples")] public async Task Update_CosmosDBSqlContainerRestore() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlContainerRestore.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/CosmosDBSqlContainerRestore.json // this example is just showing the usage of "SqlResources_CreateUpdateSqlContainer" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -214,7 +228,7 @@ public async Task Update_CosmosDBSqlContainerRestore() [Ignore("Only validating compilation of examples")] public async Task Update_CosmosDBSqlMaterializedViewCreateUpdate() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlMaterializedViewCreateUpdate.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/CosmosDBSqlMaterializedViewCreateUpdate.json // this example is just showing the usage of "SqlResources_CreateUpdateSqlContainer" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -281,7 +295,7 @@ public async Task Update_CosmosDBSqlMaterializedViewCreateUpdate() [Ignore("Only validating compilation of examples")] public async Task GetSqlContainerPartitionMerge_CosmosDBSqlContainerPartitionMerge() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlContainerPartitionMerge.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/CosmosDBSqlContainerPartitionMerge.json // this example is just showing the usage of "SqlResources_ListSqlContainerPartitionMerge" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -314,7 +328,7 @@ public async Task GetSqlContainerPartitionMerge_CosmosDBSqlContainerPartitionMer [Ignore("Only validating compilation of examples")] public async Task RetrieveContinuousBackupInformation_CosmosDBSqlContainerBackupInformation() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlContainerBackupInformation.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/CosmosDBSqlContainerBackupInformation.json // this example is just showing the usage of "SqlResources_RetrieveContinuousBackupInformation" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBSqlContainerThroughputSettingResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBSqlContainerThroughputSettingResource.cs index e1dd01f0ac5f..7970f911f72b 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBSqlContainerThroughputSettingResource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBSqlContainerThroughputSettingResource.cs @@ -21,7 +21,7 @@ public partial class Sample_CosmosDBSqlContainerThroughputSettingResource [Ignore("Only validating compilation of examples")] public async Task Get_CosmosDBSqlContainerThroughputGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlContainerThroughputGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/CosmosDBSqlContainerThroughputGet.json // this example is just showing the usage of "SqlResources_GetSqlContainerThroughput" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -53,7 +53,7 @@ public async Task Get_CosmosDBSqlContainerThroughputGet() [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_CosmosDBSqlContainerThroughputUpdate() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlContainerThroughputUpdate.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/CosmosDBSqlContainerThroughputUpdate.json // this example is just showing the usage of "SqlResources_UpdateSqlContainerThroughput" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -93,7 +93,7 @@ public async Task CreateOrUpdate_CosmosDBSqlContainerThroughputUpdate() [Ignore("Only validating compilation of examples")] public async Task MigrateSqlContainerToAutoscale_CosmosDBSqlContainerMigrateToAutoscale() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlContainerMigrateToAutoscale.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/CosmosDBSqlContainerMigrateToAutoscale.json // this example is just showing the usage of "SqlResources_MigrateSqlContainerToAutoscale" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -126,7 +126,7 @@ public async Task MigrateSqlContainerToAutoscale_CosmosDBSqlContainerMigrateToAu [Ignore("Only validating compilation of examples")] public async Task MigrateSqlContainerToManualThroughput_CosmosDBSqlContainerMigrateToManualThroughput() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlContainerMigrateToManualThroughput.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/CosmosDBSqlContainerMigrateToManualThroughput.json // this example is just showing the usage of "SqlResources_MigrateSqlContainerToManualThroughput" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -159,7 +159,7 @@ public async Task MigrateSqlContainerToManualThroughput_CosmosDBSqlContainerMigr [Ignore("Only validating compilation of examples")] public async Task SqlContainerRetrieveThroughputDistribution_CosmosDBSqlContainerRetrieveThroughputDistribution() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlContainerRetrieveThroughputDistribution.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/CosmosDBSqlContainerRetrieveThroughputDistribution.json // this example is just showing the usage of "SqlResources_SqlContainerRetrieveThroughputDistribution" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -199,7 +199,7 @@ public async Task SqlContainerRetrieveThroughputDistribution_CosmosDBSqlContaine [Ignore("Only validating compilation of examples")] public async Task SqlContainerRedistributeThroughput_CosmosDBSqlContainerRedistributeThroughput() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlContainerRedistributeThroughput.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/CosmosDBSqlContainerRedistributeThroughput.json // this example is just showing the usage of "SqlResources_SqlContainerRedistributeThroughput" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBSqlDatabaseCollection.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBSqlDatabaseCollection.cs index 80934d4c576c..3539f2f3774d 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBSqlDatabaseCollection.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBSqlDatabaseCollection.cs @@ -20,7 +20,7 @@ public partial class Sample_CosmosDBSqlDatabaseCollection [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_CosmosDBSqlDatabaseCreateUpdate() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlDatabaseCreateUpdate.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/CosmosDBSqlDatabaseCreateUpdate.json // this example is just showing the usage of "SqlResources_CreateUpdateSqlDatabase" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -60,7 +60,7 @@ public async Task CreateOrUpdate_CosmosDBSqlDatabaseCreateUpdate() [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_CosmosDBSqlDatabaseRestore() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlDatabaseRestore.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/CosmosDBSqlDatabaseRestore.json // this example is just showing the usage of "SqlResources_CreateUpdateSqlDatabase" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -109,7 +109,7 @@ public async Task CreateOrUpdate_CosmosDBSqlDatabaseRestore() [Ignore("Only validating compilation of examples")] public async Task Get_CosmosDBSqlDatabaseGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlDatabaseGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/CosmosDBSqlDatabaseGet.json // this example is just showing the usage of "SqlResources_GetSqlDatabase" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -143,7 +143,7 @@ public async Task Get_CosmosDBSqlDatabaseGet() [Ignore("Only validating compilation of examples")] public async Task GetAll_CosmosDBSqlDatabaseList() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlDatabaseList.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/CosmosDBSqlDatabaseList.json // this example is just showing the usage of "SqlResources_ListSqlDatabases" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -179,7 +179,7 @@ public async Task GetAll_CosmosDBSqlDatabaseList() [Ignore("Only validating compilation of examples")] public async Task Exists_CosmosDBSqlDatabaseGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlDatabaseGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/CosmosDBSqlDatabaseGet.json // this example is just showing the usage of "SqlResources_GetSqlDatabase" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -209,7 +209,7 @@ public async Task Exists_CosmosDBSqlDatabaseGet() [Ignore("Only validating compilation of examples")] public async Task GetIfExists_CosmosDBSqlDatabaseGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlDatabaseGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/CosmosDBSqlDatabaseGet.json // this example is just showing the usage of "SqlResources_GetSqlDatabase" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBSqlDatabaseResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBSqlDatabaseResource.cs index ec70262c1d94..dc8aff782324 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBSqlDatabaseResource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBSqlDatabaseResource.cs @@ -20,7 +20,7 @@ public partial class Sample_CosmosDBSqlDatabaseResource [Ignore("Only validating compilation of examples")] public async Task Get_CosmosDBSqlDatabaseGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlDatabaseGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/CosmosDBSqlDatabaseGet.json // this example is just showing the usage of "SqlResources_GetSqlDatabase" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -51,7 +51,7 @@ public async Task Get_CosmosDBSqlDatabaseGet() [Ignore("Only validating compilation of examples")] public async Task Delete_CosmosDBSqlDatabaseDelete() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlDatabaseDelete.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/CosmosDBSqlDatabaseDelete.json // this example is just showing the usage of "SqlResources_DeleteSqlDatabase" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -78,7 +78,7 @@ public async Task Delete_CosmosDBSqlDatabaseDelete() [Ignore("Only validating compilation of examples")] public async Task Update_CosmosDBSqlDatabaseCreateUpdate() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlDatabaseCreateUpdate.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/CosmosDBSqlDatabaseCreateUpdate.json // this example is just showing the usage of "SqlResources_CreateUpdateSqlDatabase" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -115,7 +115,7 @@ public async Task Update_CosmosDBSqlDatabaseCreateUpdate() [Ignore("Only validating compilation of examples")] public async Task Update_CosmosDBSqlDatabaseRestore() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlDatabaseRestore.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/CosmosDBSqlDatabaseRestore.json // this example is just showing the usage of "SqlResources_CreateUpdateSqlDatabase" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -161,7 +161,7 @@ public async Task Update_CosmosDBSqlDatabaseRestore() [Ignore("Only validating compilation of examples")] public async Task SqlDatabasePartitionMerge_CosmosDBSqlDatabasePartitionMerge() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlDatabasePartitionMerge.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/CosmosDBSqlDatabasePartitionMerge.json // this example is just showing the usage of "SqlResources_SqlDatabasePartitionMerge" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBSqlDatabaseThroughputSettingResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBSqlDatabaseThroughputSettingResource.cs index 4608c0b76459..b4fe7f4eea22 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBSqlDatabaseThroughputSettingResource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBSqlDatabaseThroughputSettingResource.cs @@ -21,7 +21,7 @@ public partial class Sample_CosmosDBSqlDatabaseThroughputSettingResource [Ignore("Only validating compilation of examples")] public async Task Get_CosmosDBSqlDatabaseThroughputGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlDatabaseThroughputGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/CosmosDBSqlDatabaseThroughputGet.json // this example is just showing the usage of "SqlResources_GetSqlDatabaseThroughput" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -52,7 +52,7 @@ public async Task Get_CosmosDBSqlDatabaseThroughputGet() [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_CosmosDBSqlDatabaseThroughputUpdate() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlDatabaseThroughputUpdate.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/CosmosDBSqlDatabaseThroughputUpdate.json // this example is just showing the usage of "SqlResources_UpdateSqlDatabaseThroughput" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -91,7 +91,7 @@ public async Task CreateOrUpdate_CosmosDBSqlDatabaseThroughputUpdate() [Ignore("Only validating compilation of examples")] public async Task MigrateSqlDatabaseToAutoscale_CosmosDBSqlDatabaseMigrateToAutoscale() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlDatabaseMigrateToAutoscale.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/CosmosDBSqlDatabaseMigrateToAutoscale.json // this example is just showing the usage of "SqlResources_MigrateSqlDatabaseToAutoscale" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -123,7 +123,7 @@ public async Task MigrateSqlDatabaseToAutoscale_CosmosDBSqlDatabaseMigrateToAuto [Ignore("Only validating compilation of examples")] public async Task MigrateSqlDatabaseToManualThroughput_CosmosDBSqlDatabaseMigrateToManualThroughput() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlDatabaseMigrateToManualThroughput.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/CosmosDBSqlDatabaseMigrateToManualThroughput.json // this example is just showing the usage of "SqlResources_MigrateSqlDatabaseToManualThroughput" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -155,7 +155,7 @@ public async Task MigrateSqlDatabaseToManualThroughput_CosmosDBSqlDatabaseMigrat [Ignore("Only validating compilation of examples")] public async Task SqlDatabaseRetrieveThroughputDistribution_CosmosDBSqlDatabaseRetrieveThroughputDistribution() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlDatabaseRetrieveThroughputDistribution.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/CosmosDBSqlDatabaseRetrieveThroughputDistribution.json // this example is just showing the usage of "SqlResources_SqlDatabaseRetrieveThroughputDistribution" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -194,7 +194,7 @@ public async Task SqlDatabaseRetrieveThroughputDistribution_CosmosDBSqlDatabaseR [Ignore("Only validating compilation of examples")] public async Task SqlDatabaseRedistributeThroughput_CosmosDBSqlDatabaseRedistributeThroughput() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlDatabaseRedistributeThroughput.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/CosmosDBSqlDatabaseRedistributeThroughput.json // this example is just showing the usage of "SqlResources_SqlDatabaseRedistributeThroughput" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBSqlRoleAssignmentCollection.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBSqlRoleAssignmentCollection.cs index c4066ec1d652..81f76222d2c2 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBSqlRoleAssignmentCollection.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBSqlRoleAssignmentCollection.cs @@ -20,7 +20,7 @@ public partial class Sample_CosmosDBSqlRoleAssignmentCollection [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_CosmosDBSqlRoleAssignmentCreateUpdate() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlRoleAssignmentCreateUpdate.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/CosmosDBSqlRoleAssignmentCreateUpdate.json // this example is just showing the usage of "SqlResources_CreateUpdateSqlRoleAssignment" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -61,7 +61,7 @@ public async Task CreateOrUpdate_CosmosDBSqlRoleAssignmentCreateUpdate() [Ignore("Only validating compilation of examples")] public async Task Get_CosmosDBSqlRoleAssignmentGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlRoleAssignmentGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/CosmosDBSqlRoleAssignmentGet.json // this example is just showing the usage of "SqlResources_GetSqlRoleAssignment" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -95,7 +95,7 @@ public async Task Get_CosmosDBSqlRoleAssignmentGet() [Ignore("Only validating compilation of examples")] public async Task GetAll_CosmosDBSqlRoleAssignmentList() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlRoleAssignmentList.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/CosmosDBSqlRoleAssignmentList.json // this example is just showing the usage of "SqlResources_ListSqlRoleAssignments" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -131,7 +131,7 @@ public async Task GetAll_CosmosDBSqlRoleAssignmentList() [Ignore("Only validating compilation of examples")] public async Task Exists_CosmosDBSqlRoleAssignmentGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlRoleAssignmentGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/CosmosDBSqlRoleAssignmentGet.json // this example is just showing the usage of "SqlResources_GetSqlRoleAssignment" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -161,7 +161,7 @@ public async Task Exists_CosmosDBSqlRoleAssignmentGet() [Ignore("Only validating compilation of examples")] public async Task GetIfExists_CosmosDBSqlRoleAssignmentGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlRoleAssignmentGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/CosmosDBSqlRoleAssignmentGet.json // this example is just showing the usage of "SqlResources_GetSqlRoleAssignment" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBSqlRoleAssignmentResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBSqlRoleAssignmentResource.cs index 34eb19794f2f..d430c391335d 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBSqlRoleAssignmentResource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBSqlRoleAssignmentResource.cs @@ -20,7 +20,7 @@ public partial class Sample_CosmosDBSqlRoleAssignmentResource [Ignore("Only validating compilation of examples")] public async Task Get_CosmosDBSqlRoleAssignmentGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlRoleAssignmentGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/CosmosDBSqlRoleAssignmentGet.json // this example is just showing the usage of "SqlResources_GetSqlRoleAssignment" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -51,7 +51,7 @@ public async Task Get_CosmosDBSqlRoleAssignmentGet() [Ignore("Only validating compilation of examples")] public async Task Delete_CosmosDBSqlRoleAssignmentDelete() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlRoleAssignmentDelete.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/CosmosDBSqlRoleAssignmentDelete.json // this example is just showing the usage of "SqlResources_DeleteSqlRoleAssignment" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -78,7 +78,7 @@ public async Task Delete_CosmosDBSqlRoleAssignmentDelete() [Ignore("Only validating compilation of examples")] public async Task Update_CosmosDBSqlRoleAssignmentCreateUpdate() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlRoleAssignmentCreateUpdate.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/CosmosDBSqlRoleAssignmentCreateUpdate.json // this example is just showing the usage of "SqlResources_CreateUpdateSqlRoleAssignment" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBSqlRoleDefinitionCollection.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBSqlRoleDefinitionCollection.cs index d6020dc363df..03204911c56e 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBSqlRoleDefinitionCollection.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBSqlRoleDefinitionCollection.cs @@ -20,7 +20,7 @@ public partial class Sample_CosmosDBSqlRoleDefinitionCollection [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_CosmosDBSqlRoleDefinitionCreateUpdate() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlRoleDefinitionCreateUpdate.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/CosmosDBSqlRoleDefinitionCreateUpdate.json // this example is just showing the usage of "SqlResources_CreateUpdateSqlRoleDefinition" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -66,7 +66,7 @@ public async Task CreateOrUpdate_CosmosDBSqlRoleDefinitionCreateUpdate() [Ignore("Only validating compilation of examples")] public async Task Get_CosmosDBSqlRoleDefinitionGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlRoleDefinitionGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/CosmosDBSqlRoleDefinitionGet.json // this example is just showing the usage of "SqlResources_GetSqlRoleDefinition" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -100,7 +100,7 @@ public async Task Get_CosmosDBSqlRoleDefinitionGet() [Ignore("Only validating compilation of examples")] public async Task GetAll_CosmosDBSqlRoleDefinitionList() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlRoleDefinitionList.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/CosmosDBSqlRoleDefinitionList.json // this example is just showing the usage of "SqlResources_ListSqlRoleDefinitions" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -136,7 +136,7 @@ public async Task GetAll_CosmosDBSqlRoleDefinitionList() [Ignore("Only validating compilation of examples")] public async Task Exists_CosmosDBSqlRoleDefinitionGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlRoleDefinitionGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/CosmosDBSqlRoleDefinitionGet.json // this example is just showing the usage of "SqlResources_GetSqlRoleDefinition" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -166,7 +166,7 @@ public async Task Exists_CosmosDBSqlRoleDefinitionGet() [Ignore("Only validating compilation of examples")] public async Task GetIfExists_CosmosDBSqlRoleDefinitionGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlRoleDefinitionGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/CosmosDBSqlRoleDefinitionGet.json // this example is just showing the usage of "SqlResources_GetSqlRoleDefinition" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBSqlRoleDefinitionResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBSqlRoleDefinitionResource.cs index 82c4452341c9..44254f32d4c1 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBSqlRoleDefinitionResource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBSqlRoleDefinitionResource.cs @@ -20,7 +20,7 @@ public partial class Sample_CosmosDBSqlRoleDefinitionResource [Ignore("Only validating compilation of examples")] public async Task Get_CosmosDBSqlRoleDefinitionGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlRoleDefinitionGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/CosmosDBSqlRoleDefinitionGet.json // this example is just showing the usage of "SqlResources_GetSqlRoleDefinition" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -51,7 +51,7 @@ public async Task Get_CosmosDBSqlRoleDefinitionGet() [Ignore("Only validating compilation of examples")] public async Task Delete_CosmosDBSqlRoleDefinitionDelete() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlRoleDefinitionDelete.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/CosmosDBSqlRoleDefinitionDelete.json // this example is just showing the usage of "SqlResources_DeleteSqlRoleDefinition" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -78,7 +78,7 @@ public async Task Delete_CosmosDBSqlRoleDefinitionDelete() [Ignore("Only validating compilation of examples")] public async Task Update_CosmosDBSqlRoleDefinitionCreateUpdate() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlRoleDefinitionCreateUpdate.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/CosmosDBSqlRoleDefinitionCreateUpdate.json // this example is just showing the usage of "SqlResources_CreateUpdateSqlRoleDefinition" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBSqlStoredProcedureCollection.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBSqlStoredProcedureCollection.cs index 33b9e41a4f86..c4c686533e5f 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBSqlStoredProcedureCollection.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBSqlStoredProcedureCollection.cs @@ -20,7 +20,7 @@ public partial class Sample_CosmosDBSqlStoredProcedureCollection [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_CosmosDBSqlStoredProcedureCreateUpdate() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlStoredProcedureCreateUpdate.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/CosmosDBSqlStoredProcedureCreateUpdate.json // this example is just showing the usage of "SqlResources_CreateUpdateSqlStoredProcedure" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -64,7 +64,7 @@ public async Task CreateOrUpdate_CosmosDBSqlStoredProcedureCreateUpdate() [Ignore("Only validating compilation of examples")] public async Task Get_CosmosDBSqlStoredProcedureGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlStoredProcedureGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/CosmosDBSqlStoredProcedureGet.json // this example is just showing the usage of "SqlResources_GetSqlStoredProcedure" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -100,7 +100,7 @@ public async Task Get_CosmosDBSqlStoredProcedureGet() [Ignore("Only validating compilation of examples")] public async Task GetAll_CosmosDBSqlStoredProcedureList() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlStoredProcedureList.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/CosmosDBSqlStoredProcedureList.json // this example is just showing the usage of "SqlResources_ListSqlStoredProcedures" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -138,7 +138,7 @@ public async Task GetAll_CosmosDBSqlStoredProcedureList() [Ignore("Only validating compilation of examples")] public async Task Exists_CosmosDBSqlStoredProcedureGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlStoredProcedureGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/CosmosDBSqlStoredProcedureGet.json // this example is just showing the usage of "SqlResources_GetSqlStoredProcedure" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -170,7 +170,7 @@ public async Task Exists_CosmosDBSqlStoredProcedureGet() [Ignore("Only validating compilation of examples")] public async Task GetIfExists_CosmosDBSqlStoredProcedureGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlStoredProcedureGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/CosmosDBSqlStoredProcedureGet.json // this example is just showing the usage of "SqlResources_GetSqlStoredProcedure" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBSqlStoredProcedureResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBSqlStoredProcedureResource.cs index d0e29fccc47c..6a8b59c433d8 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBSqlStoredProcedureResource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBSqlStoredProcedureResource.cs @@ -20,7 +20,7 @@ public partial class Sample_CosmosDBSqlStoredProcedureResource [Ignore("Only validating compilation of examples")] public async Task Get_CosmosDBSqlStoredProcedureGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlStoredProcedureGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/CosmosDBSqlStoredProcedureGet.json // this example is just showing the usage of "SqlResources_GetSqlStoredProcedure" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -53,7 +53,7 @@ public async Task Get_CosmosDBSqlStoredProcedureGet() [Ignore("Only validating compilation of examples")] public async Task Delete_CosmosDBSqlStoredProcedureDelete() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlStoredProcedureDelete.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/CosmosDBSqlStoredProcedureDelete.json // this example is just showing the usage of "SqlResources_DeleteSqlStoredProcedure" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -82,7 +82,7 @@ public async Task Delete_CosmosDBSqlStoredProcedureDelete() [Ignore("Only validating compilation of examples")] public async Task Update_CosmosDBSqlStoredProcedureCreateUpdate() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlStoredProcedureCreateUpdate.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/CosmosDBSqlStoredProcedureCreateUpdate.json // this example is just showing the usage of "SqlResources_CreateUpdateSqlStoredProcedure" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBSqlTriggerCollection.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBSqlTriggerCollection.cs index 2b44404c1efc..d48192fce70e 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBSqlTriggerCollection.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBSqlTriggerCollection.cs @@ -20,7 +20,7 @@ public partial class Sample_CosmosDBSqlTriggerCollection [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_CosmosDBSqlTriggerCreateUpdate() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlTriggerCreateUpdate.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/CosmosDBSqlTriggerCreateUpdate.json // this example is just showing the usage of "SqlResources_CreateUpdateSqlTrigger" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -66,7 +66,7 @@ public async Task CreateOrUpdate_CosmosDBSqlTriggerCreateUpdate() [Ignore("Only validating compilation of examples")] public async Task Get_CosmosDBSqlTriggerGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlTriggerGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/CosmosDBSqlTriggerGet.json // this example is just showing the usage of "SqlResources_GetSqlTrigger" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -102,7 +102,7 @@ public async Task Get_CosmosDBSqlTriggerGet() [Ignore("Only validating compilation of examples")] public async Task GetAll_CosmosDBSqlTriggerList() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlTriggerList.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/CosmosDBSqlTriggerList.json // this example is just showing the usage of "SqlResources_ListSqlTriggers" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -140,7 +140,7 @@ public async Task GetAll_CosmosDBSqlTriggerList() [Ignore("Only validating compilation of examples")] public async Task Exists_CosmosDBSqlTriggerGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlTriggerGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/CosmosDBSqlTriggerGet.json // this example is just showing the usage of "SqlResources_GetSqlTrigger" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -172,7 +172,7 @@ public async Task Exists_CosmosDBSqlTriggerGet() [Ignore("Only validating compilation of examples")] public async Task GetIfExists_CosmosDBSqlTriggerGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlTriggerGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/CosmosDBSqlTriggerGet.json // this example is just showing the usage of "SqlResources_GetSqlTrigger" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBSqlTriggerResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBSqlTriggerResource.cs index 2b58fee85029..bcc8836085df 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBSqlTriggerResource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBSqlTriggerResource.cs @@ -20,7 +20,7 @@ public partial class Sample_CosmosDBSqlTriggerResource [Ignore("Only validating compilation of examples")] public async Task Get_CosmosDBSqlTriggerGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlTriggerGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/CosmosDBSqlTriggerGet.json // this example is just showing the usage of "SqlResources_GetSqlTrigger" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -53,7 +53,7 @@ public async Task Get_CosmosDBSqlTriggerGet() [Ignore("Only validating compilation of examples")] public async Task Delete_CosmosDBSqlTriggerDelete() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlTriggerDelete.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/CosmosDBSqlTriggerDelete.json // this example is just showing the usage of "SqlResources_DeleteSqlTrigger" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -82,7 +82,7 @@ public async Task Delete_CosmosDBSqlTriggerDelete() [Ignore("Only validating compilation of examples")] public async Task Update_CosmosDBSqlTriggerCreateUpdate() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlTriggerCreateUpdate.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/CosmosDBSqlTriggerCreateUpdate.json // this example is just showing the usage of "SqlResources_CreateUpdateSqlTrigger" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBSqlUserDefinedFunctionCollection.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBSqlUserDefinedFunctionCollection.cs index 604ca11d42a6..dab1243ca614 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBSqlUserDefinedFunctionCollection.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBSqlUserDefinedFunctionCollection.cs @@ -20,7 +20,7 @@ public partial class Sample_CosmosDBSqlUserDefinedFunctionCollection [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_CosmosDBSqlUserDefinedFunctionCreateUpdate() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlUserDefinedFunctionCreateUpdate.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/CosmosDBSqlUserDefinedFunctionCreateUpdate.json // this example is just showing the usage of "SqlResources_CreateUpdateSqlUserDefinedFunction" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -64,7 +64,7 @@ public async Task CreateOrUpdate_CosmosDBSqlUserDefinedFunctionCreateUpdate() [Ignore("Only validating compilation of examples")] public async Task Get_CosmosDBSqlUserDefinedFunctionGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlUserDefinedFunctionGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/CosmosDBSqlUserDefinedFunctionGet.json // this example is just showing the usage of "SqlResources_GetSqlUserDefinedFunction" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -100,7 +100,7 @@ public async Task Get_CosmosDBSqlUserDefinedFunctionGet() [Ignore("Only validating compilation of examples")] public async Task GetAll_CosmosDBSqlUserDefinedFunctionList() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlUserDefinedFunctionList.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/CosmosDBSqlUserDefinedFunctionList.json // this example is just showing the usage of "SqlResources_ListSqlUserDefinedFunctions" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -138,7 +138,7 @@ public async Task GetAll_CosmosDBSqlUserDefinedFunctionList() [Ignore("Only validating compilation of examples")] public async Task Exists_CosmosDBSqlUserDefinedFunctionGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlUserDefinedFunctionGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/CosmosDBSqlUserDefinedFunctionGet.json // this example is just showing the usage of "SqlResources_GetSqlUserDefinedFunction" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -170,7 +170,7 @@ public async Task Exists_CosmosDBSqlUserDefinedFunctionGet() [Ignore("Only validating compilation of examples")] public async Task GetIfExists_CosmosDBSqlUserDefinedFunctionGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlUserDefinedFunctionGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/CosmosDBSqlUserDefinedFunctionGet.json // this example is just showing the usage of "SqlResources_GetSqlUserDefinedFunction" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBSqlUserDefinedFunctionResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBSqlUserDefinedFunctionResource.cs index a07e69b843cf..a20e812a4ce2 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBSqlUserDefinedFunctionResource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBSqlUserDefinedFunctionResource.cs @@ -20,7 +20,7 @@ public partial class Sample_CosmosDBSqlUserDefinedFunctionResource [Ignore("Only validating compilation of examples")] public async Task Get_CosmosDBSqlUserDefinedFunctionGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlUserDefinedFunctionGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/CosmosDBSqlUserDefinedFunctionGet.json // this example is just showing the usage of "SqlResources_GetSqlUserDefinedFunction" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -53,7 +53,7 @@ public async Task Get_CosmosDBSqlUserDefinedFunctionGet() [Ignore("Only validating compilation of examples")] public async Task Delete_CosmosDBSqlUserDefinedFunctionDelete() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlUserDefinedFunctionDelete.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/CosmosDBSqlUserDefinedFunctionDelete.json // this example is just showing the usage of "SqlResources_DeleteSqlUserDefinedFunction" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -82,7 +82,7 @@ public async Task Delete_CosmosDBSqlUserDefinedFunctionDelete() [Ignore("Only validating compilation of examples")] public async Task Update_CosmosDBSqlUserDefinedFunctionCreateUpdate() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlUserDefinedFunctionCreateUpdate.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/CosmosDBSqlUserDefinedFunctionCreateUpdate.json // this example is just showing the usage of "SqlResources_CreateUpdateSqlUserDefinedFunction" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBTableCollection.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBTableCollection.cs index 1b728fa953d1..5269834080ee 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBTableCollection.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBTableCollection.cs @@ -20,7 +20,7 @@ public partial class Sample_CosmosDBTableCollection [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_CosmosDBTableReplace() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBTableCreateUpdate.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/CosmosDBTableCreateUpdate.json // this example is just showing the usage of "TableResources_CreateUpdateTable" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -60,7 +60,7 @@ public async Task CreateOrUpdate_CosmosDBTableReplace() [Ignore("Only validating compilation of examples")] public async Task Get_CosmosDBTableGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBTableGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/CosmosDBTableGet.json // this example is just showing the usage of "TableResources_GetTable" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -94,7 +94,7 @@ public async Task Get_CosmosDBTableGet() [Ignore("Only validating compilation of examples")] public async Task GetAll_CosmosDBTableList() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBTableList.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/CosmosDBTableList.json // this example is just showing the usage of "TableResources_ListTables" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -130,7 +130,7 @@ public async Task GetAll_CosmosDBTableList() [Ignore("Only validating compilation of examples")] public async Task Exists_CosmosDBTableGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBTableGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/CosmosDBTableGet.json // this example is just showing the usage of "TableResources_GetTable" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -160,7 +160,7 @@ public async Task Exists_CosmosDBTableGet() [Ignore("Only validating compilation of examples")] public async Task GetIfExists_CosmosDBTableGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBTableGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/CosmosDBTableGet.json // this example is just showing the usage of "TableResources_GetTable" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBTableResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBTableResource.cs index e5949e649c7d..bfa29bc50c58 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBTableResource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBTableResource.cs @@ -20,7 +20,7 @@ public partial class Sample_CosmosDBTableResource [Ignore("Only validating compilation of examples")] public async Task Get_CosmosDBTableGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBTableGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/CosmosDBTableGet.json // this example is just showing the usage of "TableResources_GetTable" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -51,7 +51,7 @@ public async Task Get_CosmosDBTableGet() [Ignore("Only validating compilation of examples")] public async Task Delete_CosmosDBTableDelete() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBTableDelete.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/CosmosDBTableDelete.json // this example is just showing the usage of "TableResources_DeleteTable" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -78,7 +78,7 @@ public async Task Delete_CosmosDBTableDelete() [Ignore("Only validating compilation of examples")] public async Task Update_CosmosDBTableReplace() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBTableCreateUpdate.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/CosmosDBTableCreateUpdate.json // this example is just showing the usage of "TableResources_CreateUpdateTable" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -115,7 +115,7 @@ public async Task Update_CosmosDBTableReplace() [Ignore("Only validating compilation of examples")] public async Task RetrieveContinuousBackupInformation_CosmosDBTableCollectionBackupInformation() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBTableBackupInformation.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/CosmosDBTableBackupInformation.json // this example is just showing the usage of "TableResources_RetrieveContinuousBackupInformation" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBTableRoleAssignmentCollection.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBTableRoleAssignmentCollection.cs index 2e604e7ada31..7a9055231799 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBTableRoleAssignmentCollection.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBTableRoleAssignmentCollection.cs @@ -19,7 +19,7 @@ public partial class Sample_CosmosDBTableRoleAssignmentCollection [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_CosmosDBTableRoleAssignmentCreateUpdate() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/tablerbac/CosmosDBTableRoleAssignmentCreateUpdate.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/tablerbac/CosmosDBTableRoleAssignmentCreateUpdate.json // this example is just showing the usage of "TableResources_CreateUpdateTableRoleAssignment" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -60,7 +60,7 @@ public async Task CreateOrUpdate_CosmosDBTableRoleAssignmentCreateUpdate() [Ignore("Only validating compilation of examples")] public async Task Get_CosmosDBTableRoleAssignmentGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/tablerbac/CosmosDBTableRoleAssignmentGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/tablerbac/CosmosDBTableRoleAssignmentGet.json // this example is just showing the usage of "TableResources_GetTableRoleAssignment" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -94,7 +94,7 @@ public async Task Get_CosmosDBTableRoleAssignmentGet() [Ignore("Only validating compilation of examples")] public async Task GetAll_CosmosDBTableRoleAssignmentList() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/tablerbac/CosmosDBTableRoleAssignmentList.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/tablerbac/CosmosDBTableRoleAssignmentList.json // this example is just showing the usage of "TableResources_ListTableRoleAssignments" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -130,7 +130,7 @@ public async Task GetAll_CosmosDBTableRoleAssignmentList() [Ignore("Only validating compilation of examples")] public async Task Exists_CosmosDBTableRoleAssignmentGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/tablerbac/CosmosDBTableRoleAssignmentGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/tablerbac/CosmosDBTableRoleAssignmentGet.json // this example is just showing the usage of "TableResources_GetTableRoleAssignment" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -160,7 +160,7 @@ public async Task Exists_CosmosDBTableRoleAssignmentGet() [Ignore("Only validating compilation of examples")] public async Task GetIfExists_CosmosDBTableRoleAssignmentGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/tablerbac/CosmosDBTableRoleAssignmentGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/tablerbac/CosmosDBTableRoleAssignmentGet.json // this example is just showing the usage of "TableResources_GetTableRoleAssignment" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBTableRoleAssignmentResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBTableRoleAssignmentResource.cs index ff6e08e22bc2..7165043d205a 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBTableRoleAssignmentResource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBTableRoleAssignmentResource.cs @@ -19,7 +19,7 @@ public partial class Sample_CosmosDBTableRoleAssignmentResource [Ignore("Only validating compilation of examples")] public async Task Get_CosmosDBTableRoleAssignmentGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/tablerbac/CosmosDBTableRoleAssignmentGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/tablerbac/CosmosDBTableRoleAssignmentGet.json // this example is just showing the usage of "TableResources_GetTableRoleAssignment" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -50,7 +50,7 @@ public async Task Get_CosmosDBTableRoleAssignmentGet() [Ignore("Only validating compilation of examples")] public async Task Delete_CosmosDBTableRoleAssignmentDelete() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/tablerbac/CosmosDBTableRoleAssignmentDelete.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/tablerbac/CosmosDBTableRoleAssignmentDelete.json // this example is just showing the usage of "TableResources_DeleteTableRoleAssignment" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -77,7 +77,7 @@ public async Task Delete_CosmosDBTableRoleAssignmentDelete() [Ignore("Only validating compilation of examples")] public async Task Update_CosmosDBTableRoleAssignmentCreateUpdate() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/tablerbac/CosmosDBTableRoleAssignmentCreateUpdate.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/tablerbac/CosmosDBTableRoleAssignmentCreateUpdate.json // this example is just showing the usage of "TableResources_CreateUpdateTableRoleAssignment" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBTableRoleDefinitionCollection.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBTableRoleDefinitionCollection.cs index ef40184b270f..513a49553cd9 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBTableRoleDefinitionCollection.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBTableRoleDefinitionCollection.cs @@ -20,7 +20,7 @@ public partial class Sample_CosmosDBTableRoleDefinitionCollection [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_CosmosDBTableRoleDefinitionCreateUpdate() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/tablerbac/CosmosDBTableRoleDefinitionCreateUpdate.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/tablerbac/CosmosDBTableRoleDefinitionCreateUpdate.json // this example is just showing the usage of "TableResources_CreateUpdateTableRoleDefinition" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -66,7 +66,7 @@ public async Task CreateOrUpdate_CosmosDBTableRoleDefinitionCreateUpdate() [Ignore("Only validating compilation of examples")] public async Task Get_CosmosDBTableRoleDefinitionGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/tablerbac/CosmosDBTableRoleDefinitionGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/tablerbac/CosmosDBTableRoleDefinitionGet.json // this example is just showing the usage of "TableResources_GetTableRoleDefinition" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -100,7 +100,7 @@ public async Task Get_CosmosDBTableRoleDefinitionGet() [Ignore("Only validating compilation of examples")] public async Task GetAll_CosmosDBTableRoleDefinitionList() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/tablerbac/CosmosDBTableRoleDefinitionList.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/tablerbac/CosmosDBTableRoleDefinitionList.json // this example is just showing the usage of "TableResources_ListTableRoleDefinitions" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -136,7 +136,7 @@ public async Task GetAll_CosmosDBTableRoleDefinitionList() [Ignore("Only validating compilation of examples")] public async Task Exists_CosmosDBTableRoleDefinitionGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/tablerbac/CosmosDBTableRoleDefinitionGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/tablerbac/CosmosDBTableRoleDefinitionGet.json // this example is just showing the usage of "TableResources_GetTableRoleDefinition" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -166,7 +166,7 @@ public async Task Exists_CosmosDBTableRoleDefinitionGet() [Ignore("Only validating compilation of examples")] public async Task GetIfExists_CosmosDBTableRoleDefinitionGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/tablerbac/CosmosDBTableRoleDefinitionGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/tablerbac/CosmosDBTableRoleDefinitionGet.json // this example is just showing the usage of "TableResources_GetTableRoleDefinition" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBTableRoleDefinitionResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBTableRoleDefinitionResource.cs index 826f3e7892d0..fea866dd68f9 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBTableRoleDefinitionResource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBTableRoleDefinitionResource.cs @@ -20,7 +20,7 @@ public partial class Sample_CosmosDBTableRoleDefinitionResource [Ignore("Only validating compilation of examples")] public async Task Get_CosmosDBTableRoleDefinitionGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/tablerbac/CosmosDBTableRoleDefinitionGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/tablerbac/CosmosDBTableRoleDefinitionGet.json // this example is just showing the usage of "TableResources_GetTableRoleDefinition" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -51,7 +51,7 @@ public async Task Get_CosmosDBTableRoleDefinitionGet() [Ignore("Only validating compilation of examples")] public async Task Delete_CosmosDBTableRoleDefinitionDelete() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/tablerbac/CosmosDBTableRoleDefinitionDelete.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/tablerbac/CosmosDBTableRoleDefinitionDelete.json // this example is just showing the usage of "TableResources_DeleteTableRoleDefinition" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -78,7 +78,7 @@ public async Task Delete_CosmosDBTableRoleDefinitionDelete() [Ignore("Only validating compilation of examples")] public async Task Update_CosmosDBTableRoleDefinitionCreateUpdate() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/tablerbac/CosmosDBTableRoleDefinitionCreateUpdate.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/tablerbac/CosmosDBTableRoleDefinitionCreateUpdate.json // this example is just showing the usage of "TableResources_CreateUpdateTableRoleDefinition" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBThroughputPoolAccountCollection.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBThroughputPoolAccountCollection.cs index 5a69239beea2..c41dc8e09f31 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBThroughputPoolAccountCollection.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBThroughputPoolAccountCollection.cs @@ -19,7 +19,7 @@ public partial class Sample_CosmosDBThroughputPoolAccountCollection [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_CosmosDBThroughputPoolAccountCreate() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/throughputPool/CosmosDBThroughputPoolAccountCreate.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/throughputPool/CosmosDBThroughputPoolAccountCreate.json // this example is just showing the usage of "ThroughputPoolAccount_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 @@ -59,7 +59,7 @@ public async Task CreateOrUpdate_CosmosDBThroughputPoolAccountCreate() [Ignore("Only validating compilation of examples")] public async Task Get_CosmosDBThroughputPoolAccountGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/throughputPool/CosmosDBThroughputPoolAccountGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/throughputPool/CosmosDBThroughputPoolAccountGet.json // this example is just showing the usage of "ThroughputPoolAccount_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 @@ -93,7 +93,7 @@ public async Task Get_CosmosDBThroughputPoolAccountGet() [Ignore("Only validating compilation of examples")] public async Task GetAll_CosmosDBThroughputPoolAccountList() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/throughputPool/CosmosDBThroughputPoolAccountsList.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/throughputPool/CosmosDBThroughputPoolAccountsList.json // this example is just showing the usage of "ThroughputPoolAccounts_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 @@ -129,7 +129,7 @@ public async Task GetAll_CosmosDBThroughputPoolAccountList() [Ignore("Only validating compilation of examples")] public async Task Exists_CosmosDBThroughputPoolAccountGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/throughputPool/CosmosDBThroughputPoolAccountGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/throughputPool/CosmosDBThroughputPoolAccountGet.json // this example is just showing the usage of "ThroughputPoolAccount_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 @@ -159,7 +159,7 @@ public async Task Exists_CosmosDBThroughputPoolAccountGet() [Ignore("Only validating compilation of examples")] public async Task GetIfExists_CosmosDBThroughputPoolAccountGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/throughputPool/CosmosDBThroughputPoolAccountGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/throughputPool/CosmosDBThroughputPoolAccountGet.json // this example is just showing the usage of "ThroughputPoolAccount_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBThroughputPoolAccountResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBThroughputPoolAccountResource.cs index 384c5db48322..06a5b5016976 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBThroughputPoolAccountResource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBThroughputPoolAccountResource.cs @@ -19,7 +19,7 @@ public partial class Sample_CosmosDBThroughputPoolAccountResource [Ignore("Only validating compilation of examples")] public async Task Get_CosmosDBThroughputPoolAccountGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/throughputPool/CosmosDBThroughputPoolAccountGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/throughputPool/CosmosDBThroughputPoolAccountGet.json // this example is just showing the usage of "ThroughputPoolAccount_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -50,7 +50,7 @@ public async Task Get_CosmosDBThroughputPoolAccountGet() [Ignore("Only validating compilation of examples")] public async Task Delete_CosmosDBThroughputPoolAccountDelete() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/throughputPool/CosmosDBThroughputPoolAccountDelete.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/throughputPool/CosmosDBThroughputPoolAccountDelete.json // this example is just showing the usage of "ThroughputPoolAccount_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 @@ -77,7 +77,7 @@ public async Task Delete_CosmosDBThroughputPoolAccountDelete() [Ignore("Only validating compilation of examples")] public async Task Update_CosmosDBThroughputPoolAccountCreate() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/throughputPool/CosmosDBThroughputPoolAccountCreate.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/throughputPool/CosmosDBThroughputPoolAccountCreate.json // this example is just showing the usage of "ThroughputPoolAccount_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 diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBThroughputPoolCollection.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBThroughputPoolCollection.cs index f31b68a04018..b1be066e5fa8 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBThroughputPoolCollection.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBThroughputPoolCollection.cs @@ -20,7 +20,7 @@ public partial class Sample_CosmosDBThroughputPoolCollection [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_CosmosDBThroughputPoolCreate() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/throughputPool/CosmosDBThroughputPoolCreate.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/throughputPool/CosmosDBThroughputPoolCreate.json // this example is just showing the usage of "ThroughputPool_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -59,7 +59,7 @@ public async Task CreateOrUpdate_CosmosDBThroughputPoolCreate() [Ignore("Only validating compilation of examples")] public async Task Get_CosmosDBThroughputPoolGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/throughputPool/CosmosDBThroughputPoolGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/throughputPool/CosmosDBThroughputPoolGet.json // this example is just showing the usage of "ThroughputPool_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 @@ -92,7 +92,7 @@ public async Task Get_CosmosDBThroughputPoolGet() [Ignore("Only validating compilation of examples")] public async Task GetAll_CosmosDBThroughputPoolListByResourceGroup() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/throughputPool/CosmosDBThroughputPoolList.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/throughputPool/CosmosDBThroughputPoolList.json // this example is just showing the usage of "ThroughputPools_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 @@ -127,7 +127,7 @@ public async Task GetAll_CosmosDBThroughputPoolListByResourceGroup() [Ignore("Only validating compilation of examples")] public async Task Exists_CosmosDBThroughputPoolGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/throughputPool/CosmosDBThroughputPoolGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/throughputPool/CosmosDBThroughputPoolGet.json // this example is just showing the usage of "ThroughputPool_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 @@ -156,7 +156,7 @@ public async Task Exists_CosmosDBThroughputPoolGet() [Ignore("Only validating compilation of examples")] public async Task GetIfExists_CosmosDBThroughputPoolGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/throughputPool/CosmosDBThroughputPoolGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/throughputPool/CosmosDBThroughputPoolGet.json // this example is just showing the usage of "ThroughputPool_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBThroughputPoolResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBThroughputPoolResource.cs index 37cbe22baf30..25084201c124 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBThroughputPoolResource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosDBThroughputPoolResource.cs @@ -20,7 +20,7 @@ public partial class Sample_CosmosDBThroughputPoolResource [Ignore("Only validating compilation of examples")] public async Task Get_CosmosDBThroughputPoolGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/throughputPool/CosmosDBThroughputPoolGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/throughputPool/CosmosDBThroughputPoolGet.json // this example is just showing the usage of "ThroughputPool_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -50,7 +50,7 @@ public async Task Get_CosmosDBThroughputPoolGet() [Ignore("Only validating compilation of examples")] public async Task Delete_CosmosDBThroughputPoolDelete() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/throughputPool/CosmosDBThroughputPoolDelete.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/throughputPool/CosmosDBThroughputPoolDelete.json // this example is just showing the usage of "ThroughputPool_Delete" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -76,7 +76,7 @@ public async Task Delete_CosmosDBThroughputPoolDelete() [Ignore("Only validating compilation of examples")] public async Task Update_CosmosDBThroughputPoolUpdate() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/throughputPool/CosmosDBThroughputPoolUpdate.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/throughputPool/CosmosDBThroughputPoolUpdate.json // this example is just showing the usage of "ThroughputPool_Update" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosTableThroughputSettingResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosTableThroughputSettingResource.cs index a0fb1423ca10..38d5cd094e58 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosTableThroughputSettingResource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_CosmosTableThroughputSettingResource.cs @@ -20,7 +20,7 @@ public partial class Sample_CosmosTableThroughputSettingResource [Ignore("Only validating compilation of examples")] public async Task Get_CosmosDBTableThroughputGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBTableThroughputGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/CosmosDBTableThroughputGet.json // this example is just showing the usage of "TableResources_GetTableThroughput" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -51,7 +51,7 @@ public async Task Get_CosmosDBTableThroughputGet() [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_CosmosDBTableThroughputUpdate() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBTableThroughputUpdate.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/CosmosDBTableThroughputUpdate.json // this example is just showing the usage of "TableResources_UpdateTableThroughput" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -90,7 +90,7 @@ public async Task CreateOrUpdate_CosmosDBTableThroughputUpdate() [Ignore("Only validating compilation of examples")] public async Task MigrateTableToAutoscale_CosmosDBTableMigrateToAutoscale() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBTableMigrateToAutoscale.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/CosmosDBTableMigrateToAutoscale.json // this example is just showing the usage of "TableResources_MigrateTableToAutoscale" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -122,7 +122,7 @@ public async Task MigrateTableToAutoscale_CosmosDBTableMigrateToAutoscale() [Ignore("Only validating compilation of examples")] public async Task MigrateTableToManualThroughput_CosmosDBTableMigrateToManualThroughput() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBTableMigrateToManualThroughput.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/CosmosDBTableMigrateToManualThroughput.json // this example is just showing the usage of "TableResources_MigrateTableToManualThroughput" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_DataTransferJobGetResultCollection.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_DataTransferJobGetResultCollection.cs index 6855655db1f2..41ffb59a0fdb 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_DataTransferJobGetResultCollection.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_DataTransferJobGetResultCollection.cs @@ -20,7 +20,7 @@ public partial class Sample_DataTransferJobGetResultCollection [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_CosmosDBDataTransferJobCreate() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/data-transfer-service/CosmosDBDataTransferJobCreate.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/data-transfer-service/CosmosDBDataTransferJobCreate.json // this example is just showing the usage of "DataTransferJobs_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 @@ -59,7 +59,7 @@ public async Task CreateOrUpdate_CosmosDBDataTransferJobCreate() [Ignore("Only validating compilation of examples")] public async Task Get_CosmosDBDataTransferJobGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/data-transfer-service/CosmosDBDataTransferJobGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/data-transfer-service/CosmosDBDataTransferJobGet.json // this example is just showing the usage of "DataTransferJobs_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 @@ -93,7 +93,7 @@ public async Task Get_CosmosDBDataTransferJobGet() [Ignore("Only validating compilation of examples")] public async Task GetAll_CosmosDBDataTransferJobFeed() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/data-transfer-service/CosmosDBDataTransferJobFeed.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/data-transfer-service/CosmosDBDataTransferJobFeed.json // this example is just showing the usage of "DataTransferJobs_ListByDatabaseAccount" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -129,7 +129,7 @@ public async Task GetAll_CosmosDBDataTransferJobFeed() [Ignore("Only validating compilation of examples")] public async Task Exists_CosmosDBDataTransferJobGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/data-transfer-service/CosmosDBDataTransferJobGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/data-transfer-service/CosmosDBDataTransferJobGet.json // this example is just showing the usage of "DataTransferJobs_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 @@ -159,7 +159,7 @@ public async Task Exists_CosmosDBDataTransferJobGet() [Ignore("Only validating compilation of examples")] public async Task GetIfExists_CosmosDBDataTransferJobGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/data-transfer-service/CosmosDBDataTransferJobGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/data-transfer-service/CosmosDBDataTransferJobGet.json // this example is just showing the usage of "DataTransferJobs_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_DataTransferJobGetResultResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_DataTransferJobGetResultResource.cs index f3eb5f745430..19aa611770c4 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_DataTransferJobGetResultResource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_DataTransferJobGetResultResource.cs @@ -20,7 +20,7 @@ public partial class Sample_DataTransferJobGetResultResource [Ignore("Only validating compilation of examples")] public async Task Get_CosmosDBDataTransferJobGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/data-transfer-service/CosmosDBDataTransferJobGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/data-transfer-service/CosmosDBDataTransferJobGet.json // this example is just showing the usage of "DataTransferJobs_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -51,7 +51,7 @@ public async Task Get_CosmosDBDataTransferJobGet() [Ignore("Only validating compilation of examples")] public async Task Update_CosmosDBDataTransferJobCreate() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/data-transfer-service/CosmosDBDataTransferJobCreate.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/data-transfer-service/CosmosDBDataTransferJobCreate.json // this example is just showing the usage of "DataTransferJobs_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 @@ -87,7 +87,7 @@ public async Task Update_CosmosDBDataTransferJobCreate() [Ignore("Only validating compilation of examples")] public async Task Pause_CosmosDBDataTransferJobPause() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/data-transfer-service/CosmosDBDataTransferJobPause.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/data-transfer-service/CosmosDBDataTransferJobPause.json // this example is just showing the usage of "DataTransferJobs_Pause" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -118,7 +118,7 @@ public async Task Pause_CosmosDBDataTransferJobPause() [Ignore("Only validating compilation of examples")] public async Task Resume_CosmosDBDataTransferJobResume() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/data-transfer-service/CosmosDBDataTransferJobResume.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/data-transfer-service/CosmosDBDataTransferJobResume.json // this example is just showing the usage of "DataTransferJobs_Resume" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -149,7 +149,7 @@ public async Task Resume_CosmosDBDataTransferJobResume() [Ignore("Only validating compilation of examples")] public async Task Cancel_CosmosDBDataTransferJobCancel() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/data-transfer-service/CosmosDBDataTransferJobCancel.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/data-transfer-service/CosmosDBDataTransferJobCancel.json // this example is just showing the usage of "DataTransferJobs_Cancel" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -180,7 +180,7 @@ public async Task Cancel_CosmosDBDataTransferJobCancel() [Ignore("Only validating compilation of examples")] public async Task Complete_CosmosDBDataTransferJobComplete() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/data-transfer-service/CosmosDBDataTransferJobComplete.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/data-transfer-service/CosmosDBDataTransferJobComplete.json // this example is just showing the usage of "DataTransferJobs_Complete" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_FleetAnalyticsResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_FleetAnalyticsResource.cs new file mode 100644 index 000000000000..39799a240381 --- /dev/null +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_FleetAnalyticsResource.cs @@ -0,0 +1,114 @@ +// 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.CosmosDB.Models; +using NUnit.Framework; + +namespace Azure.ResourceManager.CosmosDB.Samples +{ + public partial class Sample_FleetAnalyticsResource + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_CosmosDBFleetAnalyticsGet() + { + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/fleet/CosmosDBFleetAnalyticsGet.json + // this example is just showing the usage of "FleetAnalytics_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this FleetAnalyticsResource created on azure + // for more information of creating FleetAnalyticsResource, please refer to the document of FleetAnalyticsResource + string subscriptionId = "ffffffff-ffff-ffff-ffff-ffffffffffff"; + string resourceGroupName = "rg1"; + string fleetName = "fleet1"; + string fleetAnalyticsName = "storageAccount"; + ResourceIdentifier fleetAnalyticsResourceId = FleetAnalyticsResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, fleetName, fleetAnalyticsName); + FleetAnalyticsResource fleetAnalyticsResource = client.GetFleetAnalyticsResource(fleetAnalyticsResourceId); + + // invoke the operation + FleetAnalyticsResource result = await fleetAnalyticsResource.GetAsync(); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + FleetAnalyticsResourceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Delete_CosmosDBFleetAnalyticsDelete() + { + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/fleet/CosmosDBFleetAnalyticsDelete.json + // this example is just showing the usage of "FleetAnalytics_Delete" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this FleetAnalyticsResource created on azure + // for more information of creating FleetAnalyticsResource, please refer to the document of FleetAnalyticsResource + string subscriptionId = "ffffffff-ffff-ffff-ffff-ffffffffffff"; + string resourceGroupName = "rg1"; + string fleetName = "fleet1"; + string fleetAnalyticsName = "storageAccount"; + ResourceIdentifier fleetAnalyticsResourceId = FleetAnalyticsResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, fleetName, fleetAnalyticsName); + FleetAnalyticsResource fleetAnalyticsResource = client.GetFleetAnalyticsResource(fleetAnalyticsResourceId); + + // invoke the operation + await fleetAnalyticsResource.DeleteAsync(WaitUntil.Completed); + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Update_CosmosDBFleetAnalyticsCreate() + { + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/fleet/CosmosDBFleetAnalyticsCreate.json + // this example is just showing the usage of "FleetAnalytics_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(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this FleetAnalyticsResource created on azure + // for more information of creating FleetAnalyticsResource, please refer to the document of FleetAnalyticsResource + string subscriptionId = "ffffffff-ffff-ffff-ffff-ffffffffffff"; + string resourceGroupName = "rg1"; + string fleetName = "fleet1"; + string fleetAnalyticsName = "storageAccount"; + ResourceIdentifier fleetAnalyticsResourceId = FleetAnalyticsResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, fleetName, fleetAnalyticsName); + FleetAnalyticsResource fleetAnalyticsResource = client.GetFleetAnalyticsResource(fleetAnalyticsResourceId); + + // invoke the operation + FleetAnalyticsResourceData data = new FleetAnalyticsResourceData + { + StorageLocationType = FleetAnalyticsPropertiesStorageLocationType.StorageAccount, + StorageLocationUri = new Uri("/subscriptions/d1eb41bc-1b7f-4404-bd2a-868c222852d/resourceGroups/rg1/providers/Microsoft.Storage/storageAccounts/testStorageAccount1"), + }; + ArmOperation lro = await fleetAnalyticsResource.UpdateAsync(WaitUntil.Completed, data); + FleetAnalyticsResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + FleetAnalyticsResourceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } +} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_FleetAnalyticsResourceCollection.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_FleetAnalyticsResourceCollection.cs new file mode 100644 index 000000000000..0106cb7bc265 --- /dev/null +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_FleetAnalyticsResourceCollection.cs @@ -0,0 +1,201 @@ +// 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.CosmosDB.Models; +using NUnit.Framework; + +namespace Azure.ResourceManager.CosmosDB.Samples +{ + public partial class Sample_FleetAnalyticsResourceCollection + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task CreateOrUpdate_CosmosDBFleetAnalyticsCreate() + { + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/fleet/CosmosDBFleetAnalyticsCreate.json + // this example is just showing the usage of "FleetAnalytics_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(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this FleetResource created on azure + // for more information of creating FleetResource, please refer to the document of FleetResource + string subscriptionId = "ffffffff-ffff-ffff-ffff-ffffffffffff"; + string resourceGroupName = "rg1"; + string fleetName = "fleet1"; + ResourceIdentifier fleetResourceId = FleetResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, fleetName); + FleetResource fleetResource = client.GetFleetResource(fleetResourceId); + + // get the collection of this FleetAnalyticsResource + FleetAnalyticsResourceCollection collection = fleetResource.GetFleetAnalyticsResources(); + + // invoke the operation + string fleetAnalyticsName = "storageAccount"; + FleetAnalyticsResourceData data = new FleetAnalyticsResourceData + { + StorageLocationType = FleetAnalyticsPropertiesStorageLocationType.StorageAccount, + StorageLocationUri = new Uri("/subscriptions/d1eb41bc-1b7f-4404-bd2a-868c222852d/resourceGroups/rg1/providers/Microsoft.Storage/storageAccounts/testStorageAccount1"), + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, fleetAnalyticsName, data); + FleetAnalyticsResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + FleetAnalyticsResourceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_CosmosDBFleetAnalyticsGet() + { + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/fleet/CosmosDBFleetAnalyticsGet.json + // this example is just showing the usage of "FleetAnalytics_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this FleetResource created on azure + // for more information of creating FleetResource, please refer to the document of FleetResource + string subscriptionId = "ffffffff-ffff-ffff-ffff-ffffffffffff"; + string resourceGroupName = "rg1"; + string fleetName = "fleet1"; + ResourceIdentifier fleetResourceId = FleetResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, fleetName); + FleetResource fleetResource = client.GetFleetResource(fleetResourceId); + + // get the collection of this FleetAnalyticsResource + FleetAnalyticsResourceCollection collection = fleetResource.GetFleetAnalyticsResources(); + + // invoke the operation + string fleetAnalyticsName = "storageAccount"; + FleetAnalyticsResource result = await collection.GetAsync(fleetAnalyticsName); + + // 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 + FleetAnalyticsResourceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetAll_CosmosDBFleetAnalyticsList() + { + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/fleet/CosmosDBFleetAnalyticsList.json + // this example is just showing the usage of "FleetAnalytics_List" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this FleetResource created on azure + // for more information of creating FleetResource, please refer to the document of FleetResource + string subscriptionId = "ffffffff-ffff-ffff-ffff-ffffffffffff"; + string resourceGroupName = "rg1"; + string fleetName = "fleet1"; + ResourceIdentifier fleetResourceId = FleetResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, fleetName); + FleetResource fleetResource = client.GetFleetResource(fleetResourceId); + + // get the collection of this FleetAnalyticsResource + FleetAnalyticsResourceCollection collection = fleetResource.GetFleetAnalyticsResources(); + + // invoke the operation and iterate over the result + await foreach (FleetAnalyticsResource item in collection.GetAllAsync()) + { + // the variable item is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + FleetAnalyticsResourceData resourceData = item.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Exists_CosmosDBFleetAnalyticsGet() + { + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/fleet/CosmosDBFleetAnalyticsGet.json + // this example is just showing the usage of "FleetAnalytics_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this FleetResource created on azure + // for more information of creating FleetResource, please refer to the document of FleetResource + string subscriptionId = "ffffffff-ffff-ffff-ffff-ffffffffffff"; + string resourceGroupName = "rg1"; + string fleetName = "fleet1"; + ResourceIdentifier fleetResourceId = FleetResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, fleetName); + FleetResource fleetResource = client.GetFleetResource(fleetResourceId); + + // get the collection of this FleetAnalyticsResource + FleetAnalyticsResourceCollection collection = fleetResource.GetFleetAnalyticsResources(); + + // invoke the operation + string fleetAnalyticsName = "storageAccount"; + bool result = await collection.ExistsAsync(fleetAnalyticsName); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetIfExists_CosmosDBFleetAnalyticsGet() + { + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/fleet/CosmosDBFleetAnalyticsGet.json + // this example is just showing the usage of "FleetAnalytics_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this FleetResource created on azure + // for more information of creating FleetResource, please refer to the document of FleetResource + string subscriptionId = "ffffffff-ffff-ffff-ffff-ffffffffffff"; + string resourceGroupName = "rg1"; + string fleetName = "fleet1"; + ResourceIdentifier fleetResourceId = FleetResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, fleetName); + FleetResource fleetResource = client.GetFleetResource(fleetResourceId); + + // get the collection of this FleetAnalyticsResource + FleetAnalyticsResourceCollection collection = fleetResource.GetFleetAnalyticsResources(); + + // invoke the operation + string fleetAnalyticsName = "storageAccount"; + NullableResponse response = await collection.GetIfExistsAsync(fleetAnalyticsName); + FleetAnalyticsResource result = response.HasValue ? response.Value : null; + + if (result == null) + { + Console.WriteLine("Succeeded with null as result"); + } + else + { + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + FleetAnalyticsResourceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + } +} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_FleetResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_FleetResource.cs new file mode 100644 index 000000000000..7d3b4062a595 --- /dev/null +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_FleetResource.cs @@ -0,0 +1,106 @@ +// 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.CosmosDB.Models; +using NUnit.Framework; + +namespace Azure.ResourceManager.CosmosDB.Samples +{ + public partial class Sample_FleetResource + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_CosmosDBFleetGet() + { + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/fleet/CosmosDBFleetGet.json + // this example is just showing the usage of "Fleet_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this FleetResource created on azure + // for more information of creating FleetResource, please refer to the document of FleetResource + string subscriptionId = "ffffffff-ffff-ffff-ffff-ffffffffffff"; + string resourceGroupName = "rg1"; + string fleetName = "fleet1"; + ResourceIdentifier fleetResourceId = FleetResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, fleetName); + FleetResource fleetResource = client.GetFleetResource(fleetResourceId); + + // invoke the operation + FleetResource result = await fleetResource.GetAsync(); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + FleetResourceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Delete_CosmosDBFleetDelete() + { + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/fleet/CosmosDBFleetDelete.json + // this example is just showing the usage of "Fleet_Delete" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this FleetResource created on azure + // for more information of creating FleetResource, please refer to the document of FleetResource + string subscriptionId = "ffffffff-ffff-ffff-ffff-ffffffffffff"; + string resourceGroupName = "rg1"; + string fleetName = "fleet1"; + ResourceIdentifier fleetResourceId = FleetResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, fleetName); + FleetResource fleetResource = client.GetFleetResource(fleetResourceId); + + // invoke the operation + await fleetResource.DeleteAsync(WaitUntil.Completed); + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Update_CosmosDBFleetUpdate() + { + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/fleet/CosmosDBFleetUpdate.json + // this example is just showing the usage of "Fleet_Update" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this FleetResource created on azure + // for more information of creating FleetResource, please refer to the document of FleetResource + string subscriptionId = "ffffffff-ffff-ffff-ffff-ffffffffffff"; + string resourceGroupName = "rg1"; + string fleetName = "fleet1"; + ResourceIdentifier fleetResourceId = FleetResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, fleetName); + FleetResource fleetResource = client.GetFleetResource(fleetResourceId); + + // invoke the operation + FleetResourcePatch patch = new FleetResourcePatch(); + FleetResource result = await fleetResource.UpdateAsync(patch); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + FleetResourceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } +} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_FleetResourceCollection.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_FleetResourceCollection.cs new file mode 100644 index 000000000000..a66a4347eabb --- /dev/null +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_FleetResourceCollection.cs @@ -0,0 +1,199 @@ +// 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.Resources; +using NUnit.Framework; + +namespace Azure.ResourceManager.CosmosDB.Samples +{ + public partial class Sample_FleetResourceCollection + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task CreateOrUpdate_CosmosDBFleetCreate() + { + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/fleet/CosmosDBFleetCreate.json + // this example is just showing the usage of "Fleet_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(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "ffffffff-ffff-ffff-ffff-ffffffffffff"; + string resourceGroupName = "rg1"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this FleetResource + FleetResourceCollection collection = resourceGroupResource.GetFleetResources(); + + // invoke the operation + string fleetName = "fleet1"; + FleetResourceData data = new FleetResourceData(new AzureLocation("West US")) + { + Tags = +{ +["Dept"] = "Finance", +["Environment"] = "Production" +}, + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, fleetName, data); + FleetResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + FleetResourceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_CosmosDBFleetGet() + { + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/fleet/CosmosDBFleetGet.json + // this example is just showing the usage of "Fleet_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "ffffffff-ffff-ffff-ffff-ffffffffffff"; + string resourceGroupName = "rg1"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this FleetResource + FleetResourceCollection collection = resourceGroupResource.GetFleetResources(); + + // invoke the operation + string fleetName = "fleet1"; + FleetResource result = await collection.GetAsync(fleetName); + + // 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 + FleetResourceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetAll_CosmosDBFleetListByResourceGroup() + { + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/fleet/CosmosDBFleetList.json + // this example is just showing the usage of "Fleet_ListByResourceGroup" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "ffffffff-ffff-ffff-ffff-ffffffffffff"; + string resourceGroupName = "rg1"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this FleetResource + FleetResourceCollection collection = resourceGroupResource.GetFleetResources(); + + // invoke the operation and iterate over the result + await foreach (FleetResource item in collection.GetAllAsync()) + { + // the variable item is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + FleetResourceData resourceData = item.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Exists_CosmosDBFleetGet() + { + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/fleet/CosmosDBFleetGet.json + // this example is just showing the usage of "Fleet_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "ffffffff-ffff-ffff-ffff-ffffffffffff"; + string resourceGroupName = "rg1"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this FleetResource + FleetResourceCollection collection = resourceGroupResource.GetFleetResources(); + + // invoke the operation + string fleetName = "fleet1"; + bool result = await collection.ExistsAsync(fleetName); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetIfExists_CosmosDBFleetGet() + { + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/fleet/CosmosDBFleetGet.json + // this example is just showing the usage of "Fleet_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "ffffffff-ffff-ffff-ffff-ffffffffffff"; + string resourceGroupName = "rg1"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this FleetResource + FleetResourceCollection collection = resourceGroupResource.GetFleetResources(); + + // invoke the operation + string fleetName = "fleet1"; + NullableResponse response = await collection.GetIfExistsAsync(fleetName); + FleetResource result = response.HasValue ? response.Value : null; + + if (result == null) + { + Console.WriteLine("Succeeded with null as result"); + } + else + { + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + FleetResourceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + } +} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_FleetspaceAccountResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_FleetspaceAccountResource.cs new file mode 100644 index 000000000000..b282e663989b --- /dev/null +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_FleetspaceAccountResource.cs @@ -0,0 +1,116 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using NUnit.Framework; + +namespace Azure.ResourceManager.CosmosDB.Samples +{ + public partial class Sample_FleetspaceAccountResource + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_CosmosDBFleetspaceAccountGet() + { + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/fleet/CosmosDBFleetspaceAccountGet.json + // this example is just showing the usage of "FleetspaceAccount_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this FleetspaceAccountResource created on azure + // for more information of creating FleetspaceAccountResource, please refer to the document of FleetspaceAccountResource + string subscriptionId = "ffffffff-ffff-ffff-ffff-ffffffffffff"; + string resourceGroupName = "rg1"; + string fleetName = "fleet1"; + string fleetspaceName = "fleetspace1"; + string fleetspaceAccountName = "db1"; + ResourceIdentifier fleetspaceAccountResourceId = FleetspaceAccountResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, fleetName, fleetspaceName, fleetspaceAccountName); + FleetspaceAccountResource fleetspaceAccountResource = client.GetFleetspaceAccountResource(fleetspaceAccountResourceId); + + // invoke the operation + FleetspaceAccountResource result = await fleetspaceAccountResource.GetAsync(); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + FleetspaceAccountResourceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Delete_CosmosDBFleetspaceAccountDelete() + { + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/fleet/CosmosDBFleetspaceAccountDelete.json + // this example is just showing the usage of "FleetspaceAccount_Delete" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this FleetspaceAccountResource created on azure + // for more information of creating FleetspaceAccountResource, please refer to the document of FleetspaceAccountResource + string subscriptionId = "ffffffff-ffff-ffff-ffff-ffffffffffff"; + string resourceGroupName = "rg1"; + string fleetName = "fleet1"; + string fleetspaceName = "fleetspace1"; + string fleetspaceAccountName = "db1"; + ResourceIdentifier fleetspaceAccountResourceId = FleetspaceAccountResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, fleetName, fleetspaceName, fleetspaceAccountName); + FleetspaceAccountResource fleetspaceAccountResource = client.GetFleetspaceAccountResource(fleetspaceAccountResourceId); + + // invoke the operation + await fleetspaceAccountResource.DeleteAsync(WaitUntil.Completed); + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Update_CosmosDBFleetspaceAccountCreate() + { + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/fleet/CosmosDBFleetspaceAccountCreate.json + // this example is just showing the usage of "FleetspaceAccount_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(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this FleetspaceAccountResource created on azure + // for more information of creating FleetspaceAccountResource, please refer to the document of FleetspaceAccountResource + string subscriptionId = "ffffffff-ffff-ffff-ffff-ffffffffffff"; + string resourceGroupName = "rg1"; + string fleetName = "fleet1"; + string fleetspaceName = "fleetspace1"; + string fleetspaceAccountName = "db1"; + ResourceIdentifier fleetspaceAccountResourceId = FleetspaceAccountResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, fleetName, fleetspaceName, fleetspaceAccountName); + FleetspaceAccountResource fleetspaceAccountResource = client.GetFleetspaceAccountResource(fleetspaceAccountResourceId); + + // invoke the operation + FleetspaceAccountResourceData data = new FleetspaceAccountResourceData + { + AccountResourceIdentifier = "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/providers/Microsoft.DocumentDB/resourceGroup/rg1/databaseAccounts/db1", + AccountLocation = "West US", + }; + ArmOperation lro = await fleetspaceAccountResource.UpdateAsync(WaitUntil.Completed, data); + FleetspaceAccountResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + FleetspaceAccountResourceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } +} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_FleetspaceAccountResourceCollection.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_FleetspaceAccountResourceCollection.cs new file mode 100644 index 000000000000..13219d0b05e2 --- /dev/null +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_FleetspaceAccountResourceCollection.cs @@ -0,0 +1,205 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using NUnit.Framework; + +namespace Azure.ResourceManager.CosmosDB.Samples +{ + public partial class Sample_FleetspaceAccountResourceCollection + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task CreateOrUpdate_CosmosDBFleetspaceAccountCreate() + { + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/fleet/CosmosDBFleetspaceAccountCreate.json + // this example is just showing the usage of "FleetspaceAccount_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(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this FleetspaceResource created on azure + // for more information of creating FleetspaceResource, please refer to the document of FleetspaceResource + string subscriptionId = "ffffffff-ffff-ffff-ffff-ffffffffffff"; + string resourceGroupName = "rg1"; + string fleetName = "fleet1"; + string fleetspaceName = "fleetspace1"; + ResourceIdentifier fleetspaceResourceId = FleetspaceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, fleetName, fleetspaceName); + FleetspaceResource fleetspaceResource = client.GetFleetspaceResource(fleetspaceResourceId); + + // get the collection of this FleetspaceAccountResource + FleetspaceAccountResourceCollection collection = fleetspaceResource.GetFleetspaceAccountResources(); + + // invoke the operation + string fleetspaceAccountName = "db1"; + FleetspaceAccountResourceData data = new FleetspaceAccountResourceData + { + AccountResourceIdentifier = "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/providers/Microsoft.DocumentDB/resourceGroup/rg1/databaseAccounts/db1", + AccountLocation = "West US", + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, fleetspaceAccountName, data); + FleetspaceAccountResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + FleetspaceAccountResourceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_CosmosDBFleetspaceAccountGet() + { + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/fleet/CosmosDBFleetspaceAccountGet.json + // this example is just showing the usage of "FleetspaceAccount_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this FleetspaceResource created on azure + // for more information of creating FleetspaceResource, please refer to the document of FleetspaceResource + string subscriptionId = "ffffffff-ffff-ffff-ffff-ffffffffffff"; + string resourceGroupName = "rg1"; + string fleetName = "fleet1"; + string fleetspaceName = "fleetspace1"; + ResourceIdentifier fleetspaceResourceId = FleetspaceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, fleetName, fleetspaceName); + FleetspaceResource fleetspaceResource = client.GetFleetspaceResource(fleetspaceResourceId); + + // get the collection of this FleetspaceAccountResource + FleetspaceAccountResourceCollection collection = fleetspaceResource.GetFleetspaceAccountResources(); + + // invoke the operation + string fleetspaceAccountName = "db1"; + FleetspaceAccountResource result = await collection.GetAsync(fleetspaceAccountName); + + // 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 + FleetspaceAccountResourceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetAll_CosmosDBFleetspaceAccountList() + { + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/fleet/CosmosDBFleetspaceAccountList.json + // this example is just showing the usage of "FleetspaceAccount_List" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this FleetspaceResource created on azure + // for more information of creating FleetspaceResource, please refer to the document of FleetspaceResource + string subscriptionId = "ffffffff-ffff-ffff-ffff-ffffffffffff"; + string resourceGroupName = "rg1"; + string fleetName = "fleet1"; + string fleetspaceName = "fleetspace1"; + ResourceIdentifier fleetspaceResourceId = FleetspaceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, fleetName, fleetspaceName); + FleetspaceResource fleetspaceResource = client.GetFleetspaceResource(fleetspaceResourceId); + + // get the collection of this FleetspaceAccountResource + FleetspaceAccountResourceCollection collection = fleetspaceResource.GetFleetspaceAccountResources(); + + // invoke the operation and iterate over the result + await foreach (FleetspaceAccountResource item in collection.GetAllAsync()) + { + // the variable item is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + FleetspaceAccountResourceData resourceData = item.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Exists_CosmosDBFleetspaceAccountGet() + { + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/fleet/CosmosDBFleetspaceAccountGet.json + // this example is just showing the usage of "FleetspaceAccount_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this FleetspaceResource created on azure + // for more information of creating FleetspaceResource, please refer to the document of FleetspaceResource + string subscriptionId = "ffffffff-ffff-ffff-ffff-ffffffffffff"; + string resourceGroupName = "rg1"; + string fleetName = "fleet1"; + string fleetspaceName = "fleetspace1"; + ResourceIdentifier fleetspaceResourceId = FleetspaceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, fleetName, fleetspaceName); + FleetspaceResource fleetspaceResource = client.GetFleetspaceResource(fleetspaceResourceId); + + // get the collection of this FleetspaceAccountResource + FleetspaceAccountResourceCollection collection = fleetspaceResource.GetFleetspaceAccountResources(); + + // invoke the operation + string fleetspaceAccountName = "db1"; + bool result = await collection.ExistsAsync(fleetspaceAccountName); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetIfExists_CosmosDBFleetspaceAccountGet() + { + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/fleet/CosmosDBFleetspaceAccountGet.json + // this example is just showing the usage of "FleetspaceAccount_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this FleetspaceResource created on azure + // for more information of creating FleetspaceResource, please refer to the document of FleetspaceResource + string subscriptionId = "ffffffff-ffff-ffff-ffff-ffffffffffff"; + string resourceGroupName = "rg1"; + string fleetName = "fleet1"; + string fleetspaceName = "fleetspace1"; + ResourceIdentifier fleetspaceResourceId = FleetspaceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, fleetName, fleetspaceName); + FleetspaceResource fleetspaceResource = client.GetFleetspaceResource(fleetspaceResourceId); + + // get the collection of this FleetspaceAccountResource + FleetspaceAccountResourceCollection collection = fleetspaceResource.GetFleetspaceAccountResources(); + + // invoke the operation + string fleetspaceAccountName = "db1"; + NullableResponse response = await collection.GetIfExistsAsync(fleetspaceAccountName); + FleetspaceAccountResource result = response.HasValue ? response.Value : null; + + if (result == null) + { + Console.WriteLine("Succeeded with null as result"); + } + else + { + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + FleetspaceAccountResourceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + } +} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_FleetspaceResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_FleetspaceResource.cs new file mode 100644 index 000000000000..c771b71d2d6f --- /dev/null +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_FleetspaceResource.cs @@ -0,0 +1,119 @@ +// 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.CosmosDB.Models; +using NUnit.Framework; + +namespace Azure.ResourceManager.CosmosDB.Samples +{ + public partial class Sample_FleetspaceResource + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_CosmosDBFleetspaceGet() + { + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/fleet/CosmosDBFleetspaceGet.json + // this example is just showing the usage of "Fleetspace_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this FleetspaceResource created on azure + // for more information of creating FleetspaceResource, please refer to the document of FleetspaceResource + string subscriptionId = "ffffffff-ffff-ffff-ffff-ffffffffffff"; + string resourceGroupName = "rg1"; + string fleetName = "fleet1"; + string fleetspaceName = "fleetspace1"; + ResourceIdentifier fleetspaceResourceId = FleetspaceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, fleetName, fleetspaceName); + FleetspaceResource fleetspaceResource = client.GetFleetspaceResource(fleetspaceResourceId); + + // invoke the operation + FleetspaceResource result = await fleetspaceResource.GetAsync(); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + FleetspaceResourceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Delete_CosmosDBFleetspaceDelete() + { + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/fleet/CosmosDBFleetspaceDelete.json + // this example is just showing the usage of "Fleetspace_Delete" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this FleetspaceResource created on azure + // for more information of creating FleetspaceResource, please refer to the document of FleetspaceResource + string subscriptionId = "ffffffff-ffff-ffff-ffff-ffffffffffff"; + string resourceGroupName = "rg1"; + string fleetName = "fleet1"; + string fleetspaceName = "fleetspace1"; + ResourceIdentifier fleetspaceResourceId = FleetspaceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, fleetName, fleetspaceName); + FleetspaceResource fleetspaceResource = client.GetFleetspaceResource(fleetspaceResourceId); + + // invoke the operation + await fleetspaceResource.DeleteAsync(WaitUntil.Completed); + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Update_CosmosDBFleetspaceUpdate() + { + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/fleet/CosmosDBFleetspaceUpdate.json + // this example is just showing the usage of "Fleetspace_Update" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this FleetspaceResource created on azure + // for more information of creating FleetspaceResource, please refer to the document of FleetspaceResource + string subscriptionId = "ffffffff-ffff-ffff-ffff-ffffffffffff"; + string resourceGroupName = "rg1"; + string fleetName = "fleet1"; + string fleetspaceName = "fleetspace1"; + ResourceIdentifier fleetspaceResourceId = FleetspaceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, fleetName, fleetspaceName); + FleetspaceResource fleetspaceResource = client.GetFleetspaceResource(fleetspaceResourceId); + + // invoke the operation + FleetspaceResourcePatch patch = new FleetspaceResourcePatch + { + FleetspaceApiKind = FleetspacePropertiesFleetspaceApiKind.NoSQL, + ThroughputPoolConfiguration = new FleetspacePropertiesThroughputPoolConfiguration + { + MinThroughput = 3000, + MaxThroughput = 4000, + DataRegions = { "westus2" }, + }, + }; + ArmOperation lro = await fleetspaceResource.UpdateAsync(WaitUntil.Completed, patch); + FleetspaceResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + FleetspaceResourceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } +} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_FleetspaceResourceCollection.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_FleetspaceResourceCollection.cs new file mode 100644 index 000000000000..e2acd8c7d425 --- /dev/null +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_FleetspaceResourceCollection.cs @@ -0,0 +1,207 @@ +// 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.CosmosDB.Models; +using NUnit.Framework; + +namespace Azure.ResourceManager.CosmosDB.Samples +{ + public partial class Sample_FleetspaceResourceCollection + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task CreateOrUpdate_CosmosDBFleetspaceCreate() + { + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/fleet/CosmosDBFleetspaceCreate.json + // this example is just showing the usage of "Fleetspace_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(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this FleetResource created on azure + // for more information of creating FleetResource, please refer to the document of FleetResource + string subscriptionId = "ffffffff-ffff-ffff-ffff-ffffffffffff"; + string resourceGroupName = "rg1"; + string fleetName = "fleet1"; + ResourceIdentifier fleetResourceId = FleetResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, fleetName); + FleetResource fleetResource = client.GetFleetResource(fleetResourceId); + + // get the collection of this FleetspaceResource + FleetspaceResourceCollection collection = fleetResource.GetFleetspaceResources(); + + // invoke the operation + string fleetspaceName = "fleetspace1"; + FleetspaceResourceData data = new FleetspaceResourceData + { + FleetspaceApiKind = FleetspacePropertiesFleetspaceApiKind.NoSQL, + ThroughputPoolConfiguration = new FleetspacePropertiesThroughputPoolConfiguration + { + MinThroughput = 100000, + MaxThroughput = 500000, + ServiceTier = FleetspacePropertiesThroughputPoolConfigurationServiceTier.GeneralPurpose, + DataRegions = { "westus2" }, + }, + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, fleetspaceName, data); + FleetspaceResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + FleetspaceResourceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_CosmosDBFleetspaceGet() + { + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/fleet/CosmosDBFleetspaceGet.json + // this example is just showing the usage of "Fleetspace_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this FleetResource created on azure + // for more information of creating FleetResource, please refer to the document of FleetResource + string subscriptionId = "ffffffff-ffff-ffff-ffff-ffffffffffff"; + string resourceGroupName = "rg1"; + string fleetName = "fleet1"; + ResourceIdentifier fleetResourceId = FleetResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, fleetName); + FleetResource fleetResource = client.GetFleetResource(fleetResourceId); + + // get the collection of this FleetspaceResource + FleetspaceResourceCollection collection = fleetResource.GetFleetspaceResources(); + + // invoke the operation + string fleetspaceName = "fleetspace1"; + FleetspaceResource result = await collection.GetAsync(fleetspaceName); + + // 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 + FleetspaceResourceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetAll_CosmosDBFleetspaceList() + { + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/fleet/CosmosDBFleetspaceList.json + // this example is just showing the usage of "Fleetspace_List" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this FleetResource created on azure + // for more information of creating FleetResource, please refer to the document of FleetResource + string subscriptionId = "ffffffff-ffff-ffff-ffff-ffffffffffff"; + string resourceGroupName = "rg1"; + string fleetName = "fleet1"; + ResourceIdentifier fleetResourceId = FleetResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, fleetName); + FleetResource fleetResource = client.GetFleetResource(fleetResourceId); + + // get the collection of this FleetspaceResource + FleetspaceResourceCollection collection = fleetResource.GetFleetspaceResources(); + + // invoke the operation and iterate over the result + await foreach (FleetspaceResource item in collection.GetAllAsync()) + { + // the variable item is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + FleetspaceResourceData resourceData = item.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Exists_CosmosDBFleetspaceGet() + { + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/fleet/CosmosDBFleetspaceGet.json + // this example is just showing the usage of "Fleetspace_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this FleetResource created on azure + // for more information of creating FleetResource, please refer to the document of FleetResource + string subscriptionId = "ffffffff-ffff-ffff-ffff-ffffffffffff"; + string resourceGroupName = "rg1"; + string fleetName = "fleet1"; + ResourceIdentifier fleetResourceId = FleetResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, fleetName); + FleetResource fleetResource = client.GetFleetResource(fleetResourceId); + + // get the collection of this FleetspaceResource + FleetspaceResourceCollection collection = fleetResource.GetFleetspaceResources(); + + // invoke the operation + string fleetspaceName = "fleetspace1"; + bool result = await collection.ExistsAsync(fleetspaceName); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetIfExists_CosmosDBFleetspaceGet() + { + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/fleet/CosmosDBFleetspaceGet.json + // this example is just showing the usage of "Fleetspace_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this FleetResource created on azure + // for more information of creating FleetResource, please refer to the document of FleetResource + string subscriptionId = "ffffffff-ffff-ffff-ffff-ffffffffffff"; + string resourceGroupName = "rg1"; + string fleetName = "fleet1"; + ResourceIdentifier fleetResourceId = FleetResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, fleetName); + FleetResource fleetResource = client.GetFleetResource(fleetResourceId); + + // get the collection of this FleetspaceResource + FleetspaceResourceCollection collection = fleetResource.GetFleetspaceResources(); + + // invoke the operation + string fleetspaceName = "fleetspace1"; + NullableResponse response = await collection.GetIfExistsAsync(fleetspaceName); + FleetspaceResource result = response.HasValue ? response.Value : null; + + if (result == null) + { + Console.WriteLine("Succeeded with null as result"); + } + else + { + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + FleetspaceResourceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + } +} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_GraphResourceGetResultCollection.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_GraphResourceGetResultCollection.cs index 6b3d70b7cc88..d4c7b85ec07a 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_GraphResourceGetResultCollection.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_GraphResourceGetResultCollection.cs @@ -21,7 +21,7 @@ public partial class Sample_GraphResourceGetResultCollection [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_CosmosDBGraphCreateUpdate() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBGraphResourceCreateUpdate.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/CosmosDBGraphResourceCreateUpdate.json // this example is just showing the usage of "GraphResources_CreateUpdateGraph" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -64,7 +64,7 @@ public async Task CreateOrUpdate_CosmosDBGraphCreateUpdate() [Ignore("Only validating compilation of examples")] public async Task Get_CosmosDBSqlDatabaseGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBGraphResourceGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/CosmosDBGraphResourceGet.json // this example is just showing the usage of "GraphResources_GetGraph" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -98,7 +98,7 @@ public async Task Get_CosmosDBSqlDatabaseGet() [Ignore("Only validating compilation of examples")] public async Task GetAll_CosmosDBSqlDatabaseList() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBGraphResourceList.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/CosmosDBGraphResourceList.json // this example is just showing the usage of "GraphResources_ListGraphs" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -134,7 +134,7 @@ public async Task GetAll_CosmosDBSqlDatabaseList() [Ignore("Only validating compilation of examples")] public async Task Exists_CosmosDBSqlDatabaseGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBGraphResourceGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/CosmosDBGraphResourceGet.json // this example is just showing the usage of "GraphResources_GetGraph" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -164,7 +164,7 @@ public async Task Exists_CosmosDBSqlDatabaseGet() [Ignore("Only validating compilation of examples")] public async Task GetIfExists_CosmosDBSqlDatabaseGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBGraphResourceGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/CosmosDBGraphResourceGet.json // this example is just showing the usage of "GraphResources_GetGraph" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_GraphResourceGetResultResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_GraphResourceGetResultResource.cs index a83c386b197b..3d982791bd4f 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_GraphResourceGetResultResource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_GraphResourceGetResultResource.cs @@ -21,7 +21,7 @@ public partial class Sample_GraphResourceGetResultResource [Ignore("Only validating compilation of examples")] public async Task Get_CosmosDBSqlDatabaseGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBGraphResourceGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/CosmosDBGraphResourceGet.json // this example is just showing the usage of "GraphResources_GetGraph" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -52,7 +52,7 @@ public async Task Get_CosmosDBSqlDatabaseGet() [Ignore("Only validating compilation of examples")] public async Task Delete_CosmosDBSqlDatabaseDelete() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBGraphResourceDelete.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/CosmosDBGraphResourceDelete.json // this example is just showing the usage of "GraphResources_DeleteGraphResource" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -79,7 +79,7 @@ public async Task Delete_CosmosDBSqlDatabaseDelete() [Ignore("Only validating compilation of examples")] public async Task Update_CosmosDBGraphCreateUpdate() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBGraphResourceCreateUpdate.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/CosmosDBGraphResourceCreateUpdate.json // this example is just showing the usage of "GraphResources_CreateUpdateGraph" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_GremlinDatabaseCollection.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_GremlinDatabaseCollection.cs index bf6dc36a5acb..3b608eac7144 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_GremlinDatabaseCollection.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_GremlinDatabaseCollection.cs @@ -20,7 +20,7 @@ public partial class Sample_GremlinDatabaseCollection [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_CosmosDBGremlinDatabaseCreateUpdate() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBGremlinDatabaseCreateUpdate.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/CosmosDBGremlinDatabaseCreateUpdate.json // this example is just showing the usage of "GremlinResources_CreateUpdateGremlinDatabase" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -60,7 +60,7 @@ public async Task CreateOrUpdate_CosmosDBGremlinDatabaseCreateUpdate() [Ignore("Only validating compilation of examples")] public async Task Get_CosmosDBGremlinDatabaseGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBGremlinDatabaseGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/CosmosDBGremlinDatabaseGet.json // this example is just showing the usage of "GremlinResources_GetGremlinDatabase" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -94,7 +94,7 @@ public async Task Get_CosmosDBGremlinDatabaseGet() [Ignore("Only validating compilation of examples")] public async Task GetAll_CosmosDBGremlinDatabaseList() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBGremlinDatabaseList.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/CosmosDBGremlinDatabaseList.json // this example is just showing the usage of "GremlinResources_ListGremlinDatabases" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -130,7 +130,7 @@ public async Task GetAll_CosmosDBGremlinDatabaseList() [Ignore("Only validating compilation of examples")] public async Task Exists_CosmosDBGremlinDatabaseGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBGremlinDatabaseGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/CosmosDBGremlinDatabaseGet.json // this example is just showing the usage of "GremlinResources_GetGremlinDatabase" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -160,7 +160,7 @@ public async Task Exists_CosmosDBGremlinDatabaseGet() [Ignore("Only validating compilation of examples")] public async Task GetIfExists_CosmosDBGremlinDatabaseGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBGremlinDatabaseGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/CosmosDBGremlinDatabaseGet.json // this example is just showing the usage of "GremlinResources_GetGremlinDatabase" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_GremlinDatabaseResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_GremlinDatabaseResource.cs index 461f35873636..1b0e2251b254 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_GremlinDatabaseResource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_GremlinDatabaseResource.cs @@ -20,7 +20,7 @@ public partial class Sample_GremlinDatabaseResource [Ignore("Only validating compilation of examples")] public async Task Get_CosmosDBGremlinDatabaseGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBGremlinDatabaseGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/CosmosDBGremlinDatabaseGet.json // this example is just showing the usage of "GremlinResources_GetGremlinDatabase" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -51,7 +51,7 @@ public async Task Get_CosmosDBGremlinDatabaseGet() [Ignore("Only validating compilation of examples")] public async Task Delete_CosmosDBGremlinDatabaseDelete() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBGremlinDatabaseDelete.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/CosmosDBGremlinDatabaseDelete.json // this example is just showing the usage of "GremlinResources_DeleteGremlinDatabase" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -78,7 +78,7 @@ public async Task Delete_CosmosDBGremlinDatabaseDelete() [Ignore("Only validating compilation of examples")] public async Task Update_CosmosDBGremlinDatabaseCreateUpdate() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBGremlinDatabaseCreateUpdate.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/CosmosDBGremlinDatabaseCreateUpdate.json // this example is just showing the usage of "GremlinResources_CreateUpdateGremlinDatabase" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_GremlinDatabaseThroughputSettingResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_GremlinDatabaseThroughputSettingResource.cs index 8b42068668db..535f865aae07 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_GremlinDatabaseThroughputSettingResource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_GremlinDatabaseThroughputSettingResource.cs @@ -20,7 +20,7 @@ public partial class Sample_GremlinDatabaseThroughputSettingResource [Ignore("Only validating compilation of examples")] public async Task Get_CosmosDBGremlinDatabaseThroughputGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBGremlinDatabaseThroughputGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/CosmosDBGremlinDatabaseThroughputGet.json // this example is just showing the usage of "GremlinResources_GetGremlinDatabaseThroughput" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -51,7 +51,7 @@ public async Task Get_CosmosDBGremlinDatabaseThroughputGet() [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_CosmosDBGremlinDatabaseThroughputUpdate() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBGremlinDatabaseThroughputUpdate.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/CosmosDBGremlinDatabaseThroughputUpdate.json // this example is just showing the usage of "GremlinResources_UpdateGremlinDatabaseThroughput" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -90,7 +90,7 @@ public async Task CreateOrUpdate_CosmosDBGremlinDatabaseThroughputUpdate() [Ignore("Only validating compilation of examples")] public async Task MigrateGremlinDatabaseToAutoscale_CosmosDBGremlinDatabaseMigrateToAutoscale() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBGremlinDatabaseMigrateToAutoscale.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/CosmosDBGremlinDatabaseMigrateToAutoscale.json // this example is just showing the usage of "GremlinResources_MigrateGremlinDatabaseToAutoscale" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -122,7 +122,7 @@ public async Task MigrateGremlinDatabaseToAutoscale_CosmosDBGremlinDatabaseMigra [Ignore("Only validating compilation of examples")] public async Task MigrateGremlinDatabaseToManualThroughput_CosmosDBGremlinDatabaseMigrateToManualThroughput() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBGremlinDatabaseMigrateToManualThroughput.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/CosmosDBGremlinDatabaseMigrateToManualThroughput.json // this example is just showing the usage of "GremlinResources_MigrateGremlinDatabaseToManualThroughput" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_GremlinGraphCollection.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_GremlinGraphCollection.cs index dbf30aa4c0d8..772d9219275d 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_GremlinGraphCollection.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_GremlinGraphCollection.cs @@ -20,7 +20,7 @@ public partial class Sample_GremlinGraphCollection [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_CosmosDBGremlinGraphCreateUpdate() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBGremlinGraphCreateUpdate.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/CosmosDBGremlinGraphCreateUpdate.json // this example is just showing the usage of "GremlinResources_CreateUpdateGremlinGraph" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -99,7 +99,7 @@ public async Task CreateOrUpdate_CosmosDBGremlinGraphCreateUpdate() [Ignore("Only validating compilation of examples")] public async Task Get_CosmosDBGremlinGraphGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBGremlinGraphGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/CosmosDBGremlinGraphGet.json // this example is just showing the usage of "GremlinResources_GetGremlinGraph" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -134,7 +134,7 @@ public async Task Get_CosmosDBGremlinGraphGet() [Ignore("Only validating compilation of examples")] public async Task GetAll_CosmosDBGremlinGraphList() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBGremlinGraphList.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/CosmosDBGremlinGraphList.json // this example is just showing the usage of "GremlinResources_ListGremlinGraphs" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -171,7 +171,7 @@ public async Task GetAll_CosmosDBGremlinGraphList() [Ignore("Only validating compilation of examples")] public async Task Exists_CosmosDBGremlinGraphGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBGremlinGraphGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/CosmosDBGremlinGraphGet.json // this example is just showing the usage of "GremlinResources_GetGremlinGraph" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -202,7 +202,7 @@ public async Task Exists_CosmosDBGremlinGraphGet() [Ignore("Only validating compilation of examples")] public async Task GetIfExists_CosmosDBGremlinGraphGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBGremlinGraphGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/CosmosDBGremlinGraphGet.json // this example is just showing the usage of "GremlinResources_GetGremlinGraph" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_GremlinGraphResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_GremlinGraphResource.cs index d143117bd4f6..38634abff59f 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_GremlinGraphResource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_GremlinGraphResource.cs @@ -20,7 +20,7 @@ public partial class Sample_GremlinGraphResource [Ignore("Only validating compilation of examples")] public async Task Get_CosmosDBGremlinGraphGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBGremlinGraphGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/CosmosDBGremlinGraphGet.json // this example is just showing the usage of "GremlinResources_GetGremlinGraph" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -52,7 +52,7 @@ public async Task Get_CosmosDBGremlinGraphGet() [Ignore("Only validating compilation of examples")] public async Task Delete_CosmosDBGremlinGraphDelete() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBGremlinGraphDelete.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/CosmosDBGremlinGraphDelete.json // this example is just showing the usage of "GremlinResources_DeleteGremlinGraph" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -80,7 +80,7 @@ public async Task Delete_CosmosDBGremlinGraphDelete() [Ignore("Only validating compilation of examples")] public async Task Update_CosmosDBGremlinGraphCreateUpdate() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBGremlinGraphCreateUpdate.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/CosmosDBGremlinGraphCreateUpdate.json // this example is just showing the usage of "GremlinResources_CreateUpdateGremlinGraph" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -156,7 +156,7 @@ public async Task Update_CosmosDBGremlinGraphCreateUpdate() [Ignore("Only validating compilation of examples")] public async Task RetrieveContinuousBackupInformation_CosmosDBGremlinGraphBackupInformation() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBGremlinGraphBackupInformation.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/CosmosDBGremlinGraphBackupInformation.json // this example is just showing the usage of "GremlinResources_RetrieveContinuousBackupInformation" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_GremlinGraphThroughputSettingResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_GremlinGraphThroughputSettingResource.cs index 25dee4b7a9b8..90f170b408dc 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_GremlinGraphThroughputSettingResource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_GremlinGraphThroughputSettingResource.cs @@ -20,7 +20,7 @@ public partial class Sample_GremlinGraphThroughputSettingResource [Ignore("Only validating compilation of examples")] public async Task Get_CosmosDBGremlinGraphThroughputGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBGremlinGraphThroughputGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/CosmosDBGremlinGraphThroughputGet.json // this example is just showing the usage of "GremlinResources_GetGremlinGraphThroughput" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -52,7 +52,7 @@ public async Task Get_CosmosDBGremlinGraphThroughputGet() [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_CosmosDBGremlinGraphThroughputUpdate() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBGremlinGraphThroughputUpdate.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/CosmosDBGremlinGraphThroughputUpdate.json // this example is just showing the usage of "GremlinResources_UpdateGremlinGraphThroughput" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -92,7 +92,7 @@ public async Task CreateOrUpdate_CosmosDBGremlinGraphThroughputUpdate() [Ignore("Only validating compilation of examples")] public async Task MigrateGremlinGraphToAutoscale_CosmosDBGremlinGraphMigrateToAutoscale() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBGremlinGraphMigrateToAutoscale.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/CosmosDBGremlinGraphMigrateToAutoscale.json // this example is just showing the usage of "GremlinResources_MigrateGremlinGraphToAutoscale" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -125,7 +125,7 @@ public async Task MigrateGremlinGraphToAutoscale_CosmosDBGremlinGraphMigrateToAu [Ignore("Only validating compilation of examples")] public async Task MigrateGremlinGraphToManualThroughput_CosmosDBGremlinGraphMigrateToManualThroughput() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBGremlinGraphMigrateToManualThroughput.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/CosmosDBGremlinGraphMigrateToManualThroughput.json // this example is just showing the usage of "GremlinResources_MigrateGremlinGraphToManualThroughput" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_GremlinRoleAssignmentResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_GremlinRoleAssignmentResource.cs new file mode 100644 index 000000000000..ed29c41c9c8a --- /dev/null +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_GremlinRoleAssignmentResource.cs @@ -0,0 +1,114 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using NUnit.Framework; + +namespace Azure.ResourceManager.CosmosDB.Samples +{ + public partial class Sample_GremlinRoleAssignmentResource + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_CosmosDBGremlinRoleAssignmentGet() + { + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/gremlinrbac/CosmosDBGremlinRoleAssignmentGet.json + // this example is just showing the usage of "GremlinResources_GetGremlinRoleAssignment" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details 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 GremlinRoleAssignmentResource created on azure + // for more information of creating GremlinRoleAssignmentResource, please refer to the document of GremlinRoleAssignmentResource + string subscriptionId = "ffffffff-ffff-ffff-ffff-ffffffffffff"; + string resourceGroupName = "myResourceGroupName"; + string accountName = "myAccountName"; + string roleAssignmentId = "myRoleAssignmentId"; + ResourceIdentifier gremlinRoleAssignmentResourceId = GremlinRoleAssignmentResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName, roleAssignmentId); + GremlinRoleAssignmentResource gremlinRoleAssignmentResource = client.GetGremlinRoleAssignmentResource(gremlinRoleAssignmentResourceId); + + // invoke the operation + GremlinRoleAssignmentResource result = await gremlinRoleAssignmentResource.GetAsync(); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + GremlinRoleAssignmentResourceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Delete_CosmosDBGremlinRoleAssignmentDelete() + { + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/gremlinrbac/CosmosDBGremlinRoleAssignmentDelete.json + // this example is just showing the usage of "GremlinResources_DeleteGremlinRoleAssignment" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details 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 GremlinRoleAssignmentResource created on azure + // for more information of creating GremlinRoleAssignmentResource, please refer to the document of GremlinRoleAssignmentResource + string subscriptionId = "ffffffff-ffff-ffff-ffff-ffffffffffff"; + string resourceGroupName = "myResourceGroupName"; + string accountName = "myAccountName"; + string roleAssignmentId = "myRoleAssignmentId"; + ResourceIdentifier gremlinRoleAssignmentResourceId = GremlinRoleAssignmentResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName, roleAssignmentId); + GremlinRoleAssignmentResource gremlinRoleAssignmentResource = client.GetGremlinRoleAssignmentResource(gremlinRoleAssignmentResourceId); + + // invoke the operation + await gremlinRoleAssignmentResource.DeleteAsync(WaitUntil.Completed); + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Update_CosmosDBGremlinRoleAssignmentCreateUpdate() + { + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/gremlinrbac/CosmosDBGremlinRoleAssignmentCreateUpdate.json + // this example is just showing the usage of "GremlinResources_CreateUpdateGremlinRoleAssignment" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details 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 GremlinRoleAssignmentResource created on azure + // for more information of creating GremlinRoleAssignmentResource, please refer to the document of GremlinRoleAssignmentResource + string subscriptionId = "ffffffff-ffff-ffff-ffff-ffffffffffff"; + string resourceGroupName = "myResourceGroupName"; + string accountName = "myAccountName"; + string roleAssignmentId = "myRoleAssignmentId"; + ResourceIdentifier gremlinRoleAssignmentResourceId = GremlinRoleAssignmentResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName, roleAssignmentId); + GremlinRoleAssignmentResource gremlinRoleAssignmentResource = client.GetGremlinRoleAssignmentResource(gremlinRoleAssignmentResourceId); + + // invoke the operation + GremlinRoleAssignmentResourceData data = new GremlinRoleAssignmentResourceData + { + RoleDefinitionId = "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/myResourceGroupName/providers/Microsoft.DocumentDB/databaseAccounts/myAccountName/gremlinRoleDefinitions/myRoleDefinitionId", + Scope = "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/myResourceGroupName/providers/Microsoft.DocumentDB/databaseAccounts/myAccountName/dbs/purchases/colls/redmond-purchases", + PrincipalId = Guid.Parse("myPrincipalId"), + }; + ArmOperation lro = await gremlinRoleAssignmentResource.UpdateAsync(WaitUntil.Completed, data); + GremlinRoleAssignmentResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + GremlinRoleAssignmentResourceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } +} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_GremlinRoleAssignmentResourceCollection.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_GremlinRoleAssignmentResourceCollection.cs new file mode 100644 index 000000000000..308b16739333 --- /dev/null +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_GremlinRoleAssignmentResourceCollection.cs @@ -0,0 +1,201 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using NUnit.Framework; + +namespace Azure.ResourceManager.CosmosDB.Samples +{ + public partial class Sample_GremlinRoleAssignmentResourceCollection + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task CreateOrUpdate_CosmosDBGremlinRoleAssignmentCreateUpdate() + { + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/gremlinrbac/CosmosDBGremlinRoleAssignmentCreateUpdate.json + // this example is just showing the usage of "GremlinResources_CreateUpdateGremlinRoleAssignment" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details 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 CosmosDBAccountResource created on azure + // for more information of creating CosmosDBAccountResource, please refer to the document of CosmosDBAccountResource + string subscriptionId = "ffffffff-ffff-ffff-ffff-ffffffffffff"; + string resourceGroupName = "myResourceGroupName"; + string accountName = "myAccountName"; + ResourceIdentifier cosmosDBAccountResourceId = CosmosDBAccountResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName); + CosmosDBAccountResource cosmosDBAccount = client.GetCosmosDBAccountResource(cosmosDBAccountResourceId); + + // get the collection of this GremlinRoleAssignmentResource + GremlinRoleAssignmentResourceCollection collection = cosmosDBAccount.GetGremlinRoleAssignmentResources(); + + // invoke the operation + string roleAssignmentId = "myRoleAssignmentId"; + GremlinRoleAssignmentResourceData data = new GremlinRoleAssignmentResourceData + { + RoleDefinitionId = "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/myResourceGroupName/providers/Microsoft.DocumentDB/databaseAccounts/myAccountName/gremlinRoleDefinitions/myRoleDefinitionId", + Scope = "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/myResourceGroupName/providers/Microsoft.DocumentDB/databaseAccounts/myAccountName/dbs/purchases/colls/redmond-purchases", + PrincipalId = Guid.Parse("myPrincipalId"), + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, roleAssignmentId, data); + GremlinRoleAssignmentResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + GremlinRoleAssignmentResourceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_CosmosDBGremlinRoleAssignmentGet() + { + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/gremlinrbac/CosmosDBGremlinRoleAssignmentGet.json + // this example is just showing the usage of "GremlinResources_GetGremlinRoleAssignment" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details 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 CosmosDBAccountResource created on azure + // for more information of creating CosmosDBAccountResource, please refer to the document of CosmosDBAccountResource + string subscriptionId = "ffffffff-ffff-ffff-ffff-ffffffffffff"; + string resourceGroupName = "myResourceGroupName"; + string accountName = "myAccountName"; + ResourceIdentifier cosmosDBAccountResourceId = CosmosDBAccountResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName); + CosmosDBAccountResource cosmosDBAccount = client.GetCosmosDBAccountResource(cosmosDBAccountResourceId); + + // get the collection of this GremlinRoleAssignmentResource + GremlinRoleAssignmentResourceCollection collection = cosmosDBAccount.GetGremlinRoleAssignmentResources(); + + // invoke the operation + string roleAssignmentId = "myRoleAssignmentId"; + GremlinRoleAssignmentResource result = await collection.GetAsync(roleAssignmentId); + + // 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 + GremlinRoleAssignmentResourceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetAll_CosmosDBGremlinRoleAssignmentList() + { + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/gremlinrbac/CosmosDBGremlinRoleAssignmentList.json + // this example is just showing the usage of "GremlinResources_ListGremlinRoleAssignments" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details 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 CosmosDBAccountResource created on azure + // for more information of creating CosmosDBAccountResource, please refer to the document of CosmosDBAccountResource + string subscriptionId = "ffffffff-ffff-ffff-ffff-ffffffffffff"; + string resourceGroupName = "myResourceGroupName"; + string accountName = "myAccountName"; + ResourceIdentifier cosmosDBAccountResourceId = CosmosDBAccountResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName); + CosmosDBAccountResource cosmosDBAccount = client.GetCosmosDBAccountResource(cosmosDBAccountResourceId); + + // get the collection of this GremlinRoleAssignmentResource + GremlinRoleAssignmentResourceCollection collection = cosmosDBAccount.GetGremlinRoleAssignmentResources(); + + // invoke the operation and iterate over the result + await foreach (GremlinRoleAssignmentResource item in collection.GetAllAsync()) + { + // the variable item is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + GremlinRoleAssignmentResourceData resourceData = item.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Exists_CosmosDBGremlinRoleAssignmentGet() + { + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/gremlinrbac/CosmosDBGremlinRoleAssignmentGet.json + // this example is just showing the usage of "GremlinResources_GetGremlinRoleAssignment" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details 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 CosmosDBAccountResource created on azure + // for more information of creating CosmosDBAccountResource, please refer to the document of CosmosDBAccountResource + string subscriptionId = "ffffffff-ffff-ffff-ffff-ffffffffffff"; + string resourceGroupName = "myResourceGroupName"; + string accountName = "myAccountName"; + ResourceIdentifier cosmosDBAccountResourceId = CosmosDBAccountResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName); + CosmosDBAccountResource cosmosDBAccount = client.GetCosmosDBAccountResource(cosmosDBAccountResourceId); + + // get the collection of this GremlinRoleAssignmentResource + GremlinRoleAssignmentResourceCollection collection = cosmosDBAccount.GetGremlinRoleAssignmentResources(); + + // invoke the operation + string roleAssignmentId = "myRoleAssignmentId"; + bool result = await collection.ExistsAsync(roleAssignmentId); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetIfExists_CosmosDBGremlinRoleAssignmentGet() + { + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/gremlinrbac/CosmosDBGremlinRoleAssignmentGet.json + // this example is just showing the usage of "GremlinResources_GetGremlinRoleAssignment" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details 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 CosmosDBAccountResource created on azure + // for more information of creating CosmosDBAccountResource, please refer to the document of CosmosDBAccountResource + string subscriptionId = "ffffffff-ffff-ffff-ffff-ffffffffffff"; + string resourceGroupName = "myResourceGroupName"; + string accountName = "myAccountName"; + ResourceIdentifier cosmosDBAccountResourceId = CosmosDBAccountResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName); + CosmosDBAccountResource cosmosDBAccount = client.GetCosmosDBAccountResource(cosmosDBAccountResourceId); + + // get the collection of this GremlinRoleAssignmentResource + GremlinRoleAssignmentResourceCollection collection = cosmosDBAccount.GetGremlinRoleAssignmentResources(); + + // invoke the operation + string roleAssignmentId = "myRoleAssignmentId"; + NullableResponse response = await collection.GetIfExistsAsync(roleAssignmentId); + GremlinRoleAssignmentResource result = response.HasValue ? response.Value : null; + + if (result == null) + { + Console.WriteLine("Succeeded with null as result"); + } + else + { + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + GremlinRoleAssignmentResourceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + } +} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_GremlinRoleDefinitionResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_GremlinRoleDefinitionResource.cs new file mode 100644 index 000000000000..2fab3e33760e --- /dev/null +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_GremlinRoleDefinitionResource.cs @@ -0,0 +1,120 @@ +// 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.CosmosDB.Models; +using NUnit.Framework; + +namespace Azure.ResourceManager.CosmosDB.Samples +{ + public partial class Sample_GremlinRoleDefinitionResource + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_CosmosDBGremlinRoleDefinitionGet() + { + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/gremlinrbac/CosmosDBGremlinRoleDefinitionGet.json + // this example is just showing the usage of "GremlinResources_GetGremlinRoleDefinition" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details 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 GremlinRoleDefinitionResource created on azure + // for more information of creating GremlinRoleDefinitionResource, please refer to the document of GremlinRoleDefinitionResource + string subscriptionId = "ffffffff-ffff-ffff-ffff-ffffffffffff"; + string resourceGroupName = "myResourceGroupName"; + string accountName = "myAccountName"; + string roleDefinitionId = "myRoleDefinitionId"; + ResourceIdentifier gremlinRoleDefinitionResourceId = GremlinRoleDefinitionResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName, roleDefinitionId); + GremlinRoleDefinitionResource gremlinRoleDefinitionResource = client.GetGremlinRoleDefinitionResource(gremlinRoleDefinitionResourceId); + + // invoke the operation + GremlinRoleDefinitionResource result = await gremlinRoleDefinitionResource.GetAsync(); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + GremlinRoleDefinitionResourceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Delete_CosmosDBGremlinRoleDefinitionDelete() + { + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/gremlinrbac/CosmosDBGremlinRoleDefinitionDelete.json + // this example is just showing the usage of "GremlinResources_DeleteGremlinRoleDefinition" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details 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 GremlinRoleDefinitionResource created on azure + // for more information of creating GremlinRoleDefinitionResource, please refer to the document of GremlinRoleDefinitionResource + string subscriptionId = "ffffffff-ffff-ffff-ffff-ffffffffffff"; + string resourceGroupName = "myResourceGroupName"; + string accountName = "myAccountName"; + string roleDefinitionId = "myRoleDefinitionId"; + ResourceIdentifier gremlinRoleDefinitionResourceId = GremlinRoleDefinitionResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName, roleDefinitionId); + GremlinRoleDefinitionResource gremlinRoleDefinitionResource = client.GetGremlinRoleDefinitionResource(gremlinRoleDefinitionResourceId); + + // invoke the operation + await gremlinRoleDefinitionResource.DeleteAsync(WaitUntil.Completed); + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Update_CosmosDBGremlinRoleDefinitionCreateUpdate() + { + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/gremlinrbac/CosmosDBGremlinRoleDefinitionCreateUpdate.json + // this example is just showing the usage of "GremlinResources_CreateUpdateGremlinRoleDefinition" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details 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 GremlinRoleDefinitionResource created on azure + // for more information of creating GremlinRoleDefinitionResource, please refer to the document of GremlinRoleDefinitionResource + string subscriptionId = "ffffffff-ffff-ffff-ffff-ffffffffffff"; + string resourceGroupName = "myResourceGroupName"; + string accountName = "myAccountName"; + string roleDefinitionId = "myRoleDefinitionId"; + ResourceIdentifier gremlinRoleDefinitionResourceId = GremlinRoleDefinitionResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName, roleDefinitionId); + GremlinRoleDefinitionResource gremlinRoleDefinitionResource = client.GetGremlinRoleDefinitionResource(gremlinRoleDefinitionResourceId); + + // invoke the operation + GremlinRoleDefinitionResourceData data = new GremlinRoleDefinitionResourceData + { + RoleName = "myRoleName", + TypePropertiesType = CosmosDBSqlRoleDefinitionType.CustomRole, + AssignableScopes = { "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/myResourceGroupName/providers/Microsoft.DocumentDB/databaseAccounts/myAccountName/dbs/sales", "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/myResourceGroupName/providers/Microsoft.DocumentDB/databaseAccounts/myAccountName/dbs/purchases" }, + Permissions = {new Permission +{ +DataActions = {"Microsoft.DocumentDB/databaseAccounts/gremlinDatabases/containers/entities/create", "Microsoft.DocumentDB/databaseAccounts/gremlinDatabases/containers/entities/read"}, +NotDataActions = {}, +}}, + }; + ArmOperation lro = await gremlinRoleDefinitionResource.UpdateAsync(WaitUntil.Completed, data); + GremlinRoleDefinitionResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + GremlinRoleDefinitionResourceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } +} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_GremlinRoleDefinitionResourceCollection.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_GremlinRoleDefinitionResourceCollection.cs new file mode 100644 index 000000000000..78d76a4dc260 --- /dev/null +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_GremlinRoleDefinitionResourceCollection.cs @@ -0,0 +1,207 @@ +// 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.CosmosDB.Models; +using NUnit.Framework; + +namespace Azure.ResourceManager.CosmosDB.Samples +{ + public partial class Sample_GremlinRoleDefinitionResourceCollection + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task CreateOrUpdate_CosmosDBGremlinRoleDefinitionCreateUpdate() + { + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/gremlinrbac/CosmosDBGremlinRoleDefinitionCreateUpdate.json + // this example is just showing the usage of "GremlinResources_CreateUpdateGremlinRoleDefinition" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details 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 CosmosDBAccountResource created on azure + // for more information of creating CosmosDBAccountResource, please refer to the document of CosmosDBAccountResource + string subscriptionId = "ffffffff-ffff-ffff-ffff-ffffffffffff"; + string resourceGroupName = "myResourceGroupName"; + string accountName = "myAccountName"; + ResourceIdentifier cosmosDBAccountResourceId = CosmosDBAccountResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName); + CosmosDBAccountResource cosmosDBAccount = client.GetCosmosDBAccountResource(cosmosDBAccountResourceId); + + // get the collection of this GremlinRoleDefinitionResource + GremlinRoleDefinitionResourceCollection collection = cosmosDBAccount.GetGremlinRoleDefinitionResources(); + + // invoke the operation + string roleDefinitionId = "myRoleDefinitionId"; + GremlinRoleDefinitionResourceData data = new GremlinRoleDefinitionResourceData + { + RoleName = "myRoleName", + TypePropertiesType = CosmosDBSqlRoleDefinitionType.CustomRole, + AssignableScopes = { "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/myResourceGroupName/providers/Microsoft.DocumentDB/databaseAccounts/myAccountName/dbs/sales", "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/myResourceGroupName/providers/Microsoft.DocumentDB/databaseAccounts/myAccountName/dbs/purchases" }, + Permissions = {new Permission +{ +DataActions = {"Microsoft.DocumentDB/databaseAccounts/gremlinDatabases/containers/entities/create", "Microsoft.DocumentDB/databaseAccounts/gremlinDatabases/containers/entities/read"}, +NotDataActions = {}, +}}, + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, roleDefinitionId, data); + GremlinRoleDefinitionResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + GremlinRoleDefinitionResourceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_CosmosDBGremlinRoleDefinitionGet() + { + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/gremlinrbac/CosmosDBGremlinRoleDefinitionGet.json + // this example is just showing the usage of "GremlinResources_GetGremlinRoleDefinition" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details 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 CosmosDBAccountResource created on azure + // for more information of creating CosmosDBAccountResource, please refer to the document of CosmosDBAccountResource + string subscriptionId = "ffffffff-ffff-ffff-ffff-ffffffffffff"; + string resourceGroupName = "myResourceGroupName"; + string accountName = "myAccountName"; + ResourceIdentifier cosmosDBAccountResourceId = CosmosDBAccountResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName); + CosmosDBAccountResource cosmosDBAccount = client.GetCosmosDBAccountResource(cosmosDBAccountResourceId); + + // get the collection of this GremlinRoleDefinitionResource + GremlinRoleDefinitionResourceCollection collection = cosmosDBAccount.GetGremlinRoleDefinitionResources(); + + // invoke the operation + string roleDefinitionId = "myRoleDefinitionId"; + GremlinRoleDefinitionResource result = await collection.GetAsync(roleDefinitionId); + + // 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 + GremlinRoleDefinitionResourceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetAll_CosmosDBGremlinRoleDefinitionList() + { + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/gremlinrbac/CosmosDBGremlinRoleDefinitionList.json + // this example is just showing the usage of "GremlinResources_ListGremlinRoleDefinitions" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details 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 CosmosDBAccountResource created on azure + // for more information of creating CosmosDBAccountResource, please refer to the document of CosmosDBAccountResource + string subscriptionId = "ffffffff-ffff-ffff-ffff-ffffffffffff"; + string resourceGroupName = "myResourceGroupName"; + string accountName = "myAccountName"; + ResourceIdentifier cosmosDBAccountResourceId = CosmosDBAccountResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName); + CosmosDBAccountResource cosmosDBAccount = client.GetCosmosDBAccountResource(cosmosDBAccountResourceId); + + // get the collection of this GremlinRoleDefinitionResource + GremlinRoleDefinitionResourceCollection collection = cosmosDBAccount.GetGremlinRoleDefinitionResources(); + + // invoke the operation and iterate over the result + await foreach (GremlinRoleDefinitionResource item in collection.GetAllAsync()) + { + // the variable item is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + GremlinRoleDefinitionResourceData resourceData = item.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Exists_CosmosDBGremlinRoleDefinitionGet() + { + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/gremlinrbac/CosmosDBGremlinRoleDefinitionGet.json + // this example is just showing the usage of "GremlinResources_GetGremlinRoleDefinition" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details 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 CosmosDBAccountResource created on azure + // for more information of creating CosmosDBAccountResource, please refer to the document of CosmosDBAccountResource + string subscriptionId = "ffffffff-ffff-ffff-ffff-ffffffffffff"; + string resourceGroupName = "myResourceGroupName"; + string accountName = "myAccountName"; + ResourceIdentifier cosmosDBAccountResourceId = CosmosDBAccountResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName); + CosmosDBAccountResource cosmosDBAccount = client.GetCosmosDBAccountResource(cosmosDBAccountResourceId); + + // get the collection of this GremlinRoleDefinitionResource + GremlinRoleDefinitionResourceCollection collection = cosmosDBAccount.GetGremlinRoleDefinitionResources(); + + // invoke the operation + string roleDefinitionId = "myRoleDefinitionId"; + bool result = await collection.ExistsAsync(roleDefinitionId); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetIfExists_CosmosDBGremlinRoleDefinitionGet() + { + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/gremlinrbac/CosmosDBGremlinRoleDefinitionGet.json + // this example is just showing the usage of "GremlinResources_GetGremlinRoleDefinition" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details 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 CosmosDBAccountResource created on azure + // for more information of creating CosmosDBAccountResource, please refer to the document of CosmosDBAccountResource + string subscriptionId = "ffffffff-ffff-ffff-ffff-ffffffffffff"; + string resourceGroupName = "myResourceGroupName"; + string accountName = "myAccountName"; + ResourceIdentifier cosmosDBAccountResourceId = CosmosDBAccountResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName); + CosmosDBAccountResource cosmosDBAccount = client.GetCosmosDBAccountResource(cosmosDBAccountResourceId); + + // get the collection of this GremlinRoleDefinitionResource + GremlinRoleDefinitionResourceCollection collection = cosmosDBAccount.GetGremlinRoleDefinitionResources(); + + // invoke the operation + string roleDefinitionId = "myRoleDefinitionId"; + NullableResponse response = await collection.GetIfExistsAsync(roleDefinitionId); + GremlinRoleDefinitionResource result = response.HasValue ? response.Value : null; + + if (result == null) + { + Console.WriteLine("Succeeded with null as result"); + } + else + { + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + GremlinRoleDefinitionResourceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + } +} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_MongoDBCollectionCollection.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_MongoDBCollectionCollection.cs index 799b5f3704cb..1516e012620c 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_MongoDBCollectionCollection.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_MongoDBCollectionCollection.cs @@ -20,7 +20,7 @@ public partial class Sample_MongoDBCollectionCollection [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_CosmosDBMongoDBCollectionCreateUpdate() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBMongoDBCollectionCreateUpdate.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/CosmosDBMongoDBCollectionCreateUpdate.json // this example is just showing the usage of "MongoDBResources_CreateUpdateMongoDBCollection" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -80,7 +80,7 @@ public async Task CreateOrUpdate_CosmosDBMongoDBCollectionCreateUpdate() [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_CosmosDBMongoDBCollectionRestore() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBMongoDBCollectionRestore.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/CosmosDBMongoDBCollectionRestore.json // this example is just showing the usage of "MongoDBResources_CreateUpdateMongoDBCollection" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -130,7 +130,7 @@ public async Task CreateOrUpdate_CosmosDBMongoDBCollectionRestore() [Ignore("Only validating compilation of examples")] public async Task Get_CosmosDBMongoDBCollectionGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBMongoDBCollectionGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/CosmosDBMongoDBCollectionGet.json // this example is just showing the usage of "MongoDBResources_GetMongoDBCollection" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -165,7 +165,7 @@ public async Task Get_CosmosDBMongoDBCollectionGet() [Ignore("Only validating compilation of examples")] public async Task GetAll_CosmosDBMongoDBCollectionList() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBMongoDBCollectionList.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/CosmosDBMongoDBCollectionList.json // this example is just showing the usage of "MongoDBResources_ListMongoDBCollections" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -202,7 +202,7 @@ public async Task GetAll_CosmosDBMongoDBCollectionList() [Ignore("Only validating compilation of examples")] public async Task Exists_CosmosDBMongoDBCollectionGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBMongoDBCollectionGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/CosmosDBMongoDBCollectionGet.json // this example is just showing the usage of "MongoDBResources_GetMongoDBCollection" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -233,7 +233,7 @@ public async Task Exists_CosmosDBMongoDBCollectionGet() [Ignore("Only validating compilation of examples")] public async Task GetIfExists_CosmosDBMongoDBCollectionGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBMongoDBCollectionGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/CosmosDBMongoDBCollectionGet.json // this example is just showing the usage of "MongoDBResources_GetMongoDBCollection" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_MongoDBCollectionResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_MongoDBCollectionResource.cs index 6400feeb358e..56bc51f94837 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_MongoDBCollectionResource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_MongoDBCollectionResource.cs @@ -20,7 +20,7 @@ public partial class Sample_MongoDBCollectionResource [Ignore("Only validating compilation of examples")] public async Task Get_CosmosDBMongoDBCollectionGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBMongoDBCollectionGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/CosmosDBMongoDBCollectionGet.json // this example is just showing the usage of "MongoDBResources_GetMongoDBCollection" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -52,7 +52,7 @@ public async Task Get_CosmosDBMongoDBCollectionGet() [Ignore("Only validating compilation of examples")] public async Task Delete_CosmosDBMongoDBCollectionDelete() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBMongoDBCollectionDelete.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/CosmosDBMongoDBCollectionDelete.json // this example is just showing the usage of "MongoDBResources_DeleteMongoDBCollection" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -80,7 +80,7 @@ public async Task Delete_CosmosDBMongoDBCollectionDelete() [Ignore("Only validating compilation of examples")] public async Task Update_CosmosDBMongoDBCollectionCreateUpdate() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBMongoDBCollectionCreateUpdate.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/CosmosDBMongoDBCollectionCreateUpdate.json // this example is just showing the usage of "MongoDBResources_CreateUpdateMongoDBCollection" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -137,7 +137,7 @@ public async Task Update_CosmosDBMongoDBCollectionCreateUpdate() [Ignore("Only validating compilation of examples")] public async Task Update_CosmosDBMongoDBCollectionRestore() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBMongoDBCollectionRestore.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/CosmosDBMongoDBCollectionRestore.json // this example is just showing the usage of "MongoDBResources_CreateUpdateMongoDBCollection" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -184,7 +184,7 @@ public async Task Update_CosmosDBMongoDBCollectionRestore() [Ignore("Only validating compilation of examples")] public async Task GetMongoDBCollectionPartitionMerge_CosmosDBMongoDBCollectionPartitionMerge() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBMongoDBCollectionPartitionMerge.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/CosmosDBMongoDBCollectionPartitionMerge.json // this example is just showing the usage of "MongoDBResources_ListMongoDBCollectionPartitionMerge" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -217,7 +217,7 @@ public async Task GetMongoDBCollectionPartitionMerge_CosmosDBMongoDBCollectionPa [Ignore("Only validating compilation of examples")] public async Task RetrieveContinuousBackupInformation_CosmosDBMongoDBCollectionBackupInformation() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBMongoDBCollectionBackupInformation.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/CosmosDBMongoDBCollectionBackupInformation.json // this example is just showing the usage of "MongoDBResources_RetrieveContinuousBackupInformation" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_MongoDBCollectionThroughputSettingResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_MongoDBCollectionThroughputSettingResource.cs index d34a315a59d6..e2bdceea1228 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_MongoDBCollectionThroughputSettingResource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_MongoDBCollectionThroughputSettingResource.cs @@ -21,7 +21,7 @@ public partial class Sample_MongoDBCollectionThroughputSettingResource [Ignore("Only validating compilation of examples")] public async Task Get_CosmosDBMongoDBCollectionThroughputGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBMongoDBCollectionThroughputGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/CosmosDBMongoDBCollectionThroughputGet.json // this example is just showing the usage of "MongoDBResources_GetMongoDBCollectionThroughput" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -53,7 +53,7 @@ public async Task Get_CosmosDBMongoDBCollectionThroughputGet() [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_CosmosDBMongoDBCollectionThroughputUpdate() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBMongoDBCollectionThroughputUpdate.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/CosmosDBMongoDBCollectionThroughputUpdate.json // this example is just showing the usage of "MongoDBResources_UpdateMongoDBCollectionThroughput" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -93,7 +93,7 @@ public async Task CreateOrUpdate_CosmosDBMongoDBCollectionThroughputUpdate() [Ignore("Only validating compilation of examples")] public async Task MongoDBContainerRetrieveThroughputDistribution_CosmosDBMongoDBCollectionRetrieveThroughputDistribution() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBMongoDBCollectionRetrieveThroughputDistribution.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/CosmosDBMongoDBCollectionRetrieveThroughputDistribution.json // this example is just showing the usage of "MongoDBResources_MongoDBContainerRetrieveThroughputDistribution" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -133,7 +133,7 @@ public async Task MongoDBContainerRetrieveThroughputDistribution_CosmosDBMongoDB [Ignore("Only validating compilation of examples")] public async Task MongoDBContainerRedistributeThroughput_CosmosDBMongoDBCollectionRedistributeThroughput() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBMongoDBCollectionRedistributeThroughput.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/CosmosDBMongoDBCollectionRedistributeThroughput.json // this example is just showing the usage of "MongoDBResources_MongoDBContainerRedistributeThroughput" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -180,7 +180,7 @@ public async Task MongoDBContainerRedistributeThroughput_CosmosDBMongoDBCollecti [Ignore("Only validating compilation of examples")] public async Task MigrateMongoDBCollectionToAutoscale_CosmosDBMongoDBCollectionMigrateToAutoscale() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBMongoDBCollectionMigrateToAutoscale.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/CosmosDBMongoDBCollectionMigrateToAutoscale.json // this example is just showing the usage of "MongoDBResources_MigrateMongoDBCollectionToAutoscale" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -213,7 +213,7 @@ public async Task MigrateMongoDBCollectionToAutoscale_CosmosDBMongoDBCollectionM [Ignore("Only validating compilation of examples")] public async Task MigrateMongoDBCollectionToManualThroughput_CosmosDBMongoDBCollectionMigrateToManualThroughput() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBMongoDBCollectionMigrateToManualThroughput.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/CosmosDBMongoDBCollectionMigrateToManualThroughput.json // this example is just showing the usage of "MongoDBResources_MigrateMongoDBCollectionToManualThroughput" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_MongoDBDatabaseCollection.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_MongoDBDatabaseCollection.cs index e2578904fc32..cff8c892f8be 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_MongoDBDatabaseCollection.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_MongoDBDatabaseCollection.cs @@ -20,7 +20,7 @@ public partial class Sample_MongoDBDatabaseCollection [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_CosmosDBMongoDBDatabaseCreateUpdate() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBMongoDBDatabaseCreateUpdate.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/CosmosDBMongoDBDatabaseCreateUpdate.json // this example is just showing the usage of "MongoDBResources_CreateUpdateMongoDBDatabase" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -60,7 +60,7 @@ public async Task CreateOrUpdate_CosmosDBMongoDBDatabaseCreateUpdate() [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_CosmosDBMongoDBDatabaseRestore() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBMongoDBDatabaseRestore.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/CosmosDBMongoDBDatabaseRestore.json // this example is just showing the usage of "MongoDBResources_CreateUpdateMongoDBDatabase" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -109,7 +109,7 @@ public async Task CreateOrUpdate_CosmosDBMongoDBDatabaseRestore() [Ignore("Only validating compilation of examples")] public async Task Get_CosmosDBMongoDBDatabaseGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBMongoDBDatabaseGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/CosmosDBMongoDBDatabaseGet.json // this example is just showing the usage of "MongoDBResources_GetMongoDBDatabase" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -143,7 +143,7 @@ public async Task Get_CosmosDBMongoDBDatabaseGet() [Ignore("Only validating compilation of examples")] public async Task GetAll_CosmosDBMongoDBDatabaseList() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBMongoDBDatabaseList.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/CosmosDBMongoDBDatabaseList.json // this example is just showing the usage of "MongoDBResources_ListMongoDBDatabases" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -179,7 +179,7 @@ public async Task GetAll_CosmosDBMongoDBDatabaseList() [Ignore("Only validating compilation of examples")] public async Task Exists_CosmosDBMongoDBDatabaseGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBMongoDBDatabaseGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/CosmosDBMongoDBDatabaseGet.json // this example is just showing the usage of "MongoDBResources_GetMongoDBDatabase" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -209,7 +209,7 @@ public async Task Exists_CosmosDBMongoDBDatabaseGet() [Ignore("Only validating compilation of examples")] public async Task GetIfExists_CosmosDBMongoDBDatabaseGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBMongoDBDatabaseGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/CosmosDBMongoDBDatabaseGet.json // this example is just showing the usage of "MongoDBResources_GetMongoDBDatabase" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_MongoDBDatabaseResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_MongoDBDatabaseResource.cs index 433671f7532f..e1a9534e699d 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_MongoDBDatabaseResource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_MongoDBDatabaseResource.cs @@ -20,7 +20,7 @@ public partial class Sample_MongoDBDatabaseResource [Ignore("Only validating compilation of examples")] public async Task Get_CosmosDBMongoDBDatabaseGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBMongoDBDatabaseGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/CosmosDBMongoDBDatabaseGet.json // this example is just showing the usage of "MongoDBResources_GetMongoDBDatabase" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -51,7 +51,7 @@ public async Task Get_CosmosDBMongoDBDatabaseGet() [Ignore("Only validating compilation of examples")] public async Task Delete_CosmosDBMongoDBDatabaseDelete() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBMongoDBDatabaseDelete.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/CosmosDBMongoDBDatabaseDelete.json // this example is just showing the usage of "MongoDBResources_DeleteMongoDBDatabase" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -78,7 +78,7 @@ public async Task Delete_CosmosDBMongoDBDatabaseDelete() [Ignore("Only validating compilation of examples")] public async Task Update_CosmosDBMongoDBDatabaseCreateUpdate() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBMongoDBDatabaseCreateUpdate.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/CosmosDBMongoDBDatabaseCreateUpdate.json // this example is just showing the usage of "MongoDBResources_CreateUpdateMongoDBDatabase" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -115,7 +115,7 @@ public async Task Update_CosmosDBMongoDBDatabaseCreateUpdate() [Ignore("Only validating compilation of examples")] public async Task Update_CosmosDBMongoDBDatabaseRestore() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBMongoDBDatabaseRestore.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/CosmosDBMongoDBDatabaseRestore.json // this example is just showing the usage of "MongoDBResources_CreateUpdateMongoDBDatabase" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -161,7 +161,7 @@ public async Task Update_CosmosDBMongoDBDatabaseRestore() [Ignore("Only validating compilation of examples")] public async Task MongoDBDatabasePartitionMerge_CosmosDBMongoDBDatabasePartitionMerge() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBMongoDBDatabasePartitionMerge.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/CosmosDBMongoDBDatabasePartitionMerge.json // this example is just showing the usage of "MongoDBResources_MongoDBDatabasePartitionMerge" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_MongoDBDatabaseThroughputSettingResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_MongoDBDatabaseThroughputSettingResource.cs index 35179d19b259..5c181014665c 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_MongoDBDatabaseThroughputSettingResource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_MongoDBDatabaseThroughputSettingResource.cs @@ -21,7 +21,7 @@ public partial class Sample_MongoDBDatabaseThroughputSettingResource [Ignore("Only validating compilation of examples")] public async Task Get_CosmosDBMongoDBDatabaseThroughputGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBMongoDBDatabaseThroughputGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/CosmosDBMongoDBDatabaseThroughputGet.json // this example is just showing the usage of "MongoDBResources_GetMongoDBDatabaseThroughput" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -52,7 +52,7 @@ public async Task Get_CosmosDBMongoDBDatabaseThroughputGet() [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_CosmosDBMongoDBDatabaseThroughputUpdate() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBMongoDBDatabaseThroughputUpdate.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/CosmosDBMongoDBDatabaseThroughputUpdate.json // this example is just showing the usage of "MongoDBResources_UpdateMongoDBDatabaseThroughput" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -91,7 +91,7 @@ public async Task CreateOrUpdate_CosmosDBMongoDBDatabaseThroughputUpdate() [Ignore("Only validating compilation of examples")] public async Task MigrateMongoDBDatabaseToAutoscale_CosmosDBMongoDBDatabaseMigrateToAutoscale() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBMongoDBDatabaseMigrateToAutoscale.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/CosmosDBMongoDBDatabaseMigrateToAutoscale.json // this example is just showing the usage of "MongoDBResources_MigrateMongoDBDatabaseToAutoscale" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -123,7 +123,7 @@ public async Task MigrateMongoDBDatabaseToAutoscale_CosmosDBMongoDBDatabaseMigra [Ignore("Only validating compilation of examples")] public async Task MigrateMongoDBDatabaseToManualThroughput_CosmosDBMongoDBDatabaseMigrateToManualThroughput() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBMongoDBDatabaseMigrateToManualThroughput.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/CosmosDBMongoDBDatabaseMigrateToManualThroughput.json // this example is just showing the usage of "MongoDBResources_MigrateMongoDBDatabaseToManualThroughput" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -155,7 +155,7 @@ public async Task MigrateMongoDBDatabaseToManualThroughput_CosmosDBMongoDBDataba [Ignore("Only validating compilation of examples")] public async Task MongoDBDatabaseRetrieveThroughputDistribution_CosmosDBMongoDBDatabaseRetrieveThroughputDistribution() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBMongoDBDatabaseRetrieveThroughputDistribution.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/CosmosDBMongoDBDatabaseRetrieveThroughputDistribution.json // this example is just showing the usage of "MongoDBResources_MongoDBDatabaseRetrieveThroughputDistribution" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -194,7 +194,7 @@ public async Task MongoDBDatabaseRetrieveThroughputDistribution_CosmosDBMongoDBD [Ignore("Only validating compilation of examples")] public async Task MongoDBDatabaseRedistributeThroughput_CosmosDBMongoDBDatabaseRedistributeThroughput() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBMongoDBDatabaseRedistributeThroughput.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/CosmosDBMongoDBDatabaseRedistributeThroughput.json // this example is just showing the usage of "MongoDBResources_MongoDBDatabaseRedistributeThroughput" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_MongoDBRoleDefinitionCollection.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_MongoDBRoleDefinitionCollection.cs index 5e4ecb88f2a3..bee888fc9753 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_MongoDBRoleDefinitionCollection.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_MongoDBRoleDefinitionCollection.cs @@ -20,7 +20,7 @@ public partial class Sample_MongoDBRoleDefinitionCollection [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_CosmosDBMongoDBRoleDefinitionCreateUpdate() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBMongoDBRoleDefinitionCreateUpdate.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/CosmosDBMongoDBRoleDefinitionCreateUpdate.json // this example is just showing the usage of "MongoDBResources_CreateUpdateMongoRoleDefinition" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -74,7 +74,7 @@ public async Task CreateOrUpdate_CosmosDBMongoDBRoleDefinitionCreateUpdate() [Ignore("Only validating compilation of examples")] public async Task Get_CosmosDBMongoRoleDefinitionGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBMongoDBRoleDefinitionGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/CosmosDBMongoDBRoleDefinitionGet.json // this example is just showing the usage of "MongoDBResources_GetMongoRoleDefinition" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -108,7 +108,7 @@ public async Task Get_CosmosDBMongoRoleDefinitionGet() [Ignore("Only validating compilation of examples")] public async Task GetAll_CosmosDBMongoDBRoleDefinitionList() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBMongoDBRoleDefinitionList.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/CosmosDBMongoDBRoleDefinitionList.json // this example is just showing the usage of "MongoDBResources_ListMongoRoleDefinitions" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -144,7 +144,7 @@ public async Task GetAll_CosmosDBMongoDBRoleDefinitionList() [Ignore("Only validating compilation of examples")] public async Task Exists_CosmosDBMongoRoleDefinitionGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBMongoDBRoleDefinitionGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/CosmosDBMongoDBRoleDefinitionGet.json // this example is just showing the usage of "MongoDBResources_GetMongoRoleDefinition" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -174,7 +174,7 @@ public async Task Exists_CosmosDBMongoRoleDefinitionGet() [Ignore("Only validating compilation of examples")] public async Task GetIfExists_CosmosDBMongoRoleDefinitionGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBMongoDBRoleDefinitionGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/CosmosDBMongoDBRoleDefinitionGet.json // this example is just showing the usage of "MongoDBResources_GetMongoRoleDefinition" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_MongoDBRoleDefinitionResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_MongoDBRoleDefinitionResource.cs index 2a12fe979966..e6cc9dfa1847 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_MongoDBRoleDefinitionResource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_MongoDBRoleDefinitionResource.cs @@ -20,7 +20,7 @@ public partial class Sample_MongoDBRoleDefinitionResource [Ignore("Only validating compilation of examples")] public async Task Get_CosmosDBMongoRoleDefinitionGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBMongoDBRoleDefinitionGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/CosmosDBMongoDBRoleDefinitionGet.json // this example is just showing the usage of "MongoDBResources_GetMongoRoleDefinition" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -51,7 +51,7 @@ public async Task Get_CosmosDBMongoRoleDefinitionGet() [Ignore("Only validating compilation of examples")] public async Task Delete_CosmosDBMongoDBRoleDefinitionDelete() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBMongoDBRoleDefinitionDelete.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/CosmosDBMongoDBRoleDefinitionDelete.json // this example is just showing the usage of "MongoDBResources_DeleteMongoRoleDefinition" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -78,7 +78,7 @@ public async Task Delete_CosmosDBMongoDBRoleDefinitionDelete() [Ignore("Only validating compilation of examples")] public async Task Update_CosmosDBMongoDBRoleDefinitionCreateUpdate() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBMongoDBRoleDefinitionCreateUpdate.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/CosmosDBMongoDBRoleDefinitionCreateUpdate.json // this example is just showing the usage of "MongoDBResources_CreateUpdateMongoRoleDefinition" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_MongoDBUserDefinitionCollection.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_MongoDBUserDefinitionCollection.cs index 2fd33e251d99..dcf0fc97101b 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_MongoDBUserDefinitionCollection.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_MongoDBUserDefinitionCollection.cs @@ -20,7 +20,7 @@ public partial class Sample_MongoDBUserDefinitionCollection [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_CosmosDBMongoDBUserDefinitionCreateUpdate() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBMongoDBUserDefinitionCreateUpdate.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/CosmosDBMongoDBUserDefinitionCreateUpdate.json // this example is just showing the usage of "MongoDBResources_CreateUpdateMongoUserDefinition" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -68,7 +68,7 @@ public async Task CreateOrUpdate_CosmosDBMongoDBUserDefinitionCreateUpdate() [Ignore("Only validating compilation of examples")] public async Task Get_CosmosDBMongoDBUserDefinitionGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBMongoDBUserDefinitionGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/CosmosDBMongoDBUserDefinitionGet.json // this example is just showing the usage of "MongoDBResources_GetMongoUserDefinition" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -102,7 +102,7 @@ public async Task Get_CosmosDBMongoDBUserDefinitionGet() [Ignore("Only validating compilation of examples")] public async Task GetAll_CosmosDBMongoDBUserDefinitionList() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBMongoDBUserDefinitionList.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/CosmosDBMongoDBUserDefinitionList.json // this example is just showing the usage of "MongoDBResources_ListMongoUserDefinitions" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -138,7 +138,7 @@ public async Task GetAll_CosmosDBMongoDBUserDefinitionList() [Ignore("Only validating compilation of examples")] public async Task Exists_CosmosDBMongoDBUserDefinitionGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBMongoDBUserDefinitionGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/CosmosDBMongoDBUserDefinitionGet.json // this example is just showing the usage of "MongoDBResources_GetMongoUserDefinition" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -168,7 +168,7 @@ public async Task Exists_CosmosDBMongoDBUserDefinitionGet() [Ignore("Only validating compilation of examples")] public async Task GetIfExists_CosmosDBMongoDBUserDefinitionGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBMongoDBUserDefinitionGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/CosmosDBMongoDBUserDefinitionGet.json // this example is just showing the usage of "MongoDBResources_GetMongoUserDefinition" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_MongoDBUserDefinitionResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_MongoDBUserDefinitionResource.cs index 2106616e2805..0174b3ecae97 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_MongoDBUserDefinitionResource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_MongoDBUserDefinitionResource.cs @@ -20,7 +20,7 @@ public partial class Sample_MongoDBUserDefinitionResource [Ignore("Only validating compilation of examples")] public async Task Get_CosmosDBMongoDBUserDefinitionGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBMongoDBUserDefinitionGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/CosmosDBMongoDBUserDefinitionGet.json // this example is just showing the usage of "MongoDBResources_GetMongoUserDefinition" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -51,7 +51,7 @@ public async Task Get_CosmosDBMongoDBUserDefinitionGet() [Ignore("Only validating compilation of examples")] public async Task Delete_CosmosDBMongoDBUserDefinitionDelete() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBMongoDBUserDefinitionDelete.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/CosmosDBMongoDBUserDefinitionDelete.json // this example is just showing the usage of "MongoDBResources_DeleteMongoUserDefinition" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -78,7 +78,7 @@ public async Task Delete_CosmosDBMongoDBUserDefinitionDelete() [Ignore("Only validating compilation of examples")] public async Task Update_CosmosDBMongoDBUserDefinitionCreateUpdate() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBMongoDBUserDefinitionCreateUpdate.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/CosmosDBMongoDBUserDefinitionCreateUpdate.json // this example is just showing the usage of "MongoDBResources_CreateUpdateMongoUserDefinition" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_MongoMIRoleAssignmentResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_MongoMIRoleAssignmentResource.cs new file mode 100644 index 000000000000..4acf2d14b963 --- /dev/null +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_MongoMIRoleAssignmentResource.cs @@ -0,0 +1,114 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using NUnit.Framework; + +namespace Azure.ResourceManager.CosmosDB.Samples +{ + public partial class Sample_MongoMIRoleAssignmentResource + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_CosmosDBMongoMIRoleAssignmentGet() + { + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/mongoMIrbac/CosmosDBMongoMIRoleAssignmentGet.json + // this example is just showing the usage of "MongoMIResources_GetMongoMIRoleAssignment" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details 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 MongoMIRoleAssignmentResource created on azure + // for more information of creating MongoMIRoleAssignmentResource, please refer to the document of MongoMIRoleAssignmentResource + string subscriptionId = "ffffffff-ffff-ffff-ffff-ffffffffffff"; + string resourceGroupName = "myResourceGroupName"; + string accountName = "myAccountName"; + string roleAssignmentId = "myRoleAssignmentId"; + ResourceIdentifier mongoMIRoleAssignmentResourceId = MongoMIRoleAssignmentResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName, roleAssignmentId); + MongoMIRoleAssignmentResource mongoMIRoleAssignmentResource = client.GetMongoMIRoleAssignmentResource(mongoMIRoleAssignmentResourceId); + + // invoke the operation + MongoMIRoleAssignmentResource result = await mongoMIRoleAssignmentResource.GetAsync(); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + MongoMIRoleAssignmentResourceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Delete_CosmosDBMongoMIRoleAssignmentDelete() + { + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/mongoMIrbac/CosmosDBMongoMIRoleAssignmentDelete.json + // this example is just showing the usage of "MongoMIResources_DeleteMongoMIRoleAssignment" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details 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 MongoMIRoleAssignmentResource created on azure + // for more information of creating MongoMIRoleAssignmentResource, please refer to the document of MongoMIRoleAssignmentResource + string subscriptionId = "ffffffff-ffff-ffff-ffff-ffffffffffff"; + string resourceGroupName = "myResourceGroupName"; + string accountName = "myAccountName"; + string roleAssignmentId = "myRoleAssignmentId"; + ResourceIdentifier mongoMIRoleAssignmentResourceId = MongoMIRoleAssignmentResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName, roleAssignmentId); + MongoMIRoleAssignmentResource mongoMIRoleAssignmentResource = client.GetMongoMIRoleAssignmentResource(mongoMIRoleAssignmentResourceId); + + // invoke the operation + await mongoMIRoleAssignmentResource.DeleteAsync(WaitUntil.Completed); + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Update_CosmosDBMongoMIRoleAssignmentCreateUpdate() + { + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/mongoMIrbac/CosmosDBMongoMIRoleAssignmentCreateUpdate.json + // this example is just showing the usage of "MongoMIResources_CreateUpdateMongoMIRoleAssignment" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details 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 MongoMIRoleAssignmentResource created on azure + // for more information of creating MongoMIRoleAssignmentResource, please refer to the document of MongoMIRoleAssignmentResource + string subscriptionId = "ffffffff-ffff-ffff-ffff-ffffffffffff"; + string resourceGroupName = "myResourceGroupName"; + string accountName = "myAccountName"; + string roleAssignmentId = "myRoleAssignmentId"; + ResourceIdentifier mongoMIRoleAssignmentResourceId = MongoMIRoleAssignmentResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName, roleAssignmentId); + MongoMIRoleAssignmentResource mongoMIRoleAssignmentResource = client.GetMongoMIRoleAssignmentResource(mongoMIRoleAssignmentResourceId); + + // invoke the operation + MongoMIRoleAssignmentResourceData data = new MongoMIRoleAssignmentResourceData + { + RoleDefinitionId = "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/myResourceGroupName/providers/Microsoft.DocumentDB/databaseAccounts/myAccountName/mongoMIRoleDefinitions/myRoleDefinitionId", + Scope = "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/myResourceGroupName/providers/Microsoft.DocumentDB/databaseAccounts/myAccountName/dbs/purchases/colls/redmond-purchases", + PrincipalId = Guid.Parse("myPrincipalId"), + }; + ArmOperation lro = await mongoMIRoleAssignmentResource.UpdateAsync(WaitUntil.Completed, data); + MongoMIRoleAssignmentResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + MongoMIRoleAssignmentResourceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } +} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_MongoMIRoleAssignmentResourceCollection.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_MongoMIRoleAssignmentResourceCollection.cs new file mode 100644 index 000000000000..37cc73bf3e89 --- /dev/null +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_MongoMIRoleAssignmentResourceCollection.cs @@ -0,0 +1,201 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using NUnit.Framework; + +namespace Azure.ResourceManager.CosmosDB.Samples +{ + public partial class Sample_MongoMIRoleAssignmentResourceCollection + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task CreateOrUpdate_CosmosDBMongoMIRoleAssignmentCreateUpdate() + { + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/mongoMIrbac/CosmosDBMongoMIRoleAssignmentCreateUpdate.json + // this example is just showing the usage of "MongoMIResources_CreateUpdateMongoMIRoleAssignment" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details 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 CosmosDBAccountResource created on azure + // for more information of creating CosmosDBAccountResource, please refer to the document of CosmosDBAccountResource + string subscriptionId = "ffffffff-ffff-ffff-ffff-ffffffffffff"; + string resourceGroupName = "myResourceGroupName"; + string accountName = "myAccountName"; + ResourceIdentifier cosmosDBAccountResourceId = CosmosDBAccountResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName); + CosmosDBAccountResource cosmosDBAccount = client.GetCosmosDBAccountResource(cosmosDBAccountResourceId); + + // get the collection of this MongoMIRoleAssignmentResource + MongoMIRoleAssignmentResourceCollection collection = cosmosDBAccount.GetMongoMIRoleAssignmentResources(); + + // invoke the operation + string roleAssignmentId = "myRoleAssignmentId"; + MongoMIRoleAssignmentResourceData data = new MongoMIRoleAssignmentResourceData + { + RoleDefinitionId = "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/myResourceGroupName/providers/Microsoft.DocumentDB/databaseAccounts/myAccountName/mongoMIRoleDefinitions/myRoleDefinitionId", + Scope = "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/myResourceGroupName/providers/Microsoft.DocumentDB/databaseAccounts/myAccountName/dbs/purchases/colls/redmond-purchases", + PrincipalId = Guid.Parse("myPrincipalId"), + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, roleAssignmentId, data); + MongoMIRoleAssignmentResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + MongoMIRoleAssignmentResourceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_CosmosDBMongoMIRoleAssignmentGet() + { + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/mongoMIrbac/CosmosDBMongoMIRoleAssignmentGet.json + // this example is just showing the usage of "MongoMIResources_GetMongoMIRoleAssignment" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details 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 CosmosDBAccountResource created on azure + // for more information of creating CosmosDBAccountResource, please refer to the document of CosmosDBAccountResource + string subscriptionId = "ffffffff-ffff-ffff-ffff-ffffffffffff"; + string resourceGroupName = "myResourceGroupName"; + string accountName = "myAccountName"; + ResourceIdentifier cosmosDBAccountResourceId = CosmosDBAccountResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName); + CosmosDBAccountResource cosmosDBAccount = client.GetCosmosDBAccountResource(cosmosDBAccountResourceId); + + // get the collection of this MongoMIRoleAssignmentResource + MongoMIRoleAssignmentResourceCollection collection = cosmosDBAccount.GetMongoMIRoleAssignmentResources(); + + // invoke the operation + string roleAssignmentId = "myRoleAssignmentId"; + MongoMIRoleAssignmentResource result = await collection.GetAsync(roleAssignmentId); + + // 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 + MongoMIRoleAssignmentResourceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetAll_CosmosDBMongoMIRoleAssignmentList() + { + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/mongoMIrbac/CosmosDBMongoMIRoleAssignmentList.json + // this example is just showing the usage of "MongoMIResources_ListMongoMIRoleAssignments" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details 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 CosmosDBAccountResource created on azure + // for more information of creating CosmosDBAccountResource, please refer to the document of CosmosDBAccountResource + string subscriptionId = "ffffffff-ffff-ffff-ffff-ffffffffffff"; + string resourceGroupName = "myResourceGroupName"; + string accountName = "myAccountName"; + ResourceIdentifier cosmosDBAccountResourceId = CosmosDBAccountResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName); + CosmosDBAccountResource cosmosDBAccount = client.GetCosmosDBAccountResource(cosmosDBAccountResourceId); + + // get the collection of this MongoMIRoleAssignmentResource + MongoMIRoleAssignmentResourceCollection collection = cosmosDBAccount.GetMongoMIRoleAssignmentResources(); + + // invoke the operation and iterate over the result + await foreach (MongoMIRoleAssignmentResource item in collection.GetAllAsync()) + { + // the variable item is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + MongoMIRoleAssignmentResourceData resourceData = item.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Exists_CosmosDBMongoMIRoleAssignmentGet() + { + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/mongoMIrbac/CosmosDBMongoMIRoleAssignmentGet.json + // this example is just showing the usage of "MongoMIResources_GetMongoMIRoleAssignment" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details 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 CosmosDBAccountResource created on azure + // for more information of creating CosmosDBAccountResource, please refer to the document of CosmosDBAccountResource + string subscriptionId = "ffffffff-ffff-ffff-ffff-ffffffffffff"; + string resourceGroupName = "myResourceGroupName"; + string accountName = "myAccountName"; + ResourceIdentifier cosmosDBAccountResourceId = CosmosDBAccountResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName); + CosmosDBAccountResource cosmosDBAccount = client.GetCosmosDBAccountResource(cosmosDBAccountResourceId); + + // get the collection of this MongoMIRoleAssignmentResource + MongoMIRoleAssignmentResourceCollection collection = cosmosDBAccount.GetMongoMIRoleAssignmentResources(); + + // invoke the operation + string roleAssignmentId = "myRoleAssignmentId"; + bool result = await collection.ExistsAsync(roleAssignmentId); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetIfExists_CosmosDBMongoMIRoleAssignmentGet() + { + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/mongoMIrbac/CosmosDBMongoMIRoleAssignmentGet.json + // this example is just showing the usage of "MongoMIResources_GetMongoMIRoleAssignment" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details 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 CosmosDBAccountResource created on azure + // for more information of creating CosmosDBAccountResource, please refer to the document of CosmosDBAccountResource + string subscriptionId = "ffffffff-ffff-ffff-ffff-ffffffffffff"; + string resourceGroupName = "myResourceGroupName"; + string accountName = "myAccountName"; + ResourceIdentifier cosmosDBAccountResourceId = CosmosDBAccountResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName); + CosmosDBAccountResource cosmosDBAccount = client.GetCosmosDBAccountResource(cosmosDBAccountResourceId); + + // get the collection of this MongoMIRoleAssignmentResource + MongoMIRoleAssignmentResourceCollection collection = cosmosDBAccount.GetMongoMIRoleAssignmentResources(); + + // invoke the operation + string roleAssignmentId = "myRoleAssignmentId"; + NullableResponse response = await collection.GetIfExistsAsync(roleAssignmentId); + MongoMIRoleAssignmentResource result = response.HasValue ? response.Value : null; + + if (result == null) + { + Console.WriteLine("Succeeded with null as result"); + } + else + { + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + MongoMIRoleAssignmentResourceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + } +} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_MongoMIRoleDefinitionResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_MongoMIRoleDefinitionResource.cs new file mode 100644 index 000000000000..43bdd9106ffe --- /dev/null +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_MongoMIRoleDefinitionResource.cs @@ -0,0 +1,120 @@ +// 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.CosmosDB.Models; +using NUnit.Framework; + +namespace Azure.ResourceManager.CosmosDB.Samples +{ + public partial class Sample_MongoMIRoleDefinitionResource + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_CosmosDBMongoMIRoleDefinitionGet() + { + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/mongoMIrbac/CosmosDBMongoMIRoleDefinitionGet.json + // this example is just showing the usage of "MongoMIResources_GetMongoMIRoleDefinition" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details 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 MongoMIRoleDefinitionResource created on azure + // for more information of creating MongoMIRoleDefinitionResource, please refer to the document of MongoMIRoleDefinitionResource + string subscriptionId = "ffffffff-ffff-ffff-ffff-ffffffffffff"; + string resourceGroupName = "myResourceGroupName"; + string accountName = "myAccountName"; + string roleDefinitionId = "myRoleDefinitionId"; + ResourceIdentifier mongoMIRoleDefinitionResourceId = MongoMIRoleDefinitionResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName, roleDefinitionId); + MongoMIRoleDefinitionResource mongoMIRoleDefinitionResource = client.GetMongoMIRoleDefinitionResource(mongoMIRoleDefinitionResourceId); + + // invoke the operation + MongoMIRoleDefinitionResource result = await mongoMIRoleDefinitionResource.GetAsync(); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + MongoMIRoleDefinitionResourceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Delete_CosmosDBMongoMIRoleDefinitionDelete() + { + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/mongoMIrbac/CosmosDBMongoMIRoleDefinitionDelete.json + // this example is just showing the usage of "MongoMIResources_DeleteMongoMIRoleDefinition" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details 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 MongoMIRoleDefinitionResource created on azure + // for more information of creating MongoMIRoleDefinitionResource, please refer to the document of MongoMIRoleDefinitionResource + string subscriptionId = "ffffffff-ffff-ffff-ffff-ffffffffffff"; + string resourceGroupName = "myResourceGroupName"; + string accountName = "myAccountName"; + string roleDefinitionId = "myRoleDefinitionId"; + ResourceIdentifier mongoMIRoleDefinitionResourceId = MongoMIRoleDefinitionResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName, roleDefinitionId); + MongoMIRoleDefinitionResource mongoMIRoleDefinitionResource = client.GetMongoMIRoleDefinitionResource(mongoMIRoleDefinitionResourceId); + + // invoke the operation + await mongoMIRoleDefinitionResource.DeleteAsync(WaitUntil.Completed); + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Update_CosmosDBMongoMIRoleDefinitionCreateUpdate() + { + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/mongoMIrbac/CosmosDBMongoMIRoleDefinitionCreateUpdate.json + // this example is just showing the usage of "MongoMIResources_CreateUpdateMongoMIRoleDefinition" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details 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 MongoMIRoleDefinitionResource created on azure + // for more information of creating MongoMIRoleDefinitionResource, please refer to the document of MongoMIRoleDefinitionResource + string subscriptionId = "ffffffff-ffff-ffff-ffff-ffffffffffff"; + string resourceGroupName = "myResourceGroupName"; + string accountName = "myAccountName"; + string roleDefinitionId = "myRoleDefinitionId"; + ResourceIdentifier mongoMIRoleDefinitionResourceId = MongoMIRoleDefinitionResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName, roleDefinitionId); + MongoMIRoleDefinitionResource mongoMIRoleDefinitionResource = client.GetMongoMIRoleDefinitionResource(mongoMIRoleDefinitionResourceId); + + // invoke the operation + MongoMIRoleDefinitionResourceData data = new MongoMIRoleDefinitionResourceData + { + RoleName = "myRoleName", + TypePropertiesType = CosmosDBSqlRoleDefinitionType.CustomRole, + AssignableScopes = { "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/myResourceGroupName/providers/Microsoft.DocumentDB/databaseAccounts/myAccountName/dbs/sales", "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/myResourceGroupName/providers/Microsoft.DocumentDB/databaseAccounts/myAccountName/dbs/purchases" }, + Permissions = {new Permission +{ +DataActions = {"Microsoft.DocumentDB/databaseAccounts/mongoMIDatabases/containers/entities/create", "Microsoft.DocumentDB/databaseAccounts/mongoMIDatabases/containers/entities/read"}, +NotDataActions = {}, +}}, + }; + ArmOperation lro = await mongoMIRoleDefinitionResource.UpdateAsync(WaitUntil.Completed, data); + MongoMIRoleDefinitionResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + MongoMIRoleDefinitionResourceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } +} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_MongoMIRoleDefinitionResourceCollection.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_MongoMIRoleDefinitionResourceCollection.cs new file mode 100644 index 000000000000..cfca0ddb4f0c --- /dev/null +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_MongoMIRoleDefinitionResourceCollection.cs @@ -0,0 +1,207 @@ +// 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.CosmosDB.Models; +using NUnit.Framework; + +namespace Azure.ResourceManager.CosmosDB.Samples +{ + public partial class Sample_MongoMIRoleDefinitionResourceCollection + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task CreateOrUpdate_CosmosDBMongoMIRoleDefinitionCreateUpdate() + { + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/mongoMIrbac/CosmosDBMongoMIRoleDefinitionCreateUpdate.json + // this example is just showing the usage of "MongoMIResources_CreateUpdateMongoMIRoleDefinition" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details 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 CosmosDBAccountResource created on azure + // for more information of creating CosmosDBAccountResource, please refer to the document of CosmosDBAccountResource + string subscriptionId = "ffffffff-ffff-ffff-ffff-ffffffffffff"; + string resourceGroupName = "myResourceGroupName"; + string accountName = "myAccountName"; + ResourceIdentifier cosmosDBAccountResourceId = CosmosDBAccountResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName); + CosmosDBAccountResource cosmosDBAccount = client.GetCosmosDBAccountResource(cosmosDBAccountResourceId); + + // get the collection of this MongoMIRoleDefinitionResource + MongoMIRoleDefinitionResourceCollection collection = cosmosDBAccount.GetMongoMIRoleDefinitionResources(); + + // invoke the operation + string roleDefinitionId = "myRoleDefinitionId"; + MongoMIRoleDefinitionResourceData data = new MongoMIRoleDefinitionResourceData + { + RoleName = "myRoleName", + TypePropertiesType = CosmosDBSqlRoleDefinitionType.CustomRole, + AssignableScopes = { "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/myResourceGroupName/providers/Microsoft.DocumentDB/databaseAccounts/myAccountName/dbs/sales", "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/myResourceGroupName/providers/Microsoft.DocumentDB/databaseAccounts/myAccountName/dbs/purchases" }, + Permissions = {new Permission +{ +DataActions = {"Microsoft.DocumentDB/databaseAccounts/mongoMIDatabases/containers/entities/create", "Microsoft.DocumentDB/databaseAccounts/mongoMIDatabases/containers/entities/read"}, +NotDataActions = {}, +}}, + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, roleDefinitionId, data); + MongoMIRoleDefinitionResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + MongoMIRoleDefinitionResourceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_CosmosDBMongoMIRoleDefinitionGet() + { + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/mongoMIrbac/CosmosDBMongoMIRoleDefinitionGet.json + // this example is just showing the usage of "MongoMIResources_GetMongoMIRoleDefinition" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details 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 CosmosDBAccountResource created on azure + // for more information of creating CosmosDBAccountResource, please refer to the document of CosmosDBAccountResource + string subscriptionId = "ffffffff-ffff-ffff-ffff-ffffffffffff"; + string resourceGroupName = "myResourceGroupName"; + string accountName = "myAccountName"; + ResourceIdentifier cosmosDBAccountResourceId = CosmosDBAccountResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName); + CosmosDBAccountResource cosmosDBAccount = client.GetCosmosDBAccountResource(cosmosDBAccountResourceId); + + // get the collection of this MongoMIRoleDefinitionResource + MongoMIRoleDefinitionResourceCollection collection = cosmosDBAccount.GetMongoMIRoleDefinitionResources(); + + // invoke the operation + string roleDefinitionId = "myRoleDefinitionId"; + MongoMIRoleDefinitionResource result = await collection.GetAsync(roleDefinitionId); + + // 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 + MongoMIRoleDefinitionResourceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetAll_CosmosDBMongoMIRoleDefinitionList() + { + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/mongoMIrbac/CosmosDBMongoMIRoleDefinitionList.json + // this example is just showing the usage of "MongoMIResources_ListMongoMIRoleDefinitions" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details 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 CosmosDBAccountResource created on azure + // for more information of creating CosmosDBAccountResource, please refer to the document of CosmosDBAccountResource + string subscriptionId = "ffffffff-ffff-ffff-ffff-ffffffffffff"; + string resourceGroupName = "myResourceGroupName"; + string accountName = "myAccountName"; + ResourceIdentifier cosmosDBAccountResourceId = CosmosDBAccountResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName); + CosmosDBAccountResource cosmosDBAccount = client.GetCosmosDBAccountResource(cosmosDBAccountResourceId); + + // get the collection of this MongoMIRoleDefinitionResource + MongoMIRoleDefinitionResourceCollection collection = cosmosDBAccount.GetMongoMIRoleDefinitionResources(); + + // invoke the operation and iterate over the result + await foreach (MongoMIRoleDefinitionResource item in collection.GetAllAsync()) + { + // the variable item is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + MongoMIRoleDefinitionResourceData resourceData = item.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Exists_CosmosDBMongoMIRoleDefinitionGet() + { + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/mongoMIrbac/CosmosDBMongoMIRoleDefinitionGet.json + // this example is just showing the usage of "MongoMIResources_GetMongoMIRoleDefinition" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details 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 CosmosDBAccountResource created on azure + // for more information of creating CosmosDBAccountResource, please refer to the document of CosmosDBAccountResource + string subscriptionId = "ffffffff-ffff-ffff-ffff-ffffffffffff"; + string resourceGroupName = "myResourceGroupName"; + string accountName = "myAccountName"; + ResourceIdentifier cosmosDBAccountResourceId = CosmosDBAccountResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName); + CosmosDBAccountResource cosmosDBAccount = client.GetCosmosDBAccountResource(cosmosDBAccountResourceId); + + // get the collection of this MongoMIRoleDefinitionResource + MongoMIRoleDefinitionResourceCollection collection = cosmosDBAccount.GetMongoMIRoleDefinitionResources(); + + // invoke the operation + string roleDefinitionId = "myRoleDefinitionId"; + bool result = await collection.ExistsAsync(roleDefinitionId); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetIfExists_CosmosDBMongoMIRoleDefinitionGet() + { + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/mongoMIrbac/CosmosDBMongoMIRoleDefinitionGet.json + // this example is just showing the usage of "MongoMIResources_GetMongoMIRoleDefinition" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details 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 CosmosDBAccountResource created on azure + // for more information of creating CosmosDBAccountResource, please refer to the document of CosmosDBAccountResource + string subscriptionId = "ffffffff-ffff-ffff-ffff-ffffffffffff"; + string resourceGroupName = "myResourceGroupName"; + string accountName = "myAccountName"; + ResourceIdentifier cosmosDBAccountResourceId = CosmosDBAccountResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName); + CosmosDBAccountResource cosmosDBAccount = client.GetCosmosDBAccountResource(cosmosDBAccountResourceId); + + // get the collection of this MongoMIRoleDefinitionResource + MongoMIRoleDefinitionResourceCollection collection = cosmosDBAccount.GetMongoMIRoleDefinitionResources(); + + // invoke the operation + string roleDefinitionId = "myRoleDefinitionId"; + NullableResponse response = await collection.GetIfExistsAsync(roleDefinitionId); + MongoMIRoleDefinitionResource result = response.HasValue ? response.Value : null; + + if (result == null) + { + Console.WriteLine("Succeeded with null as result"); + } + else + { + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + MongoMIRoleDefinitionResourceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + } +} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_NetworkSecurityPerimeterConfigurationCollection.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_NetworkSecurityPerimeterConfigurationCollection.cs index d60908b90eff..be172bd728f0 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_NetworkSecurityPerimeterConfigurationCollection.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_NetworkSecurityPerimeterConfigurationCollection.cs @@ -19,7 +19,7 @@ public partial class Sample_NetworkSecurityPerimeterConfigurationCollection [Ignore("Only validating compilation of examples")] public async Task Get_NamspaceNetworkSecurityPerimeterConfigurationList() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/NetworkSecurityPerimeterConfigurationGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/NetworkSecurityPerimeterConfigurationGet.json // this example is just showing the usage of "NetworkSecurityPerimeterConfigurations_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 @@ -53,7 +53,7 @@ public async Task Get_NamspaceNetworkSecurityPerimeterConfigurationList() [Ignore("Only validating compilation of examples")] public async Task GetAll_NamspaceNetworkSecurityPerimeterConfigurationList() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/NetworkSecurityPerimeterConfigurationList.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/NetworkSecurityPerimeterConfigurationList.json // this example is just showing the usage of "NetworkSecurityPerimeterConfigurations_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 @@ -89,7 +89,7 @@ public async Task GetAll_NamspaceNetworkSecurityPerimeterConfigurationList() [Ignore("Only validating compilation of examples")] public async Task Exists_NamspaceNetworkSecurityPerimeterConfigurationList() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/NetworkSecurityPerimeterConfigurationGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/NetworkSecurityPerimeterConfigurationGet.json // this example is just showing the usage of "NetworkSecurityPerimeterConfigurations_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 @@ -119,7 +119,7 @@ public async Task Exists_NamspaceNetworkSecurityPerimeterConfigurationList() [Ignore("Only validating compilation of examples")] public async Task GetIfExists_NamspaceNetworkSecurityPerimeterConfigurationList() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/NetworkSecurityPerimeterConfigurationGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/NetworkSecurityPerimeterConfigurationGet.json // this example is just showing the usage of "NetworkSecurityPerimeterConfigurations_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_NetworkSecurityPerimeterConfigurationResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_NetworkSecurityPerimeterConfigurationResource.cs index 88f1565934d6..54782fffe00c 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_NetworkSecurityPerimeterConfigurationResource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_NetworkSecurityPerimeterConfigurationResource.cs @@ -19,7 +19,7 @@ public partial class Sample_NetworkSecurityPerimeterConfigurationResource [Ignore("Only validating compilation of examples")] public async Task Get_NamspaceNetworkSecurityPerimeterConfigurationList() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/NetworkSecurityPerimeterConfigurationGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/NetworkSecurityPerimeterConfigurationGet.json // this example is just showing the usage of "NetworkSecurityPerimeterConfigurations_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -50,7 +50,7 @@ public async Task Get_NamspaceNetworkSecurityPerimeterConfigurationList() [Ignore("Only validating compilation of examples")] public async Task Reconcile_NetworkSecurityPerimeterConfigurationList() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/NetworkSecurityPerimeterConfigurationReconcile.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/NetworkSecurityPerimeterConfigurationReconcile.json // this example is just showing the usage of "NetworkSecurityPerimeterConfigurations_Reconcile" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_RestorableCosmosDBAccountCollection.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_RestorableCosmosDBAccountCollection.cs index 9d85c808897b..90a53d09582f 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_RestorableCosmosDBAccountCollection.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_RestorableCosmosDBAccountCollection.cs @@ -19,7 +19,7 @@ public partial class Sample_RestorableCosmosDBAccountCollection [Ignore("Only validating compilation of examples")] public async Task Get_CosmosDBRestorableDatabaseAccountGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBRestorableDatabaseAccountGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/CosmosDBRestorableDatabaseAccountGet.json // this example is just showing the usage of "RestorableDatabaseAccounts_GetByLocation" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -52,7 +52,7 @@ public async Task Get_CosmosDBRestorableDatabaseAccountGet() [Ignore("Only validating compilation of examples")] public async Task GetAll_CosmosDBRestorableDatabaseAccountList() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBRestorableDatabaseAccountList.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/CosmosDBRestorableDatabaseAccountList.json // this example is just showing the usage of "RestorableDatabaseAccounts_ListByLocation" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -87,7 +87,7 @@ public async Task GetAll_CosmosDBRestorableDatabaseAccountList() [Ignore("Only validating compilation of examples")] public async Task Exists_CosmosDBRestorableDatabaseAccountGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBRestorableDatabaseAccountGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/CosmosDBRestorableDatabaseAccountGet.json // this example is just showing the usage of "RestorableDatabaseAccounts_GetByLocation" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -116,7 +116,7 @@ public async Task Exists_CosmosDBRestorableDatabaseAccountGet() [Ignore("Only validating compilation of examples")] public async Task GetIfExists_CosmosDBRestorableDatabaseAccountGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBRestorableDatabaseAccountGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/CosmosDBRestorableDatabaseAccountGet.json // this example is just showing the usage of "RestorableDatabaseAccounts_GetByLocation" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_RestorableCosmosDBAccountResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_RestorableCosmosDBAccountResource.cs index 08ae1235b143..e605ff66537b 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_RestorableCosmosDBAccountResource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_RestorableCosmosDBAccountResource.cs @@ -20,7 +20,7 @@ public partial class Sample_RestorableCosmosDBAccountResource [Ignore("Only validating compilation of examples")] public async Task Get_CosmosDBRestorableDatabaseAccountGet() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBRestorableDatabaseAccountGet.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/CosmosDBRestorableDatabaseAccountGet.json // this example is just showing the usage of "RestorableDatabaseAccounts_GetByLocation" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -50,7 +50,7 @@ public async Task Get_CosmosDBRestorableDatabaseAccountGet() [Ignore("Only validating compilation of examples")] public async Task GetRestorableSqlDatabases_CosmosDBRestorableSqlDatabaseList() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBRestorableSqlDatabaseList.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/CosmosDBRestorableSqlDatabaseList.json // this example is just showing the usage of "RestorableSqlDatabases_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 @@ -79,7 +79,7 @@ public async Task GetRestorableSqlDatabases_CosmosDBRestorableSqlDatabaseList() [Ignore("Only validating compilation of examples")] public async Task GetRestorableSqlContainers_CosmosDBRestorableSqlContainerList() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBRestorableSqlContainerList.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/CosmosDBRestorableSqlContainerList.json // this example is just showing the usage of "RestorableSqlContainers_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 @@ -109,7 +109,7 @@ public async Task GetRestorableSqlContainers_CosmosDBRestorableSqlContainerList( [Ignore("Only validating compilation of examples")] public async Task GetAllRestorableSqlResourceData_CosmosDBRestorableSqlResourceList() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBRestorableSqlResourceList.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/CosmosDBRestorableSqlResourceList.json // this example is just showing the usage of "RestorableSqlResources_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 @@ -140,7 +140,7 @@ public async Task GetAllRestorableSqlResourceData_CosmosDBRestorableSqlResourceL [Ignore("Only validating compilation of examples")] public async Task GetRestorableMongoDBDatabases_CosmosDBRestorableMongodbDatabaseList() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBRestorableMongodbDatabaseList.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/CosmosDBRestorableMongodbDatabaseList.json // this example is just showing the usage of "RestorableMongodbDatabases_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 @@ -169,7 +169,7 @@ public async Task GetRestorableMongoDBDatabases_CosmosDBRestorableMongodbDatabas [Ignore("Only validating compilation of examples")] public async Task GetRestorableMongoDBCollections_CosmosDBRestorableMongodbCollectionList() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBRestorableMongodbCollectionList.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/CosmosDBRestorableMongodbCollectionList.json // this example is just showing the usage of "RestorableMongodbCollections_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 @@ -199,7 +199,7 @@ public async Task GetRestorableMongoDBCollections_CosmosDBRestorableMongodbColle [Ignore("Only validating compilation of examples")] public async Task GetAllRestorableMongoDBResourceData_CosmosDBRestorableMongodbResourceList() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBRestorableMongodbResourceList.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/CosmosDBRestorableMongodbResourceList.json // this example is just showing the usage of "RestorableMongodbResources_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 @@ -230,7 +230,7 @@ public async Task GetAllRestorableMongoDBResourceData_CosmosDBRestorableMongodbR [Ignore("Only validating compilation of examples")] public async Task GetRestorableGremlinDatabases_CosmosDBRestorableGremlinDatabaseList() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBRestorableGremlinDatabaseList.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/CosmosDBRestorableGremlinDatabaseList.json // this example is just showing the usage of "RestorableGremlinDatabases_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 @@ -259,7 +259,7 @@ public async Task GetRestorableGremlinDatabases_CosmosDBRestorableGremlinDatabas [Ignore("Only validating compilation of examples")] public async Task GetRestorableGremlinGraphs_CosmosDBRestorableGremlinGraphList() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBRestorableGremlinGraphList.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/CosmosDBRestorableGremlinGraphList.json // this example is just showing the usage of "RestorableGremlinGraphs_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 @@ -289,7 +289,7 @@ public async Task GetRestorableGremlinGraphs_CosmosDBRestorableGremlinGraphList( [Ignore("Only validating compilation of examples")] public async Task GetRestorableGremlinResources_CosmosDBRestorableGremlinResourceList() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBRestorableGremlinResourceList.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/CosmosDBRestorableGremlinResourceList.json // this example is just showing the usage of "RestorableGremlinResources_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 @@ -320,7 +320,7 @@ public async Task GetRestorableGremlinResources_CosmosDBRestorableGremlinResourc [Ignore("Only validating compilation of examples")] public async Task GetRestorableTables_CosmosDBRestorableTableList() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBRestorableTableList.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/CosmosDBRestorableTableList.json // this example is just showing the usage of "RestorableTables_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 @@ -349,7 +349,7 @@ public async Task GetRestorableTables_CosmosDBRestorableTableList() [Ignore("Only validating compilation of examples")] public async Task GetRestorableTableResources_CosmosDBRestorableTableResourceList() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBRestorableTableResourceList.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/CosmosDBRestorableTableResourceList.json // this example is just showing the usage of "RestorableTableResources_List" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_SubscriptionResourceExtensions.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_SubscriptionResourceExtensions.cs index b3baf4982356..5dd46788a744 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_SubscriptionResourceExtensions.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_SubscriptionResourceExtensions.cs @@ -20,7 +20,7 @@ public partial class Sample_SubscriptionResourceExtensions [Ignore("Only validating compilation of examples")] public async Task GetCosmosDBAccounts_CosmosDBDatabaseAccountList() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBDatabaseAccountList.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/CosmosDBDatabaseAccountList.json // this example is just showing the usage of "DatabaseAccounts_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 @@ -51,7 +51,7 @@ public async Task GetCosmosDBAccounts_CosmosDBDatabaseAccountList() [Ignore("Only validating compilation of examples")] public async Task GetCassandraClusters_CosmosDBManagedCassandraClusterListBySubscription() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBManagedCassandraClusterListBySubscription.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/CosmosDBManagedCassandraClusterListBySubscription.json // this example is just showing the usage of "CassandraClusters_ListBySubscription" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -82,7 +82,7 @@ public async Task GetCassandraClusters_CosmosDBManagedCassandraClusterListBySubs [Ignore("Only validating compilation of examples")] public async Task GetRestorableCosmosDBAccounts_CosmosDBRestorableDatabaseAccountNoLocationList() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBRestorableDatabaseAccountNoLocationList.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/CosmosDBRestorableDatabaseAccountNoLocationList.json // this example is just showing the usage of "RestorableDatabaseAccounts_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 @@ -113,7 +113,7 @@ public async Task GetRestorableCosmosDBAccounts_CosmosDBRestorableDatabaseAccoun [Ignore("Only validating compilation of examples")] public async Task GetCosmosDBThroughputPools_CosmosDBThroughputPoolList() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/throughputPool/CosmosDBThroughputPoolList.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/throughputPool/CosmosDBThroughputPoolList.json // this example is just showing the usage of "ThroughputPools_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 @@ -139,5 +139,36 @@ public async Task GetCosmosDBThroughputPools_CosmosDBThroughputPoolList() Console.WriteLine("Succeeded"); } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetFleetResources_CosmosDBFleetListBySubscription() + { + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/fleet/CosmosDBFleetList.json + // this example is just showing the usage of "Fleet_List" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this SubscriptionResource created on azure + // for more information of creating SubscriptionResource, please refer to the document of SubscriptionResource + string subscriptionId = "ffffffff-ffff-ffff-ffff-ffffffffffff"; + ResourceIdentifier subscriptionResourceId = SubscriptionResource.CreateResourceIdentifier(subscriptionId); + SubscriptionResource subscriptionResource = client.GetSubscriptionResource(subscriptionResourceId); + + // invoke the operation and iterate over the result + await foreach (FleetResource item in subscriptionResource.GetFleetResourcesAsync()) + { + // the variable item is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + FleetResourceData resourceData = item.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + Console.WriteLine("Succeeded"); + } } } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_TenantResourceExtensions.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_TenantResourceExtensions.cs index 005c85e9a52e..0b87a6206924 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_TenantResourceExtensions.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/samples/Generated/Samples/Sample_TenantResourceExtensions.cs @@ -20,7 +20,7 @@ public partial class Sample_TenantResourceExtensions [Ignore("Only validating compilation of examples")] public async Task CheckNameExistsDatabaseAccount_CosmosDBDatabaseAccountCheckNameExists() { - // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBDatabaseAccountCheckNameExists.json + // Generated from example definition: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2025-05-01-preview/examples/CosmosDBDatabaseAccountCheckNameExists.json // this example is just showing the usage of "DatabaseAccounts_CheckNameExists" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/ArmCosmosDBModelFactory.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/ArmCosmosDBModelFactory.cs index a3e75141e860..2ad80a81506a 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/ArmCosmosDBModelFactory.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/ArmCosmosDBModelFactory.cs @@ -43,6 +43,63 @@ public static CosmosDBChaosFaultResourceData CosmosDBChaosFaultResourceData(Reso serializedAdditionalRawData: null); } + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The properties of a Copy Job. + /// A new instance for mocking. + public static CopyJobGetResultData CopyJobGetResultData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, CopyJobProperties properties = null) + { + return new CopyJobGetResultData( + id, + name, + resourceType, + systemData, + properties, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// + /// Job Properties + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include , , , , and . + /// + /// Job Status. + /// Processed Count. + /// Total Count. + /// Last Updated Time (ISO-8601 format). + /// Worker count. + /// Error response for Faulted job. + /// Total Duration of Job. + /// Mode of job execution. + /// A new instance for mocking. + public static CopyJobProperties CopyJobProperties(BaseCopyJobProperties jobProperties = null, CopyJobStatus? status = null, long? processedCount = null, long? totalCount = null, DateTimeOffset? lastUpdatedUtcOn = null, int? workerCount = null, CosmosDBErrorResult error = null, TimeSpan? duration = null, CopyJobMode? mode = null) + { + return new CopyJobProperties( + jobProperties, + status, + processedCount, + totalCount, + lastUpdatedUtcOn, + workerCount, + error, + duration, + mode, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Error code. + /// Error message indicating why the operation failed. + /// A new instance for mocking. + public static CosmosDBErrorResult CosmosDBErrorResult(string code = null, string message = null) + { + return new CosmosDBErrorResult(code, message, serializedAdditionalRawData: null); + } + /// Initializes a new instance of . /// The id. /// The name. @@ -101,9 +158,10 @@ public static CosmosDBChaosFaultResourceData CosmosDBChaosFaultResourceData(Reso /// Flag to indicate enabling/disabling of Priority Based Execution Preview feature on the account. /// Enum to indicate default Priority Level of request for Priority Based Execution. /// Flag to indicate enabling/disabling of Per-Region Per-partition autoscale Preview feature on the account. + /// Flag to indicate if All Versions and Deletes Change feed feature is enabled on the account. /// Identity for the resource. /// A new instance for mocking. - public static CosmosDBAccountData CosmosDBAccountData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, CosmosDBAccountKind? kind = null, string provisioningState = null, string documentEndpoint = null, CosmosDBAccountOfferType? databaseAccountOfferType = null, IEnumerable ipRules = null, bool? isVirtualNetworkFilterEnabled = null, bool? enableAutomaticFailover = null, ConsistencyPolicy consistencyPolicy = null, IEnumerable capabilities = null, IEnumerable writeLocations = null, IEnumerable readLocations = null, IEnumerable locations = null, IEnumerable failoverPolicies = null, IEnumerable virtualNetworkRules = null, IEnumerable privateEndpointConnections = null, bool? enableMultipleWriteLocations = null, bool? enableCassandraConnector = null, ConnectorOffer? connectorOffer = null, bool? disableKeyBasedMetadataWriteAccess = null, Uri keyVaultKeyUri = null, string defaultIdentity = null, CosmosDBPublicNetworkAccess? publicNetworkAccess = null, bool? isFreeTierEnabled = null, CosmosDBServerVersion? apiServerVersion = null, bool? isAnalyticalStorageEnabled = null, AnalyticalStorageSchemaType? analyticalStorageSchemaType = null, Guid? instanceId = null, CosmosDBAccountCreateMode? createMode = null, CosmosDBAccountRestoreParameters restoreParameters = null, CosmosDBAccountBackupPolicy backupPolicy = null, IEnumerable cors = null, NetworkAclBypass? networkAclBypass = null, IEnumerable networkAclBypassResourceIds = null, EnableFullTextQuery? diagnosticLogEnableFullTextQuery = null, bool? disableLocalAuth = null, int? capacityTotalThroughputLimit = null, CapacityMode? capacityMode = null, CapacityModeChangeTransitionState capacityModeChangeTransitionState = null, bool? enableMaterializedViews = null, DatabaseAccountKeysMetadata keysMetadata = null, bool? enablePartitionMerge = null, bool? enableBurstCapacity = null, CosmosDBMinimalTlsVersion? minimalTlsVersion = null, string customerManagedKeyStatus = null, bool? enablePriorityBasedExecution = null, DefaultPriorityLevel? defaultPriorityLevel = null, bool? enablePerRegionPerPartitionAutoscale = null, ManagedServiceIdentity identity = null) + public static CosmosDBAccountData CosmosDBAccountData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, CosmosDBAccountKind? kind = null, string provisioningState = null, string documentEndpoint = null, CosmosDBAccountOfferType? databaseAccountOfferType = null, IEnumerable ipRules = null, bool? isVirtualNetworkFilterEnabled = null, bool? enableAutomaticFailover = null, ConsistencyPolicy consistencyPolicy = null, IEnumerable capabilities = null, IEnumerable writeLocations = null, IEnumerable readLocations = null, IEnumerable locations = null, IEnumerable failoverPolicies = null, IEnumerable virtualNetworkRules = null, IEnumerable privateEndpointConnections = null, bool? enableMultipleWriteLocations = null, bool? enableCassandraConnector = null, ConnectorOffer? connectorOffer = null, bool? disableKeyBasedMetadataWriteAccess = null, Uri keyVaultKeyUri = null, string defaultIdentity = null, CosmosDBPublicNetworkAccess? publicNetworkAccess = null, bool? isFreeTierEnabled = null, CosmosDBServerVersion? apiServerVersion = null, bool? isAnalyticalStorageEnabled = null, AnalyticalStorageSchemaType? analyticalStorageSchemaType = null, Guid? instanceId = null, CosmosDBAccountCreateMode? createMode = null, CosmosDBAccountRestoreParameters restoreParameters = null, CosmosDBAccountBackupPolicy backupPolicy = null, IEnumerable cors = null, NetworkAclBypass? networkAclBypass = null, IEnumerable networkAclBypassResourceIds = null, EnableFullTextQuery? diagnosticLogEnableFullTextQuery = null, bool? disableLocalAuth = null, int? capacityTotalThroughputLimit = null, CapacityMode? capacityMode = null, CapacityModeChangeTransitionState capacityModeChangeTransitionState = null, bool? enableMaterializedViews = null, DatabaseAccountKeysMetadata keysMetadata = null, bool? enablePartitionMerge = null, bool? enableBurstCapacity = null, CosmosDBMinimalTlsVersion? minimalTlsVersion = null, string customerManagedKeyStatus = null, bool? enablePriorityBasedExecution = null, DefaultPriorityLevel? defaultPriorityLevel = null, bool? enablePerRegionPerPartitionAutoscale = null, bool? enableAllVersionsAndDeletesChangeFeed = null, ManagedServiceIdentity identity = null) { tags ??= new Dictionary(); ipRules ??= new List(); @@ -171,6 +229,7 @@ public static CosmosDBAccountData CosmosDBAccountData(ResourceIdentifier id = nu enablePriorityBasedExecution, defaultPriorityLevel, enablePerRegionPerPartitionAutoscale, + enableAllVersionsAndDeletesChangeFeed, identity, serializedAdditionalRawData: null); } @@ -313,8 +372,9 @@ public static DatabaseAccountKeysMetadata DatabaseAccountKeysMetadata(DateTimeOf /// Flag to indicate enabling/disabling of Priority Based Execution Preview feature on the account. /// Enum to indicate default Priority Level of request for Priority Based Execution. /// Flag to indicate enabling/disabling of Per-Region Per-partition autoscale Preview feature on the account. + /// Flag to indicate if All Versions and Deletes Change feed feature is enabled on the account. /// A new instance for mocking. - public static CosmosDBAccountPatch CosmosDBAccountPatch(IDictionary tags = null, AzureLocation? location = null, ManagedServiceIdentity identity = null, ConsistencyPolicy consistencyPolicy = null, IEnumerable locations = null, IEnumerable ipRules = null, bool? isVirtualNetworkFilterEnabled = null, bool? enableAutomaticFailover = null, IEnumerable capabilities = null, IEnumerable virtualNetworkRules = null, bool? enableMultipleWriteLocations = null, bool? enableCassandraConnector = null, ConnectorOffer? connectorOffer = null, bool? disableKeyBasedMetadataWriteAccess = null, Uri keyVaultKeyUri = null, string defaultIdentity = null, CosmosDBPublicNetworkAccess? publicNetworkAccess = null, bool? isFreeTierEnabled = null, CosmosDBServerVersion? apiServerVersion = null, bool? isAnalyticalStorageEnabled = null, AnalyticalStorageSchemaType? analyticalStorageSchemaType = null, CosmosDBAccountBackupPolicy backupPolicy = null, IEnumerable cors = null, NetworkAclBypass? networkAclBypass = null, IEnumerable networkAclBypassResourceIds = null, EnableFullTextQuery? diagnosticLogEnableFullTextQuery = null, bool? disableLocalAuth = null, int? capacityTotalThroughputLimit = null, CapacityMode? capacityMode = null, bool? enableMaterializedViews = null, DatabaseAccountKeysMetadata keysMetadata = null, bool? enablePartitionMerge = null, bool? enableBurstCapacity = null, CosmosDBMinimalTlsVersion? minimalTlsVersion = null, string customerManagedKeyStatus = null, bool? enablePriorityBasedExecution = null, DefaultPriorityLevel? defaultPriorityLevel = null, bool? enablePerRegionPerPartitionAutoscale = null) + public static CosmosDBAccountPatch CosmosDBAccountPatch(IDictionary tags = null, AzureLocation? location = null, ManagedServiceIdentity identity = null, ConsistencyPolicy consistencyPolicy = null, IEnumerable locations = null, IEnumerable ipRules = null, bool? isVirtualNetworkFilterEnabled = null, bool? enableAutomaticFailover = null, IEnumerable capabilities = null, IEnumerable virtualNetworkRules = null, bool? enableMultipleWriteLocations = null, bool? enableCassandraConnector = null, ConnectorOffer? connectorOffer = null, bool? disableKeyBasedMetadataWriteAccess = null, Uri keyVaultKeyUri = null, string defaultIdentity = null, CosmosDBPublicNetworkAccess? publicNetworkAccess = null, bool? isFreeTierEnabled = null, CosmosDBServerVersion? apiServerVersion = null, bool? isAnalyticalStorageEnabled = null, AnalyticalStorageSchemaType? analyticalStorageSchemaType = null, CosmosDBAccountBackupPolicy backupPolicy = null, IEnumerable cors = null, NetworkAclBypass? networkAclBypass = null, IEnumerable networkAclBypassResourceIds = null, EnableFullTextQuery? diagnosticLogEnableFullTextQuery = null, bool? disableLocalAuth = null, int? capacityTotalThroughputLimit = null, CapacityMode? capacityMode = null, bool? enableMaterializedViews = null, DatabaseAccountKeysMetadata keysMetadata = null, bool? enablePartitionMerge = null, bool? enableBurstCapacity = null, CosmosDBMinimalTlsVersion? minimalTlsVersion = null, string customerManagedKeyStatus = null, bool? enablePriorityBasedExecution = null, DefaultPriorityLevel? defaultPriorityLevel = null, bool? enablePerRegionPerPartitionAutoscale = null, bool? enableAllVersionsAndDeletesChangeFeed = null) { tags ??= new Dictionary(); locations ??= new List(); @@ -363,6 +423,7 @@ public static CosmosDBAccountPatch CosmosDBAccountPatch(IDictionary Flag to indicate enabling/disabling of Priority Based Execution Preview feature on the account. /// Enum to indicate default Priority Level of request for Priority Based Execution. /// Flag to indicate enabling/disabling of Per-Region Per-partition autoscale Preview feature on the account. + /// Flag to indicate if All Versions and Deletes Change feed feature is enabled on the account. /// Identity for the resource. /// A new instance for mocking. - public static CosmosDBAccountCreateOrUpdateContent CosmosDBAccountCreateOrUpdateContent(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, CosmosDBAccountKind? kind = null, ConsistencyPolicy consistencyPolicy = null, IEnumerable locations = null, CosmosDBAccountOfferType databaseAccountOfferType = default, IEnumerable ipRules = null, bool? isVirtualNetworkFilterEnabled = null, bool? enableAutomaticFailover = null, IEnumerable capabilities = null, IEnumerable virtualNetworkRules = null, bool? enableMultipleWriteLocations = null, bool? enableCassandraConnector = null, ConnectorOffer? connectorOffer = null, bool? disableKeyBasedMetadataWriteAccess = null, Uri keyVaultKeyUri = null, string defaultIdentity = null, CosmosDBPublicNetworkAccess? publicNetworkAccess = null, bool? isFreeTierEnabled = null, CosmosDBServerVersion? apiServerVersion = null, bool? isAnalyticalStorageEnabled = null, AnalyticalStorageSchemaType? analyticalStorageSchemaType = null, CosmosDBAccountCreateMode? createMode = null, CosmosDBAccountBackupPolicy backupPolicy = null, IEnumerable cors = null, NetworkAclBypass? networkAclBypass = null, IEnumerable networkAclBypassResourceIds = null, EnableFullTextQuery? diagnosticLogEnableFullTextQuery = null, bool? disableLocalAuth = null, CosmosDBAccountRestoreParameters restoreParameters = null, int? capacityTotalThroughputLimit = null, CapacityMode? capacityMode = null, bool? enableMaterializedViews = null, DatabaseAccountKeysMetadata keysMetadata = null, bool? enablePartitionMerge = null, bool? enableBurstCapacity = null, CosmosDBMinimalTlsVersion? minimalTlsVersion = null, string customerManagedKeyStatus = null, bool? enablePriorityBasedExecution = null, DefaultPriorityLevel? defaultPriorityLevel = null, bool? enablePerRegionPerPartitionAutoscale = null, ManagedServiceIdentity identity = null) + public static CosmosDBAccountCreateOrUpdateContent CosmosDBAccountCreateOrUpdateContent(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, CosmosDBAccountKind? kind = null, ConsistencyPolicy consistencyPolicy = null, IEnumerable locations = null, CosmosDBAccountOfferType databaseAccountOfferType = default, IEnumerable ipRules = null, bool? isVirtualNetworkFilterEnabled = null, bool? enableAutomaticFailover = null, IEnumerable capabilities = null, IEnumerable virtualNetworkRules = null, bool? enableMultipleWriteLocations = null, bool? enableCassandraConnector = null, ConnectorOffer? connectorOffer = null, bool? disableKeyBasedMetadataWriteAccess = null, Uri keyVaultKeyUri = null, string defaultIdentity = null, CosmosDBPublicNetworkAccess? publicNetworkAccess = null, bool? isFreeTierEnabled = null, CosmosDBServerVersion? apiServerVersion = null, bool? isAnalyticalStorageEnabled = null, AnalyticalStorageSchemaType? analyticalStorageSchemaType = null, CosmosDBAccountCreateMode? createMode = null, CosmosDBAccountBackupPolicy backupPolicy = null, IEnumerable cors = null, NetworkAclBypass? networkAclBypass = null, IEnumerable networkAclBypassResourceIds = null, EnableFullTextQuery? diagnosticLogEnableFullTextQuery = null, bool? disableLocalAuth = null, CosmosDBAccountRestoreParameters restoreParameters = null, int? capacityTotalThroughputLimit = null, CapacityMode? capacityMode = null, bool? enableMaterializedViews = null, DatabaseAccountKeysMetadata keysMetadata = null, bool? enablePartitionMerge = null, bool? enableBurstCapacity = null, CosmosDBMinimalTlsVersion? minimalTlsVersion = null, string customerManagedKeyStatus = null, bool? enablePriorityBasedExecution = null, DefaultPriorityLevel? defaultPriorityLevel = null, bool? enablePerRegionPerPartitionAutoscale = null, bool? enableAllVersionsAndDeletesChangeFeed = null, ManagedServiceIdentity identity = null) { tags ??= new Dictionary(); locations ??= new List(); @@ -474,6 +536,7 @@ public static CosmosDBAccountCreateOrUpdateContent CosmosDBAccountCreateOrUpdate enablePriorityBasedExecution, defaultPriorityLevel, enablePerRegionPerPartitionAutoscale, + enableAllVersionsAndDeletesChangeFeed, identity, serializedAdditionalRawData: null); } @@ -509,15 +572,6 @@ public static CosmosDBAccountConnectionString CosmosDBAccountConnectionString(st return new CosmosDBAccountConnectionString(connectionString, description, keyKind, keyType, serializedAdditionalRawData: null); } - /// Initializes a new instance of . - /// Error code. - /// Error message indicating why the operation failed. - /// A new instance for mocking. - public static CosmosDBErrorResult CosmosDBErrorResult(string code = null, string message = null) - { - return new CosmosDBErrorResult(code, message, serializedAdditionalRawData: null); - } - /// Initializes a new instance of . /// The start time for the metric (ISO-8601 format). /// The end time for the metric (ISO-8601 format). @@ -1052,15 +1106,18 @@ public static CosmosDBSqlContainerData CosmosDBSqlContainerData(ResourceIdentifi /// Parameters to indicate the information about the restore. /// Enum to indicate the mode of resource creation. /// The configuration for defining Materialized Views. This must be specified only for creating a Materialized View container. + /// Materialized Views defined on the container. /// List of computed properties. /// The vector embedding policy for the container. + /// The FullText policy for the container. /// A system generated property. A unique identifier. /// A system generated property that denotes the last updated timestamp of the resource. /// A system generated property representing the resource etag required for optimistic concurrency control. /// A new instance for mocking. - public static ExtendedCosmosDBSqlContainerResourceInfo ExtendedCosmosDBSqlContainerResourceInfo(string containerName = null, CosmosDBIndexingPolicy indexingPolicy = null, CosmosDBContainerPartitionKey partitionKey = null, int? defaultTtl = null, IEnumerable uniqueKeys = null, ConflictResolutionPolicy conflictResolutionPolicy = null, CosmosDBClientEncryptionPolicy clientEncryptionPolicy = null, long? analyticalStorageTtl = null, ResourceRestoreParameters restoreParameters = null, CosmosDBAccountCreateMode? createMode = null, MaterializedViewDefinition materializedViewDefinition = null, IEnumerable computedProperties = null, IEnumerable vectorEmbeddings = null, string rid = null, float? timestamp = null, ETag? etag = null) + public static ExtendedCosmosDBSqlContainerResourceInfo ExtendedCosmosDBSqlContainerResourceInfo(string containerName = null, CosmosDBIndexingPolicy indexingPolicy = null, CosmosDBContainerPartitionKey partitionKey = null, int? defaultTtl = null, IEnumerable uniqueKeys = null, ConflictResolutionPolicy conflictResolutionPolicy = null, CosmosDBClientEncryptionPolicy clientEncryptionPolicy = null, long? analyticalStorageTtl = null, ResourceRestoreParameters restoreParameters = null, CosmosDBAccountCreateMode? createMode = null, MaterializedViewDefinition materializedViewDefinition = null, IEnumerable materializedViews = null, IEnumerable computedProperties = null, IEnumerable vectorEmbeddings = null, FullTextPolicy fullTextPolicy = null, string rid = null, float? timestamp = null, ETag? etag = null) { uniqueKeys ??= new List(); + materializedViews ??= new List(); computedProperties ??= new List(); vectorEmbeddings ??= new List(); @@ -1076,8 +1133,10 @@ public static ExtendedCosmosDBSqlContainerResourceInfo ExtendedCosmosDBSqlContai restoreParameters, createMode, materializedViewDefinition, + materializedViews?.ToList(), computedProperties?.ToList(), vectorEmbeddings != null ? new VectorEmbeddingPolicy(vectorEmbeddings?.ToList(), serializedAdditionalRawData: null) : null, + fullTextPolicy, serializedAdditionalRawData: null, rid, timestamp, @@ -2933,16 +2992,19 @@ public static ExtendedRestorableSqlContainerResourceInfo ExtendedRestorableSqlCo /// Parameters to indicate the information about the restore. /// Enum to indicate the mode of resource creation. /// The configuration for defining Materialized Views. This must be specified only for creating a Materialized View container. + /// Materialized Views defined on the container. /// List of computed properties. /// The vector embedding policy for the container. + /// The FullText policy for the container. /// A system generated property that specifies the addressable path of the container resource. /// A system generated property. A unique identifier. /// A system generated property that denotes the last updated timestamp of the resource. /// A system generated property representing the resource etag required for optimistic concurrency control. /// A new instance for mocking. - public static RestorableSqlContainerPropertiesResourceContainer RestorableSqlContainerPropertiesResourceContainer(string containerName = null, CosmosDBIndexingPolicy indexingPolicy = null, CosmosDBContainerPartitionKey partitionKey = null, int? defaultTtl = null, IEnumerable uniqueKeys = null, ConflictResolutionPolicy conflictResolutionPolicy = null, CosmosDBClientEncryptionPolicy clientEncryptionPolicy = null, long? analyticalStorageTtl = null, ResourceRestoreParameters restoreParameters = null, CosmosDBAccountCreateMode? createMode = null, MaterializedViewDefinition materializedViewDefinition = null, IEnumerable computedProperties = null, IEnumerable vectorEmbeddings = null, string self = null, string rid = null, float? timestamp = null, ETag? etag = null) + public static RestorableSqlContainerPropertiesResourceContainer RestorableSqlContainerPropertiesResourceContainer(string containerName = null, CosmosDBIndexingPolicy indexingPolicy = null, CosmosDBContainerPartitionKey partitionKey = null, int? defaultTtl = null, IEnumerable uniqueKeys = null, ConflictResolutionPolicy conflictResolutionPolicy = null, CosmosDBClientEncryptionPolicy clientEncryptionPolicy = null, long? analyticalStorageTtl = null, ResourceRestoreParameters restoreParameters = null, CosmosDBAccountCreateMode? createMode = null, MaterializedViewDefinition materializedViewDefinition = null, IEnumerable materializedViews = null, IEnumerable computedProperties = null, IEnumerable vectorEmbeddings = null, FullTextPolicy fullTextPolicy = null, string self = null, string rid = null, float? timestamp = null, ETag? etag = null) { uniqueKeys ??= new List(); + materializedViews ??= new List(); computedProperties ??= new List(); vectorEmbeddings ??= new List(); @@ -2958,8 +3020,10 @@ public static RestorableSqlContainerPropertiesResourceContainer RestorableSqlCon restoreParameters, createMode, materializedViewDefinition, + materializedViews?.ToList(), computedProperties?.ToList(), vectorEmbeddings != null ? new VectorEmbeddingPolicy(vectorEmbeddings?.ToList(), serializedAdditionalRawData: null) : null, + fullTextPolicy, serializedAdditionalRawData: null, self, rid, @@ -3286,6 +3350,59 @@ public static CosmosDBServiceProperties CosmosDBServiceProperties(DateTimeOffset additionalProperties); } + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The path id for the Role Definition. + /// A user-friendly name for the Role Definition. Must be unique for the database account. + /// Indicates whether the Role Definition was built-in or user created. + /// A set of fully qualified Scopes at or below which Table Role Assignments may be created using this Role Definition. This will allow application of this Role Definition on the entire database account or any underlying Database / Collection. Must have at least one element. Scopes higher than Database account are not enforceable as assignable Scopes. Note that resources referenced in assignable Scopes need not exist. + /// The set of operations allowed through this Role Definition. + /// A new instance for mocking. + public static CosmosDBTableRoleDefinitionData CosmosDBTableRoleDefinitionData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, string pathId = null, string roleName = null, CosmosDBSqlRoleDefinitionType? roleDefinitionType = null, IEnumerable assignableScopes = null, IEnumerable permissions = null) + { + assignableScopes ??= new List(); + permissions ??= new List(); + + return new CosmosDBTableRoleDefinitionData( + id, + name, + resourceType, + systemData, + pathId, + roleName, + roleDefinitionType, + assignableScopes?.ToList(), + permissions?.ToList(), + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The unique identifier for the associated Role Definition. + /// The data plane resource path for which access is being granted through this Table Role Assignment. + /// The unique identifier for the associated AAD principal in the AAD graph to which access is being granted through this Table Role Assignment. Tenant ID for the principal is inferred using the tenant associated with the subscription. + /// Provisioning state of the resource. + /// A new instance for mocking. + public static CosmosDBTableRoleAssignmentData CosmosDBTableRoleAssignmentData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, ResourceIdentifier roleDefinitionId = null, ResourceIdentifier scope = null, Guid? principalId = null, string provisioningState = null) + { + return new CosmosDBTableRoleAssignmentData( + id, + name, + resourceType, + systemData, + roleDefinitionId, + scope, + principalId, + provisioningState, + serializedAdditionalRawData: null); + } + /// Initializes a new instance of . /// The id. /// The name. @@ -3336,48 +3453,101 @@ public static CosmosDBThroughputPoolAccountData CosmosDBThroughputPoolAccountDat serializedAdditionalRawData: null); } - /// Initializes a new instance of . + /// Initializes a new instance of . /// The id. /// The name. /// The resourceType. /// The systemData. - /// The path id for the Role Definition. + /// The path id for the Role Definition. /// A user-friendly name for the Role Definition. Must be unique for the database account. - /// Indicates whether the Role Definition was built-in or user created. - /// A set of fully qualified Scopes at or below which Table Role Assignments may be created using this Role Definition. This will allow application of this Role Definition on the entire database account or any underlying Database / Collection. Must have at least one element. Scopes higher than Database account are not enforceable as assignable Scopes. Note that resources referenced in assignable Scopes need not exist. + /// Indicates whether the Role Definition was built-in or user created. + /// A set of fully qualified Scopes at or below which Cassandra Role Assignments may be created using this Role Definition. This will allow application of this Role Definition on the entire database account or any underlying Database / Collection. Must have at least one element. Scopes higher than Database account are not enforceable as assignable Scopes. Note that resources referenced in assignable Scopes need not exist. /// The set of operations allowed through this Role Definition. - /// A new instance for mocking. - public static CosmosDBTableRoleDefinitionData CosmosDBTableRoleDefinitionData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, string pathId = null, string roleName = null, CosmosDBSqlRoleDefinitionType? roleDefinitionType = null, IEnumerable assignableScopes = null, IEnumerable permissions = null) + /// A new instance for mocking. + public static CassandraRoleDefinitionResourceData CassandraRoleDefinitionResourceData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, string idPropertiesId = null, string roleName = null, CosmosDBSqlRoleDefinitionType? typePropertiesType = null, IEnumerable assignableScopes = null, IEnumerable permissions = null) { assignableScopes ??= new List(); - permissions ??= new List(); + permissions ??= new List(); - return new CosmosDBTableRoleDefinitionData( + return new CassandraRoleDefinitionResourceData( id, name, resourceType, systemData, - pathId, + idPropertiesId, roleName, - roleDefinitionType, + typePropertiesType, assignableScopes?.ToList(), permissions?.ToList(), serializedAdditionalRawData: null); } - /// Initializes a new instance of . + /// Initializes a new instance of . /// The id. /// The name. /// The resourceType. /// The systemData. /// The unique identifier for the associated Role Definition. - /// The data plane resource path for which access is being granted through this Table Role Assignment. - /// The unique identifier for the associated AAD principal in the AAD graph to which access is being granted through this Table Role Assignment. Tenant ID for the principal is inferred using the tenant associated with the subscription. + /// The data plane resource path for which access is being granted through this Cassandra Role Assignment. + /// The unique identifier for the associated AAD principal in the AAD graph to which access is being granted through this Cassandra Role Assignment. Tenant ID for the principal is inferred using the tenant associated with the subscription. /// Provisioning state of the resource. - /// A new instance for mocking. - public static CosmosDBTableRoleAssignmentData CosmosDBTableRoleAssignmentData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, ResourceIdentifier roleDefinitionId = null, ResourceIdentifier scope = null, Guid? principalId = null, string provisioningState = null) + /// A new instance for mocking. + public static CassandraRoleAssignmentResourceData CassandraRoleAssignmentResourceData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, string roleDefinitionId = null, string scope = null, Guid? principalId = null, string provisioningState = null) { - return new CosmosDBTableRoleAssignmentData( + return new CassandraRoleAssignmentResourceData( + id, + name, + resourceType, + systemData, + roleDefinitionId, + scope, + principalId, + provisioningState, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The path id for the Role Definition. + /// A user-friendly name for the Role Definition. Must be unique for the database account. + /// Indicates whether the Role Definition was built-in or user created. + /// A set of fully qualified Scopes at or below which MongoMI Role Assignments may be created using this Role Definition. This will allow application of this Role Definition on the entire database account or any underlying Database / Collection. Must have at least one element. Scopes higher than Database account are not enforceable as assignable Scopes. Note that resources referenced in assignable Scopes need not exist. + /// The set of operations allowed through this Role Definition. + /// A new instance for mocking. + public static MongoMIRoleDefinitionResourceData MongoMIRoleDefinitionResourceData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, string idPropertiesId = null, string roleName = null, CosmosDBSqlRoleDefinitionType? typePropertiesType = null, IEnumerable assignableScopes = null, IEnumerable permissions = null) + { + assignableScopes ??= new List(); + permissions ??= new List(); + + return new MongoMIRoleDefinitionResourceData( + id, + name, + resourceType, + systemData, + idPropertiesId, + roleName, + typePropertiesType, + assignableScopes?.ToList(), + permissions?.ToList(), + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The unique identifier for the associated Role Definition. + /// The data plane resource path for which access is being granted through this MongoMI Role Assignment. + /// The unique identifier for the associated AAD principal in the AAD graph to which access is being granted through this MongoMI Role Assignment. Tenant ID for the principal is inferred using the tenant associated with the subscription. + /// Provisioning state of the resource. + /// A new instance for mocking. + public static MongoMIRoleAssignmentResourceData MongoMIRoleAssignmentResourceData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, string roleDefinitionId = null, string scope = null, Guid? principalId = null, string provisioningState = null) + { + return new MongoMIRoleAssignmentResourceData( id, name, resourceType, @@ -3389,6 +3559,224 @@ public static CosmosDBTableRoleAssignmentData CosmosDBTableRoleAssignmentData(Re serializedAdditionalRawData: null); } + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The path id for the Role Definition. + /// A user-friendly name for the Role Definition. Must be unique for the database account. + /// Indicates whether the Role Definition was built-in or user created. + /// A set of fully qualified Scopes at or below which Gremlin Role Assignments may be created using this Role Definition. This will allow application of this Role Definition on the entire database account or any underlying Database / Collection. Must have at least one element. Scopes higher than Database account are not enforceable as assignable Scopes. Note that resources referenced in assignable Scopes need not exist. + /// The set of operations allowed through this Role Definition. + /// A new instance for mocking. + public static GremlinRoleDefinitionResourceData GremlinRoleDefinitionResourceData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, string idPropertiesId = null, string roleName = null, CosmosDBSqlRoleDefinitionType? typePropertiesType = null, IEnumerable assignableScopes = null, IEnumerable permissions = null) + { + assignableScopes ??= new List(); + permissions ??= new List(); + + return new GremlinRoleDefinitionResourceData( + id, + name, + resourceType, + systemData, + idPropertiesId, + roleName, + typePropertiesType, + assignableScopes?.ToList(), + permissions?.ToList(), + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The unique identifier for the associated Role Definition. + /// The data plane resource path for which access is being granted through this Gremlin Role Assignment. + /// The unique identifier for the associated AAD principal in the AAD graph to which access is being granted through this Gremlin Role Assignment. Tenant ID for the principal is inferred using the tenant associated with the subscription. + /// Provisioning state of the resource. + /// A new instance for mocking. + public static GremlinRoleAssignmentResourceData GremlinRoleAssignmentResourceData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, string roleDefinitionId = null, string scope = null, Guid? principalId = null, string provisioningState = null) + { + return new GremlinRoleAssignmentResourceData( + id, + name, + resourceType, + systemData, + roleDefinitionId, + scope, + principalId, + provisioningState, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The tags. + /// The location. + /// A provisioning state of the Fleet. + /// A new instance for mocking. + public static FleetResourceData FleetResourceData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, CosmosDBStatus? provisioningState = null) + { + tags ??= new Dictionary(); + + return new FleetResourceData( + id, + name, + resourceType, + systemData, + tags, + location, + provisioningState, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// A provisioning state of the FleetAnalytics. + /// The type of the fleet analytics resource. + /// The unique identifier of the fleet analytics resource. + /// A new instance for mocking. + public static FleetAnalyticsResourceData FleetAnalyticsResourceData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, CosmosDBStatus? provisioningState = null, FleetAnalyticsPropertiesStorageLocationType? storageLocationType = null, Uri storageLocationUri = null) + { + return new FleetAnalyticsResourceData( + id, + name, + resourceType, + systemData, + provisioningState, + storageLocationType, + storageLocationUri, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// A provisioning state of the Fleetspace. + /// The kind of API this fleetspace belongs to. Acceptable values: 'NoSQL'. + /// Configuration for throughput pool in the fleetspace. + /// A new instance for mocking. + public static FleetspaceResourceData FleetspaceResourceData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, CosmosDBStatus? provisioningState = null, FleetspacePropertiesFleetspaceApiKind? fleetspaceApiKind = null, FleetspacePropertiesThroughputPoolConfiguration throughputPoolConfiguration = null) + { + return new FleetspaceResourceData( + id, + name, + resourceType, + systemData, + provisioningState, + fleetspaceApiKind, + throughputPoolConfiguration, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// A provisioning state of the Fleetspace Account. + /// The resource identifier of global database account in the Fleetspace Account. + /// The location of global database account in the Fleetspace Account. + /// A new instance for mocking. + public static FleetspaceAccountResourceData FleetspaceAccountResourceData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, CosmosDBStatus? provisioningState = null, string accountResourceIdentifier = null, string accountLocation = null) + { + return new FleetspaceAccountResourceData( + id, + name, + resourceType, + systemData, + provisioningState, + accountResourceIdentifier, + accountLocation, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Task level Total Count. + /// Task level Processed Count. + /// A new instance for mocking. + public static BaseCopyJobTask BaseCopyJobTask(long? totalCount = null, long? processedCount = null) + { + return new BaseCopyJobTask(totalCount, processedCount, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Task level Total Count. + /// Task level Processed Count. + /// Source Azure Blob container. + /// Destination Cassandra table. + /// A new instance for mocking. + public static BlobToCassandraRUCopyJobTask BlobToCassandraRUCopyJobTask(long? totalCount = null, long? processedCount = null, string sourceContainerName = null, CosmosDBCassandraTable destination = null) + { + return new BlobToCassandraRUCopyJobTask(totalCount, processedCount, serializedAdditionalRawData: null, sourceContainerName != null ? new AzureBlobContainer(sourceContainerName, serializedAdditionalRawData: null) : null, destination); + } + + /// Initializes a new instance of . + /// Task level Total Count. + /// Task level Processed Count. + /// Source Cassandra table. + /// Destination Azure Blob container. + /// A new instance for mocking. + public static CassandraRUToBlobCopyJobTask CassandraRUToBlobCopyJobTask(long? totalCount = null, long? processedCount = null, CosmosDBCassandraTable source = null, string destinationContainerName = null) + { + return new CassandraRUToBlobCopyJobTask(totalCount, processedCount, serializedAdditionalRawData: null, source, destinationContainerName != null ? new AzureBlobContainer(destinationContainerName, serializedAdditionalRawData: null) : null); + } + + /// Initializes a new instance of . + /// Task level Total Count. + /// Task level Processed Count. + /// Source Cassandra table. + /// Destination Cassandra table. + /// A new instance for mocking. + public static CassandraRUToCassandraRUCopyJobTask CassandraRUToCassandraRUCopyJobTask(long? totalCount = null, long? processedCount = null, CosmosDBCassandraTable source = null, CosmosDBCassandraTable destination = null) + { + return new CassandraRUToCassandraRUCopyJobTask(totalCount, processedCount, serializedAdditionalRawData: null, source, destination); + } + + /// Initializes a new instance of . + /// Task level Total Count. + /// Task level Processed Count. + /// Source Mongo (RU) collection. + /// Destination Mongo (RU) collection. + /// A new instance for mocking. + public static MongoRUToMongoRUCopyJobTask MongoRUToMongoRUCopyJobTask(long? totalCount = null, long? processedCount = null, CosmosDBMongoCollection source = null, CosmosDBMongoCollection destination = null) + { + return new MongoRUToMongoRUCopyJobTask(totalCount, processedCount, serializedAdditionalRawData: null, source, destination); + } + + /// Initializes a new instance of . + /// Task level Total Count. + /// Task level Processed Count. + /// Source Mongo (RU) collection. + /// Destination Mongo (vCore) collection. + /// A new instance for mocking. + public static MongoRUToMongoVCoreCopyJobTask MongoRUToMongoVCoreCopyJobTask(long? totalCount = null, long? processedCount = null, CosmosDBMongoCollection source = null, CosmosDBMongoVCoreCollection destination = null) + { + return new MongoRUToMongoVCoreCopyJobTask(totalCount, processedCount, serializedAdditionalRawData: null, source, destination); + } + + /// Initializes a new instance of . + /// Task level Total Count. + /// Task level Processed Count. + /// Source SQL container. + /// Destination SQL container. + /// A new instance for mocking. + public static NoSqlRUToNoSqlRUCopyJobTask NoSqlRUToNoSqlRUCopyJobTask(long? totalCount = null, long? processedCount = null, CosmosDBNoSqlContainer source = null, CosmosDBNoSqlContainer destination = null) + { + return new NoSqlRUToNoSqlRUCopyJobTask(totalCount, processedCount, serializedAdditionalRawData: null, source, destination); + } + /// Initializes a new instance of . /// Time of the last state change (ISO-8601 format). /// Instance type for the service. diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraClusterCollection.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraClusterCollection.cs index 57fccb23c383..999e29de7529 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraClusterCollection.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraClusterCollection.cs @@ -65,7 +65,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -114,7 +114,7 @@ public virtual async Task> CreateOrUpdate /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -163,7 +163,7 @@ public virtual ArmOperation CreateOrUpdate(WaitUntil w /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -208,7 +208,7 @@ public virtual async Task> GetAsync(string cl /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -253,7 +253,7 @@ public virtual Response Get(string clusterName, Cancel /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -282,7 +282,7 @@ public virtual AsyncPageable GetAllAsync(CancellationT /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -311,7 +311,7 @@ public virtual Pageable GetAll(CancellationToken cance /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -354,7 +354,7 @@ public virtual async Task> ExistsAsync(string clusterName, Cancel /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -397,7 +397,7 @@ public virtual Response Exists(string clusterName, CancellationToken cance /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -442,7 +442,7 @@ public virtual async Task> GetIfExist /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraClusterResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraClusterResource.cs index 149e76ecbdb3..7025f75ecbec 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraClusterResource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraClusterResource.cs @@ -111,7 +111,7 @@ public virtual CassandraDataCenterCollection GetCassandraDataCenters() /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -142,7 +142,7 @@ public virtual async Task> GetCassandraDat /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -173,7 +173,7 @@ public virtual Response GetCassandraDataCenter(stri /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -213,7 +213,7 @@ public virtual async Task> GetAsync(Cancellat /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -253,7 +253,7 @@ public virtual Response Get(CancellationToken cancella /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -295,7 +295,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -337,7 +337,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -383,7 +383,7 @@ public virtual async Task> UpdateAsync(Wa /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -429,7 +429,7 @@ public virtual ArmOperation Update(WaitUntil waitUntil /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -475,7 +475,7 @@ public virtual async Task> InvokeCommandAsy /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -521,7 +521,7 @@ public virtual ArmOperation InvokeCommand(WaitUntil wait /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -550,7 +550,7 @@ public virtual AsyncPageable GetCommandAsync(Cancellati /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -579,7 +579,7 @@ public virtual Pageable GetCommand(CancellationToken ca /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -622,7 +622,7 @@ public virtual async Task> GetCommandAsyncAsyn /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -665,7 +665,7 @@ public virtual Response GetCommandAsync(string commandI /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -694,7 +694,7 @@ public virtual AsyncPageable GetBackupsAsync /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -723,7 +723,7 @@ public virtual Pageable GetBackups(Cancellat /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -766,7 +766,7 @@ public virtual async Task> GetBacku /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -809,7 +809,7 @@ public virtual Response GetBackup(string bac /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -852,7 +852,7 @@ public virtual async Task DeallocateAsync(WaitUntil waitUntil, str /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -895,7 +895,7 @@ public virtual ArmOperation Deallocate(WaitUntil waitUntil, string xMsForceDeall /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -937,7 +937,7 @@ public virtual async Task StartAsync(WaitUntil waitUntil, Cancella /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -979,7 +979,7 @@ public virtual ArmOperation Start(WaitUntil waitUntil, CancellationToken cancell /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -1017,7 +1017,7 @@ public virtual async Task> StatusAsync(Ca /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -1055,7 +1055,7 @@ public virtual Response Status(CancellationToken c /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -1117,7 +1117,7 @@ public virtual async Task> AddTagAsync(string /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -1179,7 +1179,7 @@ public virtual Response AddTag(string key, string valu /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -1236,7 +1236,7 @@ public virtual async Task> SetTagsAsync(IDict /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -1293,7 +1293,7 @@ public virtual Response SetTags(IDictionary /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -1353,7 +1353,7 @@ public virtual async Task> RemoveTagAsync(str /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraDataCenterCollection.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraDataCenterCollection.cs index e8332053ee9e..1e9cfbf3efda 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraDataCenterCollection.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraDataCenterCollection.cs @@ -64,7 +64,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -113,7 +113,7 @@ public virtual async Task> CreateOrUpd /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -162,7 +162,7 @@ public virtual ArmOperation CreateOrUpdate(WaitUnti /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -207,7 +207,7 @@ public virtual async Task> GetAsync(string /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -252,7 +252,7 @@ public virtual Response Get(string dataCenterName, /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -281,7 +281,7 @@ public virtual AsyncPageable GetAllAsync(Cancellati /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -310,7 +310,7 @@ public virtual Pageable GetAll(CancellationToken ca /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -353,7 +353,7 @@ public virtual async Task> ExistsAsync(string dataCenterName, Can /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -396,7 +396,7 @@ public virtual Response Exists(string dataCenterName, CancellationToken ca /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -441,7 +441,7 @@ public virtual async Task> GetIfEx /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraDataCenterResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraDataCenterResource.cs index b23ae7e6ec36..e1b465498d16 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraDataCenterResource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraDataCenterResource.cs @@ -101,7 +101,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -141,7 +141,7 @@ public virtual async Task> GetAsync(Cancel /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -181,7 +181,7 @@ public virtual Response Get(CancellationToken cance /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -223,7 +223,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -265,7 +265,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -311,7 +311,7 @@ public virtual async Task> UpdateAsync /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraKeyspaceCollection.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraKeyspaceCollection.cs index 90e2f3071a53..fd8d09dab93a 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraKeyspaceCollection.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraKeyspaceCollection.cs @@ -65,7 +65,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -114,7 +114,7 @@ public virtual async Task> CreateOrUpdat /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -163,7 +163,7 @@ public virtual ArmOperation CreateOrUpdate(WaitUntil /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -208,7 +208,7 @@ public virtual async Task> GetAsync(string k /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -253,7 +253,7 @@ public virtual Response Get(string keyspaceName, Canc /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -282,7 +282,7 @@ public virtual AsyncPageable GetAllAsync(Cancellation /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -311,7 +311,7 @@ public virtual Pageable GetAll(CancellationToken canc /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -354,7 +354,7 @@ public virtual async Task> ExistsAsync(string keyspaceName, Cance /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -397,7 +397,7 @@ public virtual Response Exists(string keyspaceName, CancellationToken canc /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -442,7 +442,7 @@ public virtual async Task> GetIfExis /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraKeyspaceResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraKeyspaceResource.cs index 74d0c3e71e20..352a45091e9b 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraKeyspaceResource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraKeyspaceResource.cs @@ -117,7 +117,7 @@ public virtual CassandraTableCollection GetCassandraTables() /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -148,7 +148,7 @@ public virtual async Task> GetCassandraTableAsy /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -186,7 +186,7 @@ public virtual CassandraViewGetResultCollection GetCassandraViewGetResults() /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -217,7 +217,7 @@ public virtual async Task> GetCassandra /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -248,7 +248,7 @@ public virtual Response GetCassandraViewGetResul /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -288,7 +288,7 @@ public virtual async Task> GetAsync(Cancella /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -328,7 +328,7 @@ public virtual Response Get(CancellationToken cancell /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -370,7 +370,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -412,7 +412,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -458,7 +458,7 @@ public virtual async Task> UpdateAsync(W /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -504,7 +504,7 @@ public virtual ArmOperation Update(WaitUntil waitUnti /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -566,7 +566,7 @@ public virtual async Task> AddTagAsync(strin /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -628,7 +628,7 @@ public virtual Response AddTag(string key, string val /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -685,7 +685,7 @@ public virtual async Task> SetTagsAsync(IDic /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -742,7 +742,7 @@ public virtual Response SetTags(IDictionary /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -802,7 +802,7 @@ public virtual async Task> RemoveTagAsync(st /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraKeyspaceThroughputSettingResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraKeyspaceThroughputSettingResource.cs index 7b28e0c15052..7c6a9a22c207 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraKeyspaceThroughputSettingResource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraKeyspaceThroughputSettingResource.cs @@ -103,7 +103,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -143,7 +143,7 @@ public virtual async Task> /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -183,7 +183,7 @@ public virtual Response Get(Cancella /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -229,7 +229,7 @@ public virtual async Task /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -275,7 +275,7 @@ public virtual ArmOperation CreateOr /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -317,7 +317,7 @@ public virtual async Task /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -359,7 +359,7 @@ public virtual ArmOperation MigrateC /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -401,7 +401,7 @@ public virtual async Task /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -443,7 +443,7 @@ public virtual ArmOperation MigrateC /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -505,7 +505,7 @@ public virtual async Task> /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -567,7 +567,7 @@ public virtual Response AddTag(strin /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -624,7 +624,7 @@ public virtual async Task> /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -681,7 +681,7 @@ public virtual Response SetTags(IDic /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -741,7 +741,7 @@ public virtual async Task> /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraRoleAssignmentResource.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraRoleAssignmentResource.Serialization.cs new file mode 100644 index 000000000000..6cce08e169cd --- /dev/null +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraRoleAssignmentResource.Serialization.cs @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; + +namespace Azure.ResourceManager.CosmosDB +{ + public partial class CassandraRoleAssignmentResource : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); + + CassandraRoleAssignmentResourceData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options); + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options); + + CassandraRoleAssignmentResourceData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options); + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)Data).GetFormatFromOptions(options); + } +} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraRoleAssignmentResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraRoleAssignmentResource.cs new file mode 100644 index 000000000000..7df3ab411316 --- /dev/null +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraRoleAssignmentResource.cs @@ -0,0 +1,347 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.CosmosDB +{ + /// + /// A Class representing a CassandraRoleAssignmentResource along with the instance operations that can be performed on it. + /// If you have a you can construct a + /// from an instance of using the GetCassandraRoleAssignmentResource method. + /// Otherwise you can get one from its parent resource using the GetCassandraRoleAssignmentResource method. + /// + public partial class CassandraRoleAssignmentResource : ArmResource + { + /// Generate the resource identifier of a instance. + /// The subscriptionId. + /// The resourceGroupName. + /// The accountName. + /// The roleAssignmentId. + public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string accountName, string roleAssignmentId) + { + var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraRoleAssignments/{roleAssignmentId}"; + return new ResourceIdentifier(resourceId); + } + + private readonly ClientDiagnostics _cassandraRoleAssignmentResourceCassandraResourcesClientDiagnostics; + private readonly CassandraResourcesRestOperations _cassandraRoleAssignmentResourceCassandraResourcesRestClient; + private readonly CassandraRoleAssignmentResourceData _data; + + /// Gets the resource type for the operations. + public static readonly ResourceType ResourceType = "Microsoft.DocumentDB/databaseAccounts/cassandraRoleAssignments"; + + /// Initializes a new instance of the class for mocking. + protected CassandraRoleAssignmentResource() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The resource that is the target of operations. + internal CassandraRoleAssignmentResource(ArmClient client, CassandraRoleAssignmentResourceData data) : this(client, data.Id) + { + HasData = true; + _data = data; + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The identifier of the resource that is the target of operations. + internal CassandraRoleAssignmentResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _cassandraRoleAssignmentResourceCassandraResourcesClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.CosmosDB", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string cassandraRoleAssignmentResourceCassandraResourcesApiVersion); + _cassandraRoleAssignmentResourceCassandraResourcesRestClient = new CassandraResourcesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, cassandraRoleAssignmentResourceCassandraResourcesApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + /// Gets whether or not the current instance has data. + public virtual bool HasData { get; } + + /// Gets the data representing this Feature. + /// Throws if there is no data loaded in the current instance. + public virtual CassandraRoleAssignmentResourceData Data + { + get + { + if (!HasData) + throw new InvalidOperationException("The current instance does not have data, you must call Get first."); + return _data; + } + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceType), nameof(id)); + } + + /// + /// Retrieves the properties of an existing Azure Cosmos DB Cassandra Role Assignment with the given Id. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraRoleAssignments/{roleAssignmentId} + /// + /// + /// Operation Id + /// CassandraResources_GetCassandraRoleAssignment + /// + /// + /// Default Api Version + /// 2025-05-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + { + using var scope = _cassandraRoleAssignmentResourceCassandraResourcesClientDiagnostics.CreateScope("CassandraRoleAssignmentResource.Get"); + scope.Start(); + try + { + var response = await _cassandraRoleAssignmentResourceCassandraResourcesRestClient.GetCassandraRoleAssignmentAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new CassandraRoleAssignmentResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Retrieves the properties of an existing Azure Cosmos DB Cassandra Role Assignment with the given Id. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraRoleAssignments/{roleAssignmentId} + /// + /// + /// Operation Id + /// CassandraResources_GetCassandraRoleAssignment + /// + /// + /// Default Api Version + /// 2025-05-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual Response Get(CancellationToken cancellationToken = default) + { + using var scope = _cassandraRoleAssignmentResourceCassandraResourcesClientDiagnostics.CreateScope("CassandraRoleAssignmentResource.Get"); + scope.Start(); + try + { + var response = _cassandraRoleAssignmentResourceCassandraResourcesRestClient.GetCassandraRoleAssignment(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new CassandraRoleAssignmentResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Deletes an existing Azure Cosmos DB Cassandra Role Assignment. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraRoleAssignments/{roleAssignmentId} + /// + /// + /// Operation Id + /// CassandraResources_DeleteCassandraRoleAssignment + /// + /// + /// Default Api Version + /// 2025-05-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The cancellation token to use. + public virtual async Task DeleteAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default) + { + using var scope = _cassandraRoleAssignmentResourceCassandraResourcesClientDiagnostics.CreateScope("CassandraRoleAssignmentResource.Delete"); + scope.Start(); + try + { + var response = await _cassandraRoleAssignmentResourceCassandraResourcesRestClient.DeleteCassandraRoleAssignmentAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + var operation = new CosmosDBArmOperation(_cassandraRoleAssignmentResourceCassandraResourcesClientDiagnostics, Pipeline, _cassandraRoleAssignmentResourceCassandraResourcesRestClient.CreateDeleteCassandraRoleAssignmentRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Deletes an existing Azure Cosmos DB Cassandra Role Assignment. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraRoleAssignments/{roleAssignmentId} + /// + /// + /// Operation Id + /// CassandraResources_DeleteCassandraRoleAssignment + /// + /// + /// Default Api Version + /// 2025-05-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The cancellation token to use. + public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancellationToken = default) + { + using var scope = _cassandraRoleAssignmentResourceCassandraResourcesClientDiagnostics.CreateScope("CassandraRoleAssignmentResource.Delete"); + scope.Start(); + try + { + var response = _cassandraRoleAssignmentResourceCassandraResourcesRestClient.DeleteCassandraRoleAssignment(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + var operation = new CosmosDBArmOperation(_cassandraRoleAssignmentResourceCassandraResourcesClientDiagnostics, Pipeline, _cassandraRoleAssignmentResourceCassandraResourcesRestClient.CreateDeleteCassandraRoleAssignmentRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletionResponse(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Creates or updates an Azure Cosmos DB Cassandra Role Assignment. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraRoleAssignments/{roleAssignmentId} + /// + /// + /// Operation Id + /// CassandraResources_CreateUpdateCassandraRoleAssignment + /// + /// + /// Default Api Version + /// 2025-05-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The properties required to create or update a Role Assignment. + /// The cancellation token to use. + /// is null. + public virtual async Task> UpdateAsync(WaitUntil waitUntil, CassandraRoleAssignmentResourceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _cassandraRoleAssignmentResourceCassandraResourcesClientDiagnostics.CreateScope("CassandraRoleAssignmentResource.Update"); + scope.Start(); + try + { + var response = await _cassandraRoleAssignmentResourceCassandraResourcesRestClient.CreateUpdateCassandraRoleAssignmentAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, cancellationToken).ConfigureAwait(false); + var operation = new CosmosDBArmOperation(new CassandraRoleAssignmentResourceOperationSource(Client), _cassandraRoleAssignmentResourceCassandraResourcesClientDiagnostics, Pipeline, _cassandraRoleAssignmentResourceCassandraResourcesRestClient.CreateCreateUpdateCassandraRoleAssignmentRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Creates or updates an Azure Cosmos DB Cassandra Role Assignment. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraRoleAssignments/{roleAssignmentId} + /// + /// + /// Operation Id + /// CassandraResources_CreateUpdateCassandraRoleAssignment + /// + /// + /// Default Api Version + /// 2025-05-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The properties required to create or update a Role Assignment. + /// The cancellation token to use. + /// is null. + public virtual ArmOperation Update(WaitUntil waitUntil, CassandraRoleAssignmentResourceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _cassandraRoleAssignmentResourceCassandraResourcesClientDiagnostics.CreateScope("CassandraRoleAssignmentResource.Update"); + scope.Start(); + try + { + var response = _cassandraRoleAssignmentResourceCassandraResourcesRestClient.CreateUpdateCassandraRoleAssignment(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, cancellationToken); + var operation = new CosmosDBArmOperation(new CassandraRoleAssignmentResourceOperationSource(Client), _cassandraRoleAssignmentResourceCassandraResourcesClientDiagnostics, Pipeline, _cassandraRoleAssignmentResourceCassandraResourcesRestClient.CreateCreateUpdateCassandraRoleAssignmentRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraRoleAssignmentResourceCollection.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraRoleAssignmentResourceCollection.cs new file mode 100644 index 000000000000..d5c59da00b00 --- /dev/null +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraRoleAssignmentResourceCollection.cs @@ -0,0 +1,491 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Autorest.CSharp.Core; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.CosmosDB +{ + /// + /// A class representing a collection of and their operations. + /// Each in the collection will belong to the same instance of . + /// To get a instance call the GetCassandraRoleAssignmentResources method from an instance of . + /// + public partial class CassandraRoleAssignmentResourceCollection : ArmCollection, IEnumerable, IAsyncEnumerable + { + private readonly ClientDiagnostics _cassandraRoleAssignmentResourceCassandraResourcesClientDiagnostics; + private readonly CassandraResourcesRestOperations _cassandraRoleAssignmentResourceCassandraResourcesRestClient; + + /// Initializes a new instance of the class for mocking. + protected CassandraRoleAssignmentResourceCollection() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The identifier of the parent resource that is the target of operations. + internal CassandraRoleAssignmentResourceCollection(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _cassandraRoleAssignmentResourceCassandraResourcesClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.CosmosDB", CassandraRoleAssignmentResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(CassandraRoleAssignmentResource.ResourceType, out string cassandraRoleAssignmentResourceCassandraResourcesApiVersion); + _cassandraRoleAssignmentResourceCassandraResourcesRestClient = new CassandraResourcesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, cassandraRoleAssignmentResourceCassandraResourcesApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != CosmosDBAccountResource.ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, CosmosDBAccountResource.ResourceType), nameof(id)); + } + + /// + /// Creates or updates an Azure Cosmos DB Cassandra Role Assignment. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraRoleAssignments/{roleAssignmentId} + /// + /// + /// Operation Id + /// CassandraResources_CreateUpdateCassandraRoleAssignment + /// + /// + /// Default Api Version + /// 2025-05-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The GUID for the Role Assignment. + /// The properties required to create or update a Role Assignment. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// or is null. + public virtual async Task> CreateOrUpdateAsync(WaitUntil waitUntil, string roleAssignmentId, CassandraRoleAssignmentResourceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(roleAssignmentId, nameof(roleAssignmentId)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _cassandraRoleAssignmentResourceCassandraResourcesClientDiagnostics.CreateScope("CassandraRoleAssignmentResourceCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = await _cassandraRoleAssignmentResourceCassandraResourcesRestClient.CreateUpdateCassandraRoleAssignmentAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, roleAssignmentId, data, cancellationToken).ConfigureAwait(false); + var operation = new CosmosDBArmOperation(new CassandraRoleAssignmentResourceOperationSource(Client), _cassandraRoleAssignmentResourceCassandraResourcesClientDiagnostics, Pipeline, _cassandraRoleAssignmentResourceCassandraResourcesRestClient.CreateCreateUpdateCassandraRoleAssignmentRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, roleAssignmentId, data).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Creates or updates an Azure Cosmos DB Cassandra Role Assignment. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraRoleAssignments/{roleAssignmentId} + /// + /// + /// Operation Id + /// CassandraResources_CreateUpdateCassandraRoleAssignment + /// + /// + /// Default Api Version + /// 2025-05-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The GUID for the Role Assignment. + /// The properties required to create or update a Role Assignment. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// or is null. + public virtual ArmOperation CreateOrUpdate(WaitUntil waitUntil, string roleAssignmentId, CassandraRoleAssignmentResourceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(roleAssignmentId, nameof(roleAssignmentId)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _cassandraRoleAssignmentResourceCassandraResourcesClientDiagnostics.CreateScope("CassandraRoleAssignmentResourceCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = _cassandraRoleAssignmentResourceCassandraResourcesRestClient.CreateUpdateCassandraRoleAssignment(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, roleAssignmentId, data, cancellationToken); + var operation = new CosmosDBArmOperation(new CassandraRoleAssignmentResourceOperationSource(Client), _cassandraRoleAssignmentResourceCassandraResourcesClientDiagnostics, Pipeline, _cassandraRoleAssignmentResourceCassandraResourcesRestClient.CreateCreateUpdateCassandraRoleAssignmentRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, roleAssignmentId, data).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Retrieves the properties of an existing Azure Cosmos DB Cassandra Role Assignment with the given Id. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraRoleAssignments/{roleAssignmentId} + /// + /// + /// Operation Id + /// CassandraResources_GetCassandraRoleAssignment + /// + /// + /// Default Api Version + /// 2025-05-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The GUID for the Role Assignment. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetAsync(string roleAssignmentId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(roleAssignmentId, nameof(roleAssignmentId)); + + using var scope = _cassandraRoleAssignmentResourceCassandraResourcesClientDiagnostics.CreateScope("CassandraRoleAssignmentResourceCollection.Get"); + scope.Start(); + try + { + var response = await _cassandraRoleAssignmentResourceCassandraResourcesRestClient.GetCassandraRoleAssignmentAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, roleAssignmentId, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new CassandraRoleAssignmentResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Retrieves the properties of an existing Azure Cosmos DB Cassandra Role Assignment with the given Id. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraRoleAssignments/{roleAssignmentId} + /// + /// + /// Operation Id + /// CassandraResources_GetCassandraRoleAssignment + /// + /// + /// Default Api Version + /// 2025-05-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The GUID for the Role Assignment. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Get(string roleAssignmentId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(roleAssignmentId, nameof(roleAssignmentId)); + + using var scope = _cassandraRoleAssignmentResourceCassandraResourcesClientDiagnostics.CreateScope("CassandraRoleAssignmentResourceCollection.Get"); + scope.Start(); + try + { + var response = _cassandraRoleAssignmentResourceCassandraResourcesRestClient.GetCassandraRoleAssignment(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, roleAssignmentId, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new CassandraRoleAssignmentResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Retrieves the list of all Azure Cosmos DB Cassandra Role Assignments. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraRoleAssignments + /// + /// + /// Operation Id + /// CassandraResources_ListCassandraRoleAssignments + /// + /// + /// Default Api Version + /// 2025-05-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetAllAsync(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _cassandraRoleAssignmentResourceCassandraResourcesRestClient.CreateListCassandraRoleAssignmentsRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, null, e => new CassandraRoleAssignmentResource(Client, CassandraRoleAssignmentResourceData.DeserializeCassandraRoleAssignmentResourceData(e)), _cassandraRoleAssignmentResourceCassandraResourcesClientDiagnostics, Pipeline, "CassandraRoleAssignmentResourceCollection.GetAll", "value", null, cancellationToken); + } + + /// + /// Retrieves the list of all Azure Cosmos DB Cassandra Role Assignments. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraRoleAssignments + /// + /// + /// Operation Id + /// CassandraResources_ListCassandraRoleAssignments + /// + /// + /// Default Api Version + /// 2025-05-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetAll(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _cassandraRoleAssignmentResourceCassandraResourcesRestClient.CreateListCassandraRoleAssignmentsRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, null, e => new CassandraRoleAssignmentResource(Client, CassandraRoleAssignmentResourceData.DeserializeCassandraRoleAssignmentResourceData(e)), _cassandraRoleAssignmentResourceCassandraResourcesClientDiagnostics, Pipeline, "CassandraRoleAssignmentResourceCollection.GetAll", "value", null, cancellationToken); + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraRoleAssignments/{roleAssignmentId} + /// + /// + /// Operation Id + /// CassandraResources_GetCassandraRoleAssignment + /// + /// + /// Default Api Version + /// 2025-05-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The GUID for the Role Assignment. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> ExistsAsync(string roleAssignmentId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(roleAssignmentId, nameof(roleAssignmentId)); + + using var scope = _cassandraRoleAssignmentResourceCassandraResourcesClientDiagnostics.CreateScope("CassandraRoleAssignmentResourceCollection.Exists"); + scope.Start(); + try + { + var response = await _cassandraRoleAssignmentResourceCassandraResourcesRestClient.GetCassandraRoleAssignmentAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, roleAssignmentId, cancellationToken: cancellationToken).ConfigureAwait(false); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraRoleAssignments/{roleAssignmentId} + /// + /// + /// Operation Id + /// CassandraResources_GetCassandraRoleAssignment + /// + /// + /// Default Api Version + /// 2025-05-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The GUID for the Role Assignment. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Exists(string roleAssignmentId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(roleAssignmentId, nameof(roleAssignmentId)); + + using var scope = _cassandraRoleAssignmentResourceCassandraResourcesClientDiagnostics.CreateScope("CassandraRoleAssignmentResourceCollection.Exists"); + scope.Start(); + try + { + var response = _cassandraRoleAssignmentResourceCassandraResourcesRestClient.GetCassandraRoleAssignment(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, roleAssignmentId, cancellationToken: cancellationToken); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraRoleAssignments/{roleAssignmentId} + /// + /// + /// Operation Id + /// CassandraResources_GetCassandraRoleAssignment + /// + /// + /// Default Api Version + /// 2025-05-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The GUID for the Role Assignment. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetIfExistsAsync(string roleAssignmentId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(roleAssignmentId, nameof(roleAssignmentId)); + + using var scope = _cassandraRoleAssignmentResourceCassandraResourcesClientDiagnostics.CreateScope("CassandraRoleAssignmentResourceCollection.GetIfExists"); + scope.Start(); + try + { + var response = await _cassandraRoleAssignmentResourceCassandraResourcesRestClient.GetCassandraRoleAssignmentAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, roleAssignmentId, cancellationToken: cancellationToken).ConfigureAwait(false); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new CassandraRoleAssignmentResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraRoleAssignments/{roleAssignmentId} + /// + /// + /// Operation Id + /// CassandraResources_GetCassandraRoleAssignment + /// + /// + /// Default Api Version + /// 2025-05-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The GUID for the Role Assignment. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual NullableResponse GetIfExists(string roleAssignmentId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(roleAssignmentId, nameof(roleAssignmentId)); + + using var scope = _cassandraRoleAssignmentResourceCassandraResourcesClientDiagnostics.CreateScope("CassandraRoleAssignmentResourceCollection.GetIfExists"); + scope.Start(); + try + { + var response = _cassandraRoleAssignmentResourceCassandraResourcesRestClient.GetCassandraRoleAssignment(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, roleAssignmentId, cancellationToken: cancellationToken); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new CassandraRoleAssignmentResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetAll().GetEnumerator(); + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetAll().GetEnumerator(); + } + + IAsyncEnumerator IAsyncEnumerable.GetAsyncEnumerator(CancellationToken cancellationToken) + { + return GetAllAsync(cancellationToken: cancellationToken).GetAsyncEnumerator(cancellationToken); + } + } +} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraRoleAssignmentResourceData.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraRoleAssignmentResourceData.Serialization.cs new file mode 100644 index 000000000000..6da78ec0dabc --- /dev/null +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraRoleAssignmentResourceData.Serialization.cs @@ -0,0 +1,363 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text; +using System.Text.Json; +using Azure.Core; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.CosmosDB +{ + public partial class CassandraRoleAssignmentResourceData : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(CassandraRoleAssignmentResourceData)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + writer.WritePropertyName("properties"u8); + writer.WriteStartObject(); + if (Optional.IsDefined(RoleDefinitionId)) + { + writer.WritePropertyName("roleDefinitionId"u8); + writer.WriteStringValue(RoleDefinitionId); + } + if (Optional.IsDefined(Scope)) + { + writer.WritePropertyName("scope"u8); + writer.WriteStringValue(Scope); + } + if (Optional.IsDefined(PrincipalId)) + { + writer.WritePropertyName("principalId"u8); + writer.WriteStringValue(PrincipalId.Value); + } + if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) + { + writer.WritePropertyName("provisioningState"u8); + writer.WriteStringValue(ProvisioningState); + } + writer.WriteEndObject(); + } + + CassandraRoleAssignmentResourceData 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(CassandraRoleAssignmentResourceData)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeCassandraRoleAssignmentResourceData(document.RootElement, options); + } + + internal static CassandraRoleAssignmentResourceData DeserializeCassandraRoleAssignmentResourceData(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ResourceIdentifier id = default; + string name = default; + ResourceType type = default; + SystemData systemData = default; + string roleDefinitionId = default; + string scope = default; + Guid? principalId = default; + string provisioningState = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("id"u8)) + { + id = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("type"u8)) + { + type = new ResourceType(property.Value.GetString()); + continue; + } + if (property.NameEquals("systemData"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + systemData = JsonSerializer.Deserialize(property.Value.GetRawText()); + continue; + } + if (property.NameEquals("properties"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + foreach (var property0 in property.Value.EnumerateObject()) + { + if (property0.NameEquals("roleDefinitionId"u8)) + { + roleDefinitionId = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("scope"u8)) + { + scope = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("principalId"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + principalId = property0.Value.GetGuid(); + continue; + } + if (property0.NameEquals("provisioningState"u8)) + { + provisioningState = property0.Value.GetString(); + continue; + } + } + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new CassandraRoleAssignmentResourceData( + id, + name, + type, + systemData, + roleDefinitionId, + scope, + principalId, + provisioningState, + serializedAdditionalRawData); + } + + private BinaryData SerializeBicep(ModelReaderWriterOptions options) + { + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Name), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" name: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Name)) + { + builder.Append(" name: "); + if (Name.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{Name}'''"); + } + else + { + builder.AppendLine($"'{Name}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Id), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" id: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Id)) + { + builder.Append(" id: "); + builder.AppendLine($"'{Id.ToString()}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(SystemData), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" systemData: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(SystemData)) + { + builder.Append(" systemData: "); + builder.AppendLine($"'{SystemData.ToString()}'"); + } + } + + builder.Append(" properties:"); + builder.AppendLine(" {"); + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(RoleDefinitionId), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" roleDefinitionId: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(RoleDefinitionId)) + { + builder.Append(" roleDefinitionId: "); + if (RoleDefinitionId.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{RoleDefinitionId}'''"); + } + else + { + builder.AppendLine($"'{RoleDefinitionId}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Scope), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" scope: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Scope)) + { + builder.Append(" scope: "); + if (Scope.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{Scope}'''"); + } + else + { + builder.AppendLine($"'{Scope}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(PrincipalId), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" principalId: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(PrincipalId)) + { + builder.Append(" principalId: "); + builder.AppendLine($"'{PrincipalId.Value.ToString()}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(ProvisioningState), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" provisioningState: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(ProvisioningState)) + { + builder.Append(" provisioningState: "); + if (ProvisioningState.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{ProvisioningState}'''"); + } + else + { + builder.AppendLine($"'{ProvisioningState}'"); + } + } + } + + builder.AppendLine(" }"); + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + case "bicep": + return SerializeBicep(options); + default: + throw new FormatException($"The model {nameof(CassandraRoleAssignmentResourceData)} does not support writing '{options.Format}' format."); + } + } + + CassandraRoleAssignmentResourceData 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 DeserializeCassandraRoleAssignmentResourceData(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(CassandraRoleAssignmentResourceData)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraRoleAssignmentResourceData.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraRoleAssignmentResourceData.cs new file mode 100644 index 000000000000..24b4dbc5977a --- /dev/null +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraRoleAssignmentResourceData.cs @@ -0,0 +1,90 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.CosmosDB +{ + /// + /// A class representing the CassandraRoleAssignmentResource data model. + /// Parameters to create and update an Azure Cosmos DB Cassandra Role Assignment. + /// + public partial class CassandraRoleAssignmentResourceData : ResourceData + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public CassandraRoleAssignmentResourceData() + { + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The unique identifier for the associated Role Definition. + /// The data plane resource path for which access is being granted through this Cassandra Role Assignment. + /// The unique identifier for the associated AAD principal in the AAD graph to which access is being granted through this Cassandra Role Assignment. Tenant ID for the principal is inferred using the tenant associated with the subscription. + /// Provisioning state of the resource. + /// Keeps track of any properties unknown to the library. + internal CassandraRoleAssignmentResourceData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, string roleDefinitionId, string scope, Guid? principalId, string provisioningState, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) + { + RoleDefinitionId = roleDefinitionId; + Scope = scope; + PrincipalId = principalId; + ProvisioningState = provisioningState; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The unique identifier for the associated Role Definition. + [WirePath("properties.roleDefinitionId")] + public string RoleDefinitionId { get; set; } + /// The data plane resource path for which access is being granted through this Cassandra Role Assignment. + [WirePath("properties.scope")] + public string Scope { get; set; } + /// The unique identifier for the associated AAD principal in the AAD graph to which access is being granted through this Cassandra Role Assignment. Tenant ID for the principal is inferred using the tenant associated with the subscription. + [WirePath("properties.principalId")] + public Guid? PrincipalId { get; set; } + /// Provisioning state of the resource. + [WirePath("properties.provisioningState")] + public string ProvisioningState { get; } + } +} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraRoleDefinitionResource.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraRoleDefinitionResource.Serialization.cs new file mode 100644 index 000000000000..0606af2b4591 --- /dev/null +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraRoleDefinitionResource.Serialization.cs @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; + +namespace Azure.ResourceManager.CosmosDB +{ + public partial class CassandraRoleDefinitionResource : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); + + CassandraRoleDefinitionResourceData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options); + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options); + + CassandraRoleDefinitionResourceData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options); + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)Data).GetFormatFromOptions(options); + } +} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraRoleDefinitionResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraRoleDefinitionResource.cs new file mode 100644 index 000000000000..7c2337353fd7 --- /dev/null +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraRoleDefinitionResource.cs @@ -0,0 +1,347 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.CosmosDB +{ + /// + /// A Class representing a CassandraRoleDefinitionResource along with the instance operations that can be performed on it. + /// If you have a you can construct a + /// from an instance of using the GetCassandraRoleDefinitionResource method. + /// Otherwise you can get one from its parent resource using the GetCassandraRoleDefinitionResource method. + /// + public partial class CassandraRoleDefinitionResource : ArmResource + { + /// Generate the resource identifier of a instance. + /// The subscriptionId. + /// The resourceGroupName. + /// The accountName. + /// The roleDefinitionId. + public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string accountName, string roleDefinitionId) + { + var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraRoleDefinitions/{roleDefinitionId}"; + return new ResourceIdentifier(resourceId); + } + + private readonly ClientDiagnostics _cassandraRoleDefinitionResourceCassandraResourcesClientDiagnostics; + private readonly CassandraResourcesRestOperations _cassandraRoleDefinitionResourceCassandraResourcesRestClient; + private readonly CassandraRoleDefinitionResourceData _data; + + /// Gets the resource type for the operations. + public static readonly ResourceType ResourceType = "Microsoft.DocumentDB/databaseAccounts/cassandraRoleDefinitions"; + + /// Initializes a new instance of the class for mocking. + protected CassandraRoleDefinitionResource() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The resource that is the target of operations. + internal CassandraRoleDefinitionResource(ArmClient client, CassandraRoleDefinitionResourceData data) : this(client, data.Id) + { + HasData = true; + _data = data; + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The identifier of the resource that is the target of operations. + internal CassandraRoleDefinitionResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _cassandraRoleDefinitionResourceCassandraResourcesClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.CosmosDB", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string cassandraRoleDefinitionResourceCassandraResourcesApiVersion); + _cassandraRoleDefinitionResourceCassandraResourcesRestClient = new CassandraResourcesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, cassandraRoleDefinitionResourceCassandraResourcesApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + /// Gets whether or not the current instance has data. + public virtual bool HasData { get; } + + /// Gets the data representing this Feature. + /// Throws if there is no data loaded in the current instance. + public virtual CassandraRoleDefinitionResourceData Data + { + get + { + if (!HasData) + throw new InvalidOperationException("The current instance does not have data, you must call Get first."); + return _data; + } + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceType), nameof(id)); + } + + /// + /// Retrieves the properties of an existing Azure Cosmos DB Cassandra Role Definition with the given Id. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraRoleDefinitions/{roleDefinitionId} + /// + /// + /// Operation Id + /// CassandraResources_GetCassandraRoleDefinition + /// + /// + /// Default Api Version + /// 2025-05-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + { + using var scope = _cassandraRoleDefinitionResourceCassandraResourcesClientDiagnostics.CreateScope("CassandraRoleDefinitionResource.Get"); + scope.Start(); + try + { + var response = await _cassandraRoleDefinitionResourceCassandraResourcesRestClient.GetCassandraRoleDefinitionAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new CassandraRoleDefinitionResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Retrieves the properties of an existing Azure Cosmos DB Cassandra Role Definition with the given Id. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraRoleDefinitions/{roleDefinitionId} + /// + /// + /// Operation Id + /// CassandraResources_GetCassandraRoleDefinition + /// + /// + /// Default Api Version + /// 2025-05-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual Response Get(CancellationToken cancellationToken = default) + { + using var scope = _cassandraRoleDefinitionResourceCassandraResourcesClientDiagnostics.CreateScope("CassandraRoleDefinitionResource.Get"); + scope.Start(); + try + { + var response = _cassandraRoleDefinitionResourceCassandraResourcesRestClient.GetCassandraRoleDefinition(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new CassandraRoleDefinitionResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Deletes an existing Azure Cosmos DB Cassandra Role Definition. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraRoleDefinitions/{roleDefinitionId} + /// + /// + /// Operation Id + /// CassandraResources_DeleteCassandraRoleDefinition + /// + /// + /// Default Api Version + /// 2025-05-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The cancellation token to use. + public virtual async Task DeleteAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default) + { + using var scope = _cassandraRoleDefinitionResourceCassandraResourcesClientDiagnostics.CreateScope("CassandraRoleDefinitionResource.Delete"); + scope.Start(); + try + { + var response = await _cassandraRoleDefinitionResourceCassandraResourcesRestClient.DeleteCassandraRoleDefinitionAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + var operation = new CosmosDBArmOperation(_cassandraRoleDefinitionResourceCassandraResourcesClientDiagnostics, Pipeline, _cassandraRoleDefinitionResourceCassandraResourcesRestClient.CreateDeleteCassandraRoleDefinitionRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Deletes an existing Azure Cosmos DB Cassandra Role Definition. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraRoleDefinitions/{roleDefinitionId} + /// + /// + /// Operation Id + /// CassandraResources_DeleteCassandraRoleDefinition + /// + /// + /// Default Api Version + /// 2025-05-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The cancellation token to use. + public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancellationToken = default) + { + using var scope = _cassandraRoleDefinitionResourceCassandraResourcesClientDiagnostics.CreateScope("CassandraRoleDefinitionResource.Delete"); + scope.Start(); + try + { + var response = _cassandraRoleDefinitionResourceCassandraResourcesRestClient.DeleteCassandraRoleDefinition(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + var operation = new CosmosDBArmOperation(_cassandraRoleDefinitionResourceCassandraResourcesClientDiagnostics, Pipeline, _cassandraRoleDefinitionResourceCassandraResourcesRestClient.CreateDeleteCassandraRoleDefinitionRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletionResponse(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Creates or updates an Azure Cosmos DB Cassandra Role Definition. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraRoleDefinitions/{roleDefinitionId} + /// + /// + /// Operation Id + /// CassandraResources_CreateUpdateCassandraRoleDefinition + /// + /// + /// Default Api Version + /// 2025-05-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The properties required to create or update a Role Definition. + /// The cancellation token to use. + /// is null. + public virtual async Task> UpdateAsync(WaitUntil waitUntil, CassandraRoleDefinitionResourceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _cassandraRoleDefinitionResourceCassandraResourcesClientDiagnostics.CreateScope("CassandraRoleDefinitionResource.Update"); + scope.Start(); + try + { + var response = await _cassandraRoleDefinitionResourceCassandraResourcesRestClient.CreateUpdateCassandraRoleDefinitionAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, cancellationToken).ConfigureAwait(false); + var operation = new CosmosDBArmOperation(new CassandraRoleDefinitionResourceOperationSource(Client), _cassandraRoleDefinitionResourceCassandraResourcesClientDiagnostics, Pipeline, _cassandraRoleDefinitionResourceCassandraResourcesRestClient.CreateCreateUpdateCassandraRoleDefinitionRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Creates or updates an Azure Cosmos DB Cassandra Role Definition. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraRoleDefinitions/{roleDefinitionId} + /// + /// + /// Operation Id + /// CassandraResources_CreateUpdateCassandraRoleDefinition + /// + /// + /// Default Api Version + /// 2025-05-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The properties required to create or update a Role Definition. + /// The cancellation token to use. + /// is null. + public virtual ArmOperation Update(WaitUntil waitUntil, CassandraRoleDefinitionResourceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _cassandraRoleDefinitionResourceCassandraResourcesClientDiagnostics.CreateScope("CassandraRoleDefinitionResource.Update"); + scope.Start(); + try + { + var response = _cassandraRoleDefinitionResourceCassandraResourcesRestClient.CreateUpdateCassandraRoleDefinition(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, cancellationToken); + var operation = new CosmosDBArmOperation(new CassandraRoleDefinitionResourceOperationSource(Client), _cassandraRoleDefinitionResourceCassandraResourcesClientDiagnostics, Pipeline, _cassandraRoleDefinitionResourceCassandraResourcesRestClient.CreateCreateUpdateCassandraRoleDefinitionRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraRoleDefinitionResourceCollection.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraRoleDefinitionResourceCollection.cs new file mode 100644 index 000000000000..250dde1d277b --- /dev/null +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraRoleDefinitionResourceCollection.cs @@ -0,0 +1,491 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Autorest.CSharp.Core; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.CosmosDB +{ + /// + /// A class representing a collection of and their operations. + /// Each in the collection will belong to the same instance of . + /// To get a instance call the GetCassandraRoleDefinitionResources method from an instance of . + /// + public partial class CassandraRoleDefinitionResourceCollection : ArmCollection, IEnumerable, IAsyncEnumerable + { + private readonly ClientDiagnostics _cassandraRoleDefinitionResourceCassandraResourcesClientDiagnostics; + private readonly CassandraResourcesRestOperations _cassandraRoleDefinitionResourceCassandraResourcesRestClient; + + /// Initializes a new instance of the class for mocking. + protected CassandraRoleDefinitionResourceCollection() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The identifier of the parent resource that is the target of operations. + internal CassandraRoleDefinitionResourceCollection(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _cassandraRoleDefinitionResourceCassandraResourcesClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.CosmosDB", CassandraRoleDefinitionResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(CassandraRoleDefinitionResource.ResourceType, out string cassandraRoleDefinitionResourceCassandraResourcesApiVersion); + _cassandraRoleDefinitionResourceCassandraResourcesRestClient = new CassandraResourcesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, cassandraRoleDefinitionResourceCassandraResourcesApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != CosmosDBAccountResource.ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, CosmosDBAccountResource.ResourceType), nameof(id)); + } + + /// + /// Creates or updates an Azure Cosmos DB Cassandra Role Definition. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraRoleDefinitions/{roleDefinitionId} + /// + /// + /// Operation Id + /// CassandraResources_CreateUpdateCassandraRoleDefinition + /// + /// + /// Default Api Version + /// 2025-05-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The GUID for the Role Definition. + /// The properties required to create or update a Role Definition. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// or is null. + public virtual async Task> CreateOrUpdateAsync(WaitUntil waitUntil, string roleDefinitionId, CassandraRoleDefinitionResourceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(roleDefinitionId, nameof(roleDefinitionId)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _cassandraRoleDefinitionResourceCassandraResourcesClientDiagnostics.CreateScope("CassandraRoleDefinitionResourceCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = await _cassandraRoleDefinitionResourceCassandraResourcesRestClient.CreateUpdateCassandraRoleDefinitionAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, roleDefinitionId, data, cancellationToken).ConfigureAwait(false); + var operation = new CosmosDBArmOperation(new CassandraRoleDefinitionResourceOperationSource(Client), _cassandraRoleDefinitionResourceCassandraResourcesClientDiagnostics, Pipeline, _cassandraRoleDefinitionResourceCassandraResourcesRestClient.CreateCreateUpdateCassandraRoleDefinitionRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, roleDefinitionId, data).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Creates or updates an Azure Cosmos DB Cassandra Role Definition. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraRoleDefinitions/{roleDefinitionId} + /// + /// + /// Operation Id + /// CassandraResources_CreateUpdateCassandraRoleDefinition + /// + /// + /// Default Api Version + /// 2025-05-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The GUID for the Role Definition. + /// The properties required to create or update a Role Definition. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// or is null. + public virtual ArmOperation CreateOrUpdate(WaitUntil waitUntil, string roleDefinitionId, CassandraRoleDefinitionResourceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(roleDefinitionId, nameof(roleDefinitionId)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _cassandraRoleDefinitionResourceCassandraResourcesClientDiagnostics.CreateScope("CassandraRoleDefinitionResourceCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = _cassandraRoleDefinitionResourceCassandraResourcesRestClient.CreateUpdateCassandraRoleDefinition(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, roleDefinitionId, data, cancellationToken); + var operation = new CosmosDBArmOperation(new CassandraRoleDefinitionResourceOperationSource(Client), _cassandraRoleDefinitionResourceCassandraResourcesClientDiagnostics, Pipeline, _cassandraRoleDefinitionResourceCassandraResourcesRestClient.CreateCreateUpdateCassandraRoleDefinitionRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, roleDefinitionId, data).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Retrieves the properties of an existing Azure Cosmos DB Cassandra Role Definition with the given Id. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraRoleDefinitions/{roleDefinitionId} + /// + /// + /// Operation Id + /// CassandraResources_GetCassandraRoleDefinition + /// + /// + /// Default Api Version + /// 2025-05-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The GUID for the Role Definition. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetAsync(string roleDefinitionId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(roleDefinitionId, nameof(roleDefinitionId)); + + using var scope = _cassandraRoleDefinitionResourceCassandraResourcesClientDiagnostics.CreateScope("CassandraRoleDefinitionResourceCollection.Get"); + scope.Start(); + try + { + var response = await _cassandraRoleDefinitionResourceCassandraResourcesRestClient.GetCassandraRoleDefinitionAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, roleDefinitionId, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new CassandraRoleDefinitionResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Retrieves the properties of an existing Azure Cosmos DB Cassandra Role Definition with the given Id. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraRoleDefinitions/{roleDefinitionId} + /// + /// + /// Operation Id + /// CassandraResources_GetCassandraRoleDefinition + /// + /// + /// Default Api Version + /// 2025-05-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The GUID for the Role Definition. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Get(string roleDefinitionId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(roleDefinitionId, nameof(roleDefinitionId)); + + using var scope = _cassandraRoleDefinitionResourceCassandraResourcesClientDiagnostics.CreateScope("CassandraRoleDefinitionResourceCollection.Get"); + scope.Start(); + try + { + var response = _cassandraRoleDefinitionResourceCassandraResourcesRestClient.GetCassandraRoleDefinition(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, roleDefinitionId, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new CassandraRoleDefinitionResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Retrieves the list of all Azure Cosmos DB Cassandra Role Definitions. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraRoleDefinitions + /// + /// + /// Operation Id + /// CassandraResources_ListCassandraRoleDefinitions + /// + /// + /// Default Api Version + /// 2025-05-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetAllAsync(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _cassandraRoleDefinitionResourceCassandraResourcesRestClient.CreateListCassandraRoleDefinitionsRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, null, e => new CassandraRoleDefinitionResource(Client, CassandraRoleDefinitionResourceData.DeserializeCassandraRoleDefinitionResourceData(e)), _cassandraRoleDefinitionResourceCassandraResourcesClientDiagnostics, Pipeline, "CassandraRoleDefinitionResourceCollection.GetAll", "value", null, cancellationToken); + } + + /// + /// Retrieves the list of all Azure Cosmos DB Cassandra Role Definitions. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraRoleDefinitions + /// + /// + /// Operation Id + /// CassandraResources_ListCassandraRoleDefinitions + /// + /// + /// Default Api Version + /// 2025-05-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetAll(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _cassandraRoleDefinitionResourceCassandraResourcesRestClient.CreateListCassandraRoleDefinitionsRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, null, e => new CassandraRoleDefinitionResource(Client, CassandraRoleDefinitionResourceData.DeserializeCassandraRoleDefinitionResourceData(e)), _cassandraRoleDefinitionResourceCassandraResourcesClientDiagnostics, Pipeline, "CassandraRoleDefinitionResourceCollection.GetAll", "value", null, cancellationToken); + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraRoleDefinitions/{roleDefinitionId} + /// + /// + /// Operation Id + /// CassandraResources_GetCassandraRoleDefinition + /// + /// + /// Default Api Version + /// 2025-05-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The GUID for the Role Definition. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> ExistsAsync(string roleDefinitionId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(roleDefinitionId, nameof(roleDefinitionId)); + + using var scope = _cassandraRoleDefinitionResourceCassandraResourcesClientDiagnostics.CreateScope("CassandraRoleDefinitionResourceCollection.Exists"); + scope.Start(); + try + { + var response = await _cassandraRoleDefinitionResourceCassandraResourcesRestClient.GetCassandraRoleDefinitionAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, roleDefinitionId, cancellationToken: cancellationToken).ConfigureAwait(false); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraRoleDefinitions/{roleDefinitionId} + /// + /// + /// Operation Id + /// CassandraResources_GetCassandraRoleDefinition + /// + /// + /// Default Api Version + /// 2025-05-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The GUID for the Role Definition. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Exists(string roleDefinitionId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(roleDefinitionId, nameof(roleDefinitionId)); + + using var scope = _cassandraRoleDefinitionResourceCassandraResourcesClientDiagnostics.CreateScope("CassandraRoleDefinitionResourceCollection.Exists"); + scope.Start(); + try + { + var response = _cassandraRoleDefinitionResourceCassandraResourcesRestClient.GetCassandraRoleDefinition(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, roleDefinitionId, cancellationToken: cancellationToken); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraRoleDefinitions/{roleDefinitionId} + /// + /// + /// Operation Id + /// CassandraResources_GetCassandraRoleDefinition + /// + /// + /// Default Api Version + /// 2025-05-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The GUID for the Role Definition. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetIfExistsAsync(string roleDefinitionId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(roleDefinitionId, nameof(roleDefinitionId)); + + using var scope = _cassandraRoleDefinitionResourceCassandraResourcesClientDiagnostics.CreateScope("CassandraRoleDefinitionResourceCollection.GetIfExists"); + scope.Start(); + try + { + var response = await _cassandraRoleDefinitionResourceCassandraResourcesRestClient.GetCassandraRoleDefinitionAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, roleDefinitionId, cancellationToken: cancellationToken).ConfigureAwait(false); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new CassandraRoleDefinitionResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraRoleDefinitions/{roleDefinitionId} + /// + /// + /// Operation Id + /// CassandraResources_GetCassandraRoleDefinition + /// + /// + /// Default Api Version + /// 2025-05-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The GUID for the Role Definition. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual NullableResponse GetIfExists(string roleDefinitionId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(roleDefinitionId, nameof(roleDefinitionId)); + + using var scope = _cassandraRoleDefinitionResourceCassandraResourcesClientDiagnostics.CreateScope("CassandraRoleDefinitionResourceCollection.GetIfExists"); + scope.Start(); + try + { + var response = _cassandraRoleDefinitionResourceCassandraResourcesRestClient.GetCassandraRoleDefinition(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, roleDefinitionId, cancellationToken: cancellationToken); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new CassandraRoleDefinitionResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetAll().GetEnumerator(); + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetAll().GetEnumerator(); + } + + IAsyncEnumerator IAsyncEnumerable.GetAsyncEnumerator(CancellationToken cancellationToken) + { + return GetAllAsync(cancellationToken: cancellationToken).GetAsyncEnumerator(cancellationToken); + } + } +} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraRoleDefinitionResourceData.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraRoleDefinitionResourceData.Serialization.cs new file mode 100644 index 000000000000..d587b17204cc --- /dev/null +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraRoleDefinitionResourceData.Serialization.cs @@ -0,0 +1,441 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Text.Json; +using Azure.Core; +using Azure.ResourceManager.CosmosDB.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.CosmosDB +{ + public partial class CassandraRoleDefinitionResourceData : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(CassandraRoleDefinitionResourceData)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + writer.WritePropertyName("properties"u8); + writer.WriteStartObject(); + if (Optional.IsDefined(IdPropertiesId)) + { + writer.WritePropertyName("id"u8); + writer.WriteStringValue(IdPropertiesId); + } + if (Optional.IsDefined(RoleName)) + { + writer.WritePropertyName("roleName"u8); + writer.WriteStringValue(RoleName); + } + if (Optional.IsDefined(TypePropertiesType)) + { + writer.WritePropertyName("type"u8); + writer.WriteStringValue(TypePropertiesType.Value.ToSerialString()); + } + if (Optional.IsCollectionDefined(AssignableScopes)) + { + writer.WritePropertyName("assignableScopes"u8); + writer.WriteStartArray(); + foreach (var item in AssignableScopes) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(Permissions)) + { + writer.WritePropertyName("permissions"u8); + writer.WriteStartArray(); + foreach (var item in Permissions) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + writer.WriteEndObject(); + } + + CassandraRoleDefinitionResourceData 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(CassandraRoleDefinitionResourceData)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeCassandraRoleDefinitionResourceData(document.RootElement, options); + } + + internal static CassandraRoleDefinitionResourceData DeserializeCassandraRoleDefinitionResourceData(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ResourceIdentifier id = default; + string name = default; + ResourceType type = default; + SystemData systemData = default; + string id0 = default; + string roleName = default; + CosmosDBSqlRoleDefinitionType? type0 = default; + IList assignableScopes = default; + IList permissions = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("id"u8)) + { + id = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("type"u8)) + { + type = new ResourceType(property.Value.GetString()); + continue; + } + if (property.NameEquals("systemData"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + systemData = JsonSerializer.Deserialize(property.Value.GetRawText()); + continue; + } + if (property.NameEquals("properties"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + foreach (var property0 in property.Value.EnumerateObject()) + { + if (property0.NameEquals("id"u8)) + { + id0 = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("roleName"u8)) + { + roleName = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("type"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + type0 = property0.Value.GetString().ToCosmosDBSqlRoleDefinitionType(); + continue; + } + if (property0.NameEquals("assignableScopes"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property0.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + assignableScopes = array; + continue; + } + if (property0.NameEquals("permissions"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property0.Value.EnumerateArray()) + { + array.Add(Permission.DeserializePermission(item, options)); + } + permissions = array; + continue; + } + } + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new CassandraRoleDefinitionResourceData( + id, + name, + type, + systemData, + id0, + roleName, + type0, + assignableScopes ?? new ChangeTrackingList(), + permissions ?? new ChangeTrackingList(), + serializedAdditionalRawData); + } + + private BinaryData SerializeBicep(ModelReaderWriterOptions options) + { + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Name), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" name: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Name)) + { + builder.Append(" name: "); + if (Name.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{Name}'''"); + } + else + { + builder.AppendLine($"'{Name}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Id), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" id: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Id)) + { + builder.Append(" id: "); + builder.AppendLine($"'{Id.ToString()}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(SystemData), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" systemData: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(SystemData)) + { + builder.Append(" systemData: "); + builder.AppendLine($"'{SystemData.ToString()}'"); + } + } + + builder.Append(" properties:"); + builder.AppendLine(" {"); + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(IdPropertiesId), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" id: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(IdPropertiesId)) + { + builder.Append(" id: "); + if (IdPropertiesId.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{IdPropertiesId}'''"); + } + else + { + builder.AppendLine($"'{IdPropertiesId}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(RoleName), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" roleName: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(RoleName)) + { + builder.Append(" roleName: "); + if (RoleName.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{RoleName}'''"); + } + else + { + builder.AppendLine($"'{RoleName}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(TypePropertiesType), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" type: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(TypePropertiesType)) + { + builder.Append(" type: "); + builder.AppendLine($"'{TypePropertiesType.Value.ToSerialString()}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(AssignableScopes), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" assignableScopes: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsCollectionDefined(AssignableScopes)) + { + if (AssignableScopes.Any()) + { + builder.Append(" assignableScopes: "); + builder.AppendLine("["); + foreach (var item in AssignableScopes) + { + if (item == null) + { + builder.Append("null"); + continue; + } + if (item.Contains(Environment.NewLine)) + { + builder.AppendLine(" '''"); + builder.AppendLine($"{item}'''"); + } + else + { + builder.AppendLine($" '{item}'"); + } + } + builder.AppendLine(" ]"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Permissions), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" permissions: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsCollectionDefined(Permissions)) + { + if (Permissions.Any()) + { + builder.Append(" permissions: "); + builder.AppendLine("["); + foreach (var item in Permissions) + { + BicepSerializationHelpers.AppendChildObject(builder, item, options, 6, true, " permissions: "); + } + builder.AppendLine(" ]"); + } + } + } + + builder.AppendLine(" }"); + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + case "bicep": + return SerializeBicep(options); + default: + throw new FormatException($"The model {nameof(CassandraRoleDefinitionResourceData)} does not support writing '{options.Format}' format."); + } + } + + CassandraRoleDefinitionResourceData 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 DeserializeCassandraRoleDefinitionResourceData(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(CassandraRoleDefinitionResourceData)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraRoleDefinitionResourceData.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraRoleDefinitionResourceData.cs new file mode 100644 index 000000000000..b74a00bf8e07 --- /dev/null +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraRoleDefinitionResourceData.cs @@ -0,0 +1,98 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; +using Azure.ResourceManager.CosmosDB.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.CosmosDB +{ + /// + /// A class representing the CassandraRoleDefinitionResource data model. + /// Parameters to create and update an Azure Cosmos DB Cassandra Role Definition. + /// + public partial class CassandraRoleDefinitionResourceData : ResourceData + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public CassandraRoleDefinitionResourceData() + { + AssignableScopes = new ChangeTrackingList(); + Permissions = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The path id for the Role Definition. + /// A user-friendly name for the Role Definition. Must be unique for the database account. + /// Indicates whether the Role Definition was built-in or user created. + /// A set of fully qualified Scopes at or below which Cassandra Role Assignments may be created using this Role Definition. This will allow application of this Role Definition on the entire database account or any underlying Database / Collection. Must have at least one element. Scopes higher than Database account are not enforceable as assignable Scopes. Note that resources referenced in assignable Scopes need not exist. + /// The set of operations allowed through this Role Definition. + /// Keeps track of any properties unknown to the library. + internal CassandraRoleDefinitionResourceData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, string idPropertiesId, string roleName, CosmosDBSqlRoleDefinitionType? typePropertiesType, IList assignableScopes, IList permissions, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) + { + IdPropertiesId = idPropertiesId; + RoleName = roleName; + TypePropertiesType = typePropertiesType; + AssignableScopes = assignableScopes; + Permissions = permissions; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The path id for the Role Definition. + [WirePath("properties.id")] + public string IdPropertiesId { get; set; } + /// A user-friendly name for the Role Definition. Must be unique for the database account. + [WirePath("properties.roleName")] + public string RoleName { get; set; } + /// Indicates whether the Role Definition was built-in or user created. + [WirePath("properties.type")] + public CosmosDBSqlRoleDefinitionType? TypePropertiesType { get; set; } + /// A set of fully qualified Scopes at or below which Cassandra Role Assignments may be created using this Role Definition. This will allow application of this Role Definition on the entire database account or any underlying Database / Collection. Must have at least one element. Scopes higher than Database account are not enforceable as assignable Scopes. Note that resources referenced in assignable Scopes need not exist. + [WirePath("properties.assignableScopes")] + public IList AssignableScopes { get; } + /// The set of operations allowed through this Role Definition. + [WirePath("properties.permissions")] + public IList Permissions { get; } + } +} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraTableCollection.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraTableCollection.cs index af26b390f91e..16462d046bcd 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraTableCollection.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraTableCollection.cs @@ -65,7 +65,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -114,7 +114,7 @@ public virtual async Task> CreateOrUpdateAs /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -163,7 +163,7 @@ public virtual ArmOperation CreateOrUpdate(WaitUntil wai /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -208,7 +208,7 @@ public virtual async Task> GetAsync(string tabl /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -253,7 +253,7 @@ public virtual Response Get(string tableName, Cancellati /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -282,7 +282,7 @@ public virtual AsyncPageable GetAllAsync(CancellationTok /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -311,7 +311,7 @@ public virtual Pageable GetAll(CancellationToken cancell /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -354,7 +354,7 @@ public virtual async Task> ExistsAsync(string tableName, Cancella /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -397,7 +397,7 @@ public virtual Response Exists(string tableName, CancellationToken cancell /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -442,7 +442,7 @@ public virtual async Task> GetIfExistsA /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraTableResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraTableResource.cs index 3d488b8433bc..e16f7f5c2512 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraTableResource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraTableResource.cs @@ -111,7 +111,7 @@ public virtual CassandraTableThroughputSettingResource GetCassandraTableThroughp /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -151,7 +151,7 @@ public virtual async Task> GetAsync(Cancellatio /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -191,7 +191,7 @@ public virtual Response Get(CancellationToken cancellati /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -233,7 +233,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -275,7 +275,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -321,7 +321,7 @@ public virtual async Task> UpdateAsync(Wait /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -367,7 +367,7 @@ public virtual ArmOperation Update(WaitUntil waitUntil, /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -429,7 +429,7 @@ public virtual async Task> AddTagAsync(string k /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -491,7 +491,7 @@ public virtual Response AddTag(string key, string value, /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -548,7 +548,7 @@ public virtual async Task> SetTagsAsync(IDictio /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -605,7 +605,7 @@ public virtual Response SetTags(IDictionary /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -665,7 +665,7 @@ public virtual async Task> RemoveTagAsync(strin /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraTableThroughputSettingResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraTableThroughputSettingResource.cs index 6550546353a3..b1466283df5c 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraTableThroughputSettingResource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraTableThroughputSettingResource.cs @@ -104,7 +104,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -144,7 +144,7 @@ public virtual async Task> Get /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -184,7 +184,7 @@ public virtual Response Get(Cancellatio /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -230,7 +230,7 @@ public virtual async Task> /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -276,7 +276,7 @@ public virtual ArmOperation CreateOrUpd /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -318,7 +318,7 @@ public virtual async Task> /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -360,7 +360,7 @@ public virtual ArmOperation MigrateCass /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -402,7 +402,7 @@ public virtual async Task> /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -444,7 +444,7 @@ public virtual ArmOperation MigrateCass /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -506,7 +506,7 @@ public virtual async Task> Add /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -568,7 +568,7 @@ public virtual Response AddTag(string k /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -625,7 +625,7 @@ public virtual async Task> Set /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -682,7 +682,7 @@ public virtual Response SetTags(IDictio /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -742,7 +742,7 @@ public virtual async Task> Rem /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraViewGetResultCollection.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraViewGetResultCollection.cs index 9fcc2c09d344..8c90e504d572 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraViewGetResultCollection.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraViewGetResultCollection.cs @@ -65,7 +65,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -114,7 +114,7 @@ public virtual async Task> CreateOr /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -163,7 +163,7 @@ public virtual ArmOperation CreateOrUpdate(WaitU /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -208,7 +208,7 @@ public virtual async Task> GetAsync(str /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -253,7 +253,7 @@ public virtual Response Get(string viewName, Can /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -282,7 +282,7 @@ public virtual AsyncPageable GetAllAsync(Cancell /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -311,7 +311,7 @@ public virtual Pageable GetAll(CancellationToken /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -354,7 +354,7 @@ public virtual async Task> ExistsAsync(string viewName, Cancellat /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -397,7 +397,7 @@ public virtual Response Exists(string viewName, CancellationToken cancella /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -442,7 +442,7 @@ public virtual async Task> GetI /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraViewGetResultResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraViewGetResultResource.cs index 62337914de49..8337f385e88e 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraViewGetResultResource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraViewGetResultResource.cs @@ -111,7 +111,7 @@ public virtual CassandraViewThroughputSettingResource GetCassandraViewThroughput /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -151,7 +151,7 @@ public virtual async Task> GetAsync(Can /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -191,7 +191,7 @@ public virtual Response Get(CancellationToken ca /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -233,7 +233,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -275,7 +275,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -321,7 +321,7 @@ public virtual async Task> UpdateAs /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -367,7 +367,7 @@ public virtual ArmOperation Update(WaitUntil wai /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -429,7 +429,7 @@ public virtual async Task> AddTagAsync( /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -491,7 +491,7 @@ public virtual Response AddTag(string key, strin /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -548,7 +548,7 @@ public virtual async Task> SetTagsAsync /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -605,7 +605,7 @@ public virtual Response SetTags(IDictionary /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -665,7 +665,7 @@ public virtual async Task> RemoveTagAsy /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraViewThroughputSettingResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraViewThroughputSettingResource.cs index 90332502eda7..4e50edadf94e 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraViewThroughputSettingResource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraViewThroughputSettingResource.cs @@ -104,7 +104,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -144,7 +144,7 @@ public virtual async Task> GetA /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -184,7 +184,7 @@ public virtual Response Get(Cancellation /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -230,7 +230,7 @@ public virtual async Task> /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -276,7 +276,7 @@ public virtual ArmOperation CreateOrUpda /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -318,7 +318,7 @@ public virtual async Task> /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -360,7 +360,7 @@ public virtual ArmOperation MigrateCassa /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -402,7 +402,7 @@ public virtual async Task> /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -444,7 +444,7 @@ public virtual ArmOperation MigrateCassa /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -506,7 +506,7 @@ public virtual async Task> AddT /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -568,7 +568,7 @@ public virtual Response AddTag(string ke /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -625,7 +625,7 @@ public virtual async Task> SetT /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -682,7 +682,7 @@ public virtual Response SetTags(IDiction /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -742,7 +742,7 @@ public virtual async Task> Remo /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CopyJobGetResultCollection.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CopyJobGetResultCollection.cs new file mode 100644 index 000000000000..9cb62b7d4762 --- /dev/null +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CopyJobGetResultCollection.cs @@ -0,0 +1,497 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Autorest.CSharp.Core; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.CosmosDB +{ + /// + /// A class representing a collection of and their operations. + /// Each in the collection will belong to the same instance of . + /// To get a instance call the GetCopyJobGetResults method from an instance of . + /// + public partial class CopyJobGetResultCollection : ArmCollection, IEnumerable, IAsyncEnumerable + { + private readonly ClientDiagnostics _copyJobGetResultCopyJobsClientDiagnostics; + private readonly CopyJobsRestOperations _copyJobGetResultCopyJobsRestClient; + + /// Initializes a new instance of the class for mocking. + protected CopyJobGetResultCollection() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The identifier of the parent resource that is the target of operations. + internal CopyJobGetResultCollection(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _copyJobGetResultCopyJobsClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.CosmosDB", CopyJobGetResultResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(CopyJobGetResultResource.ResourceType, out string copyJobGetResultCopyJobsApiVersion); + _copyJobGetResultCopyJobsRestClient = new CopyJobsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, copyJobGetResultCopyJobsApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != CosmosDBAccountResource.ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, CosmosDBAccountResource.ResourceType), nameof(id)); + } + + /// + /// Creates a Copy Job. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/copyJobs/{jobName} + /// + /// + /// Operation Id + /// CopyJobs_Create + /// + /// + /// Default Api Version + /// 2025-05-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// Name of the Copy Job. + /// The to use. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// or is null. + public virtual async Task> CreateOrUpdateAsync(WaitUntil waitUntil, string jobName, CopyJobGetResultData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(jobName, nameof(jobName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _copyJobGetResultCopyJobsClientDiagnostics.CreateScope("CopyJobGetResultCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = await _copyJobGetResultCopyJobsRestClient.CreateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, jobName, data, cancellationToken).ConfigureAwait(false); + var uri = _copyJobGetResultCopyJobsRestClient.CreateCreateRequestUri(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, jobName, data); + var rehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(RequestMethod.Put, uri.ToUri(), uri.ToString(), "None", null, OperationFinalStateVia.OriginalUri.ToString()); + var operation = new CosmosDBArmOperation(Response.FromValue(new CopyJobGetResultResource(Client, response), response.GetRawResponse()), rehydrationToken); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Creates a Copy Job. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/copyJobs/{jobName} + /// + /// + /// Operation Id + /// CopyJobs_Create + /// + /// + /// Default Api Version + /// 2025-05-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// Name of the Copy Job. + /// The to use. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// or is null. + public virtual ArmOperation CreateOrUpdate(WaitUntil waitUntil, string jobName, CopyJobGetResultData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(jobName, nameof(jobName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _copyJobGetResultCopyJobsClientDiagnostics.CreateScope("CopyJobGetResultCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = _copyJobGetResultCopyJobsRestClient.Create(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, jobName, data, cancellationToken); + var uri = _copyJobGetResultCopyJobsRestClient.CreateCreateRequestUri(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, jobName, data); + var rehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(RequestMethod.Put, uri.ToUri(), uri.ToString(), "None", null, OperationFinalStateVia.OriginalUri.ToString()); + var operation = new CosmosDBArmOperation(Response.FromValue(new CopyJobGetResultResource(Client, response), response.GetRawResponse()), rehydrationToken); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a Copy Job. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/copyJobs/{jobName} + /// + /// + /// Operation Id + /// CopyJobs_Get + /// + /// + /// Default Api Version + /// 2025-05-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the Copy Job. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetAsync(string jobName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(jobName, nameof(jobName)); + + using var scope = _copyJobGetResultCopyJobsClientDiagnostics.CreateScope("CopyJobGetResultCollection.Get"); + scope.Start(); + try + { + var response = await _copyJobGetResultCopyJobsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, jobName, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new CopyJobGetResultResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a Copy Job. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/copyJobs/{jobName} + /// + /// + /// Operation Id + /// CopyJobs_Get + /// + /// + /// Default Api Version + /// 2025-05-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the Copy Job. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Get(string jobName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(jobName, nameof(jobName)); + + using var scope = _copyJobGetResultCopyJobsClientDiagnostics.CreateScope("CopyJobGetResultCollection.Get"); + scope.Start(); + try + { + var response = _copyJobGetResultCopyJobsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, jobName, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new CopyJobGetResultResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a list of Copy jobs. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/copyJobs + /// + /// + /// Operation Id + /// CopyJobs_ListByDatabaseAccount + /// + /// + /// Default Api Version + /// 2025-05-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetAllAsync(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _copyJobGetResultCopyJobsRestClient.CreateListByDatabaseAccountRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _copyJobGetResultCopyJobsRestClient.CreateListByDatabaseAccountNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new CopyJobGetResultResource(Client, CopyJobGetResultData.DeserializeCopyJobGetResultData(e)), _copyJobGetResultCopyJobsClientDiagnostics, Pipeline, "CopyJobGetResultCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Get a list of Copy jobs. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/copyJobs + /// + /// + /// Operation Id + /// CopyJobs_ListByDatabaseAccount + /// + /// + /// Default Api Version + /// 2025-05-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetAll(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _copyJobGetResultCopyJobsRestClient.CreateListByDatabaseAccountRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _copyJobGetResultCopyJobsRestClient.CreateListByDatabaseAccountNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new CopyJobGetResultResource(Client, CopyJobGetResultData.DeserializeCopyJobGetResultData(e)), _copyJobGetResultCopyJobsClientDiagnostics, Pipeline, "CopyJobGetResultCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/copyJobs/{jobName} + /// + /// + /// Operation Id + /// CopyJobs_Get + /// + /// + /// Default Api Version + /// 2025-05-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the Copy Job. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> ExistsAsync(string jobName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(jobName, nameof(jobName)); + + using var scope = _copyJobGetResultCopyJobsClientDiagnostics.CreateScope("CopyJobGetResultCollection.Exists"); + scope.Start(); + try + { + var response = await _copyJobGetResultCopyJobsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, jobName, cancellationToken: cancellationToken).ConfigureAwait(false); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/copyJobs/{jobName} + /// + /// + /// Operation Id + /// CopyJobs_Get + /// + /// + /// Default Api Version + /// 2025-05-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the Copy Job. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Exists(string jobName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(jobName, nameof(jobName)); + + using var scope = _copyJobGetResultCopyJobsClientDiagnostics.CreateScope("CopyJobGetResultCollection.Exists"); + scope.Start(); + try + { + var response = _copyJobGetResultCopyJobsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, jobName, cancellationToken: cancellationToken); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/copyJobs/{jobName} + /// + /// + /// Operation Id + /// CopyJobs_Get + /// + /// + /// Default Api Version + /// 2025-05-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the Copy Job. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetIfExistsAsync(string jobName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(jobName, nameof(jobName)); + + using var scope = _copyJobGetResultCopyJobsClientDiagnostics.CreateScope("CopyJobGetResultCollection.GetIfExists"); + scope.Start(); + try + { + var response = await _copyJobGetResultCopyJobsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, jobName, cancellationToken: cancellationToken).ConfigureAwait(false); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new CopyJobGetResultResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/copyJobs/{jobName} + /// + /// + /// Operation Id + /// CopyJobs_Get + /// + /// + /// Default Api Version + /// 2025-05-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the Copy Job. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual NullableResponse GetIfExists(string jobName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(jobName, nameof(jobName)); + + using var scope = _copyJobGetResultCopyJobsClientDiagnostics.CreateScope("CopyJobGetResultCollection.GetIfExists"); + scope.Start(); + try + { + var response = _copyJobGetResultCopyJobsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, jobName, cancellationToken: cancellationToken); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new CopyJobGetResultResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetAll().GetEnumerator(); + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetAll().GetEnumerator(); + } + + IAsyncEnumerator IAsyncEnumerable.GetAsyncEnumerator(CancellationToken cancellationToken) + { + return GetAllAsync(cancellationToken: cancellationToken).GetAsyncEnumerator(cancellationToken); + } + } +} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CopyJobGetResultData.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CopyJobGetResultData.Serialization.cs new file mode 100644 index 000000000000..8a06b2f9a368 --- /dev/null +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CopyJobGetResultData.Serialization.cs @@ -0,0 +1,234 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text; +using System.Text.Json; +using Azure.Core; +using Azure.ResourceManager.CosmosDB.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.CosmosDB +{ + public partial class CopyJobGetResultData : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(CopyJobGetResultData)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + writer.WritePropertyName("properties"u8); + writer.WriteObjectValue(Properties, options); + } + + CopyJobGetResultData 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(CopyJobGetResultData)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeCopyJobGetResultData(document.RootElement, options); + } + + internal static CopyJobGetResultData DeserializeCopyJobGetResultData(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + CopyJobProperties properties = default; + ResourceIdentifier id = default; + string name = default; + ResourceType type = default; + SystemData systemData = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("properties"u8)) + { + properties = CopyJobProperties.DeserializeCopyJobProperties(property.Value, options); + continue; + } + if (property.NameEquals("id"u8)) + { + id = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("type"u8)) + { + type = new ResourceType(property.Value.GetString()); + continue; + } + if (property.NameEquals("systemData"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + systemData = JsonSerializer.Deserialize(property.Value.GetRawText()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new CopyJobGetResultData( + id, + name, + type, + systemData, + properties, + serializedAdditionalRawData); + } + + private BinaryData SerializeBicep(ModelReaderWriterOptions options) + { + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Name), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" name: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Name)) + { + builder.Append(" name: "); + if (Name.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{Name}'''"); + } + else + { + builder.AppendLine($"'{Name}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Properties), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" properties: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Properties)) + { + builder.Append(" properties: "); + BicepSerializationHelpers.AppendChildObject(builder, Properties, options, 2, false, " properties: "); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Id), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" id: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Id)) + { + builder.Append(" id: "); + builder.AppendLine($"'{Id.ToString()}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(SystemData), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" systemData: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(SystemData)) + { + builder.Append(" systemData: "); + builder.AppendLine($"'{SystemData.ToString()}'"); + } + } + + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + case "bicep": + return SerializeBicep(options); + default: + throw new FormatException($"The model {nameof(CopyJobGetResultData)} does not support writing '{options.Format}' format."); + } + } + + CopyJobGetResultData 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 DeserializeCopyJobGetResultData(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(CopyJobGetResultData)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CopyJobGetResultData.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CopyJobGetResultData.cs new file mode 100644 index 000000000000..0f1efeae1992 --- /dev/null +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CopyJobGetResultData.cs @@ -0,0 +1,86 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; +using Azure.ResourceManager.CosmosDB.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.CosmosDB +{ + /// + /// A class representing the CopyJobGetResult data model. + /// A Cosmos DB Copy Job + /// + public partial class CopyJobGetResultData : ResourceData + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The properties of a Copy Job. + /// is null. + public CopyJobGetResultData(CopyJobProperties properties) + { + Argument.AssertNotNull(properties, nameof(properties)); + + Properties = properties; + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The properties of a Copy Job. + /// Keeps track of any properties unknown to the library. + internal CopyJobGetResultData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, CopyJobProperties properties, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) + { + Properties = properties; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal CopyJobGetResultData() + { + } + + /// The properties of a Copy Job. + [WirePath("properties")] + public CopyJobProperties Properties { get; set; } + } +} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CopyJobGetResultResource.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CopyJobGetResultResource.Serialization.cs new file mode 100644 index 000000000000..6f53aa1229a4 --- /dev/null +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CopyJobGetResultResource.Serialization.cs @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; + +namespace Azure.ResourceManager.CosmosDB +{ + public partial class CopyJobGetResultResource : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); + + CopyJobGetResultData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options); + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options); + + CopyJobGetResultData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options); + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)Data).GetFormatFromOptions(options); + } +} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CopyJobGetResultResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CopyJobGetResultResource.cs new file mode 100644 index 000000000000..a05638eb37a2 --- /dev/null +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CopyJobGetResultResource.cs @@ -0,0 +1,571 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.CosmosDB +{ + /// + /// A Class representing a CopyJobGetResult along with the instance operations that can be performed on it. + /// If you have a you can construct a + /// from an instance of using the GetCopyJobGetResultResource method. + /// Otherwise you can get one from its parent resource using the GetCopyJobGetResult method. + /// + public partial class CopyJobGetResultResource : ArmResource + { + /// Generate the resource identifier of a instance. + /// The subscriptionId. + /// The resourceGroupName. + /// The accountName. + /// The jobName. + public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string accountName, string jobName) + { + var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/copyJobs/{jobName}"; + return new ResourceIdentifier(resourceId); + } + + private readonly ClientDiagnostics _copyJobGetResultCopyJobsClientDiagnostics; + private readonly CopyJobsRestOperations _copyJobGetResultCopyJobsRestClient; + private readonly CopyJobGetResultData _data; + + /// Gets the resource type for the operations. + public static readonly ResourceType ResourceType = "Microsoft.DocumentDB/databaseAccounts/copyJobs"; + + /// Initializes a new instance of the class for mocking. + protected CopyJobGetResultResource() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The resource that is the target of operations. + internal CopyJobGetResultResource(ArmClient client, CopyJobGetResultData data) : this(client, data.Id) + { + HasData = true; + _data = data; + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The identifier of the resource that is the target of operations. + internal CopyJobGetResultResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _copyJobGetResultCopyJobsClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.CosmosDB", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string copyJobGetResultCopyJobsApiVersion); + _copyJobGetResultCopyJobsRestClient = new CopyJobsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, copyJobGetResultCopyJobsApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + /// Gets whether or not the current instance has data. + public virtual bool HasData { get; } + + /// Gets the data representing this Feature. + /// Throws if there is no data loaded in the current instance. + public virtual CopyJobGetResultData Data + { + get + { + if (!HasData) + throw new InvalidOperationException("The current instance does not have data, you must call Get first."); + return _data; + } + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceType), nameof(id)); + } + + /// + /// Get a Copy Job. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/copyJobs/{jobName} + /// + /// + /// Operation Id + /// CopyJobs_Get + /// + /// + /// Default Api Version + /// 2025-05-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + { + using var scope = _copyJobGetResultCopyJobsClientDiagnostics.CreateScope("CopyJobGetResultResource.Get"); + scope.Start(); + try + { + var response = await _copyJobGetResultCopyJobsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new CopyJobGetResultResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a Copy Job. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/copyJobs/{jobName} + /// + /// + /// Operation Id + /// CopyJobs_Get + /// + /// + /// Default Api Version + /// 2025-05-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual Response Get(CancellationToken cancellationToken = default) + { + using var scope = _copyJobGetResultCopyJobsClientDiagnostics.CreateScope("CopyJobGetResultResource.Get"); + scope.Start(); + try + { + var response = _copyJobGetResultCopyJobsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new CopyJobGetResultResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Creates a Copy Job. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/copyJobs/{jobName} + /// + /// + /// Operation Id + /// CopyJobs_Create + /// + /// + /// Default Api Version + /// 2025-05-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The to use. + /// The cancellation token to use. + /// is null. + public virtual async Task> UpdateAsync(WaitUntil waitUntil, CopyJobGetResultData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _copyJobGetResultCopyJobsClientDiagnostics.CreateScope("CopyJobGetResultResource.Update"); + scope.Start(); + try + { + var response = await _copyJobGetResultCopyJobsRestClient.CreateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, cancellationToken).ConfigureAwait(false); + var uri = _copyJobGetResultCopyJobsRestClient.CreateCreateRequestUri(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data); + var rehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(RequestMethod.Put, uri.ToUri(), uri.ToString(), "None", null, OperationFinalStateVia.OriginalUri.ToString()); + var operation = new CosmosDBArmOperation(Response.FromValue(new CopyJobGetResultResource(Client, response), response.GetRawResponse()), rehydrationToken); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Creates a Copy Job. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/copyJobs/{jobName} + /// + /// + /// Operation Id + /// CopyJobs_Create + /// + /// + /// Default Api Version + /// 2025-05-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The to use. + /// The cancellation token to use. + /// is null. + public virtual ArmOperation Update(WaitUntil waitUntil, CopyJobGetResultData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _copyJobGetResultCopyJobsClientDiagnostics.CreateScope("CopyJobGetResultResource.Update"); + scope.Start(); + try + { + var response = _copyJobGetResultCopyJobsRestClient.Create(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, cancellationToken); + var uri = _copyJobGetResultCopyJobsRestClient.CreateCreateRequestUri(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data); + var rehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(RequestMethod.Put, uri.ToUri(), uri.ToString(), "None", null, OperationFinalStateVia.OriginalUri.ToString()); + var operation = new CosmosDBArmOperation(Response.FromValue(new CopyJobGetResultResource(Client, response), response.GetRawResponse()), rehydrationToken); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Pause a Copy Job. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/copyJobs/{jobName}/pause + /// + /// + /// Operation Id + /// CopyJobs_Pause + /// + /// + /// Default Api Version + /// 2025-05-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> PauseAsync(CancellationToken cancellationToken = default) + { + using var scope = _copyJobGetResultCopyJobsClientDiagnostics.CreateScope("CopyJobGetResultResource.Pause"); + scope.Start(); + try + { + var response = await _copyJobGetResultCopyJobsRestClient.PauseAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + return Response.FromValue(new CopyJobGetResultResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Pause a Copy Job. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/copyJobs/{jobName}/pause + /// + /// + /// Operation Id + /// CopyJobs_Pause + /// + /// + /// Default Api Version + /// 2025-05-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual Response Pause(CancellationToken cancellationToken = default) + { + using var scope = _copyJobGetResultCopyJobsClientDiagnostics.CreateScope("CopyJobGetResultResource.Pause"); + scope.Start(); + try + { + var response = _copyJobGetResultCopyJobsRestClient.Pause(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + return Response.FromValue(new CopyJobGetResultResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Resumes a Copy Job. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/copyJobs/{jobName}/resume + /// + /// + /// Operation Id + /// CopyJobs_Resume + /// + /// + /// Default Api Version + /// 2025-05-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> ResumeAsync(CancellationToken cancellationToken = default) + { + using var scope = _copyJobGetResultCopyJobsClientDiagnostics.CreateScope("CopyJobGetResultResource.Resume"); + scope.Start(); + try + { + var response = await _copyJobGetResultCopyJobsRestClient.ResumeAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + return Response.FromValue(new CopyJobGetResultResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Resumes a Copy Job. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/copyJobs/{jobName}/resume + /// + /// + /// Operation Id + /// CopyJobs_Resume + /// + /// + /// Default Api Version + /// 2025-05-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual Response Resume(CancellationToken cancellationToken = default) + { + using var scope = _copyJobGetResultCopyJobsClientDiagnostics.CreateScope("CopyJobGetResultResource.Resume"); + scope.Start(); + try + { + var response = _copyJobGetResultCopyJobsRestClient.Resume(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + return Response.FromValue(new CopyJobGetResultResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Cancels a Copy Job. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/copyJobs/{jobName}/cancel + /// + /// + /// Operation Id + /// CopyJobs_Cancel + /// + /// + /// Default Api Version + /// 2025-05-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> CancelAsync(CancellationToken cancellationToken = default) + { + using var scope = _copyJobGetResultCopyJobsClientDiagnostics.CreateScope("CopyJobGetResultResource.Cancel"); + scope.Start(); + try + { + var response = await _copyJobGetResultCopyJobsRestClient.CancelAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + return Response.FromValue(new CopyJobGetResultResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Cancels a Copy Job. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/copyJobs/{jobName}/cancel + /// + /// + /// Operation Id + /// CopyJobs_Cancel + /// + /// + /// Default Api Version + /// 2025-05-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual Response Cancel(CancellationToken cancellationToken = default) + { + using var scope = _copyJobGetResultCopyJobsClientDiagnostics.CreateScope("CopyJobGetResultResource.Cancel"); + scope.Start(); + try + { + var response = _copyJobGetResultCopyJobsRestClient.Cancel(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + return Response.FromValue(new CopyJobGetResultResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Completes an Online Copy Job. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/copyJobs/{jobName}/complete + /// + /// + /// Operation Id + /// CopyJobs_Complete + /// + /// + /// Default Api Version + /// 2025-05-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> CompleteAsync(CancellationToken cancellationToken = default) + { + using var scope = _copyJobGetResultCopyJobsClientDiagnostics.CreateScope("CopyJobGetResultResource.Complete"); + scope.Start(); + try + { + var response = await _copyJobGetResultCopyJobsRestClient.CompleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + return Response.FromValue(new CopyJobGetResultResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Completes an Online Copy Job. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/copyJobs/{jobName}/complete + /// + /// + /// Operation Id + /// CopyJobs_Complete + /// + /// + /// Default Api Version + /// 2025-05-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual Response Complete(CancellationToken cancellationToken = default) + { + using var scope = _copyJobGetResultCopyJobsClientDiagnostics.CreateScope("CopyJobGetResultResource.Complete"); + scope.Start(); + try + { + var response = _copyJobGetResultCopyJobsRestClient.Complete(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + return Response.FromValue(new CopyJobGetResultResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBAccountCollection.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBAccountCollection.cs index a510ac87716c..5250a9b78c20 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBAccountCollection.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBAccountCollection.cs @@ -66,7 +66,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -115,7 +115,7 @@ public virtual async Task> CreateOrUpdateA /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -164,7 +164,7 @@ public virtual ArmOperation CreateOrUpdate(WaitUntil wa /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -209,7 +209,7 @@ public virtual async Task> GetAsync(string acc /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -254,7 +254,7 @@ public virtual Response Get(string accountName, Cancell /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -283,7 +283,7 @@ public virtual AsyncPageable GetAllAsync(CancellationTo /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -312,7 +312,7 @@ public virtual Pageable GetAll(CancellationToken cancel /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -355,7 +355,7 @@ public virtual async Task> ExistsAsync(string accountName, Cancel /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -398,7 +398,7 @@ public virtual Response Exists(string accountName, CancellationToken cance /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -443,7 +443,7 @@ public virtual async Task> GetIfExists /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBAccountData.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBAccountData.Serialization.cs index 7e56326f9502..eff083ba6646 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBAccountData.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBAccountData.Serialization.cs @@ -337,6 +337,11 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri writer.WritePropertyName("enablePerRegionPerPartitionAutoscale"u8); writer.WriteBooleanValue(EnablePerRegionPerPartitionAutoscale.Value); } + if (Optional.IsDefined(EnableAllVersionsAndDeletesChangeFeed)) + { + writer.WritePropertyName("enableAllVersionsAndDeletesChangeFeed"u8); + writer.WriteBooleanValue(EnableAllVersionsAndDeletesChangeFeed.Value); + } writer.WriteEndObject(); } @@ -414,6 +419,7 @@ internal static CosmosDBAccountData DeserializeCosmosDBAccountData(JsonElement e bool? enablePriorityBasedExecution = default; DefaultPriorityLevel? defaultPriorityLevel = default; bool? enablePerRegionPerPartitionAutoscale = default; + bool? enableAllVersionsAndDeletesChangeFeed = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -944,6 +950,15 @@ internal static CosmosDBAccountData DeserializeCosmosDBAccountData(JsonElement e enablePerRegionPerPartitionAutoscale = property0.Value.GetBoolean(); continue; } + if (property0.NameEquals("enableAllVersionsAndDeletesChangeFeed"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + enableAllVersionsAndDeletesChangeFeed = property0.Value.GetBoolean(); + continue; + } } continue; } @@ -1007,6 +1022,7 @@ internal static CosmosDBAccountData DeserializeCosmosDBAccountData(JsonElement e enablePriorityBasedExecution, defaultPriorityLevel, enablePerRegionPerPartitionAutoscale, + enableAllVersionsAndDeletesChangeFeed, identity, serializedAdditionalRawData); } @@ -1996,6 +2012,22 @@ private BinaryData SerializeBicep(ModelReaderWriterOptions options) } } + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(EnableAllVersionsAndDeletesChangeFeed), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" enableAllVersionsAndDeletesChangeFeed: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(EnableAllVersionsAndDeletesChangeFeed)) + { + builder.Append(" enableAllVersionsAndDeletesChangeFeed: "); + var boolValue = EnableAllVersionsAndDeletesChangeFeed.Value == true ? "true" : "false"; + builder.AppendLine($"{boolValue}"); + } + } + builder.AppendLine(" }"); builder.AppendLine("}"); return BinaryData.FromString(builder.ToString()); diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBAccountData.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBAccountData.cs index 349d2b3b0892..bda560b02e83 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBAccountData.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBAccountData.cs @@ -125,9 +125,10 @@ public CosmosDBAccountData(AzureLocation location) : base(location) /// Flag to indicate enabling/disabling of Priority Based Execution Preview feature on the account. /// Enum to indicate default Priority Level of request for Priority Based Execution. /// Flag to indicate enabling/disabling of Per-Region Per-partition autoscale Preview feature on the account. + /// Flag to indicate if All Versions and Deletes Change feed feature is enabled on the account. /// Identity for the resource. /// Keeps track of any properties unknown to the library. - internal CosmosDBAccountData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, CosmosDBAccountKind? kind, string provisioningState, string documentEndpoint, CosmosDBAccountOfferType? databaseAccountOfferType, IList ipRules, bool? isVirtualNetworkFilterEnabled, bool? enableAutomaticFailover, ConsistencyPolicy consistencyPolicy, IList capabilities, IReadOnlyList writeLocations, IReadOnlyList readLocations, IReadOnlyList locations, IReadOnlyList failoverPolicies, IList virtualNetworkRules, IReadOnlyList privateEndpointConnections, bool? enableMultipleWriteLocations, bool? enableCassandraConnector, ConnectorOffer? connectorOffer, bool? disableKeyBasedMetadataWriteAccess, Uri keyVaultKeyUri, string defaultIdentity, CosmosDBPublicNetworkAccess? publicNetworkAccess, bool? isFreeTierEnabled, ApiProperties apiProperties, bool? isAnalyticalStorageEnabled, AnalyticalStorageConfiguration analyticalStorageConfiguration, Guid? instanceId, CosmosDBAccountCreateMode? createMode, CosmosDBAccountRestoreParameters restoreParameters, CosmosDBAccountBackupPolicy backupPolicy, IList cors, NetworkAclBypass? networkAclBypass, IList networkAclBypassResourceIds, DiagnosticLogSettings diagnosticLogSettings, bool? disableLocalAuth, CosmosDBAccountCapacity capacity, CapacityMode? capacityMode, CapacityModeChangeTransitionState capacityModeChangeTransitionState, bool? enableMaterializedViews, DatabaseAccountKeysMetadata keysMetadata, bool? enablePartitionMerge, bool? enableBurstCapacity, CosmosDBMinimalTlsVersion? minimalTlsVersion, string customerManagedKeyStatus, bool? enablePriorityBasedExecution, DefaultPriorityLevel? defaultPriorityLevel, bool? enablePerRegionPerPartitionAutoscale, ManagedServiceIdentity identity, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) + internal CosmosDBAccountData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, CosmosDBAccountKind? kind, string provisioningState, string documentEndpoint, CosmosDBAccountOfferType? databaseAccountOfferType, IList ipRules, bool? isVirtualNetworkFilterEnabled, bool? enableAutomaticFailover, ConsistencyPolicy consistencyPolicy, IList capabilities, IReadOnlyList writeLocations, IReadOnlyList readLocations, IReadOnlyList locations, IReadOnlyList failoverPolicies, IList virtualNetworkRules, IReadOnlyList privateEndpointConnections, bool? enableMultipleWriteLocations, bool? enableCassandraConnector, ConnectorOffer? connectorOffer, bool? disableKeyBasedMetadataWriteAccess, Uri keyVaultKeyUri, string defaultIdentity, CosmosDBPublicNetworkAccess? publicNetworkAccess, bool? isFreeTierEnabled, ApiProperties apiProperties, bool? isAnalyticalStorageEnabled, AnalyticalStorageConfiguration analyticalStorageConfiguration, Guid? instanceId, CosmosDBAccountCreateMode? createMode, CosmosDBAccountRestoreParameters restoreParameters, CosmosDBAccountBackupPolicy backupPolicy, IList cors, NetworkAclBypass? networkAclBypass, IList networkAclBypassResourceIds, DiagnosticLogSettings diagnosticLogSettings, bool? disableLocalAuth, CosmosDBAccountCapacity capacity, CapacityMode? capacityMode, CapacityModeChangeTransitionState capacityModeChangeTransitionState, bool? enableMaterializedViews, DatabaseAccountKeysMetadata keysMetadata, bool? enablePartitionMerge, bool? enableBurstCapacity, CosmosDBMinimalTlsVersion? minimalTlsVersion, string customerManagedKeyStatus, bool? enablePriorityBasedExecution, DefaultPriorityLevel? defaultPriorityLevel, bool? enablePerRegionPerPartitionAutoscale, bool? enableAllVersionsAndDeletesChangeFeed, ManagedServiceIdentity identity, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) { Kind = kind; ProvisioningState = provisioningState; @@ -176,6 +177,7 @@ internal CosmosDBAccountData(ResourceIdentifier id, string name, ResourceType re EnablePriorityBasedExecution = enablePriorityBasedExecution; DefaultPriorityLevel = defaultPriorityLevel; EnablePerRegionPerPartitionAutoscale = enablePerRegionPerPartitionAutoscale; + EnableAllVersionsAndDeletesChangeFeed = enableAllVersionsAndDeletesChangeFeed; Identity = identity; _serializedAdditionalRawData = serializedAdditionalRawData; } @@ -378,6 +380,9 @@ public int? CapacityTotalThroughputLimit /// Flag to indicate enabling/disabling of Per-Region Per-partition autoscale Preview feature on the account. [WirePath("properties.enablePerRegionPerPartitionAutoscale")] public bool? EnablePerRegionPerPartitionAutoscale { get; set; } + /// Flag to indicate if All Versions and Deletes Change feed feature is enabled on the account. + [WirePath("properties.enableAllVersionsAndDeletesChangeFeed")] + public bool? EnableAllVersionsAndDeletesChangeFeed { get; set; } /// Identity for the resource. [WirePath("identity")] public ManagedServiceIdentity Identity { get; set; } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBAccountResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBAccountResource.cs index 742c80d997e3..a80623deb0b5 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBAccountResource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBAccountResource.cs @@ -155,7 +155,7 @@ public virtual CosmosDBChaosFaultResourceCollection GetCosmosDBChaosFaultResourc /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -186,7 +186,7 @@ public virtual async Task> GetCosmosDBChaos /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -204,6 +204,75 @@ public virtual Response GetCosmosDBChaosFaultResourc return GetCosmosDBChaosFaultResources().Get(chaosFault, cancellationToken); } + /// Gets a collection of CopyJobGetResultResources in the CosmosDBAccount. + /// An object representing collection of CopyJobGetResultResources and their operations over a CopyJobGetResultResource. + public virtual CopyJobGetResultCollection GetCopyJobGetResults() + { + return GetCachedClient(client => new CopyJobGetResultCollection(client, Id)); + } + + /// + /// Get a Copy Job. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/copyJobs/{jobName} + /// + /// + /// Operation Id + /// CopyJobs_Get + /// + /// + /// Default Api Version + /// 2025-05-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the Copy Job. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetCopyJobGetResultAsync(string jobName, CancellationToken cancellationToken = default) + { + return await GetCopyJobGetResults().GetAsync(jobName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get a Copy Job. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/copyJobs/{jobName} + /// + /// + /// Operation Id + /// CopyJobs_Get + /// + /// + /// Default Api Version + /// 2025-05-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the Copy Job. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetCopyJobGetResult(string jobName, CancellationToken cancellationToken = default) + { + return GetCopyJobGetResults().Get(jobName, cancellationToken); + } + /// Gets a collection of GraphResourceGetResultResources in the CosmosDBAccount. /// An object representing collection of GraphResourceGetResultResources and their operations over a GraphResourceGetResultResource. public virtual GraphResourceGetResultCollection GetGraphResourceGetResults() @@ -224,7 +293,7 @@ public virtual GraphResourceGetResultCollection GetGraphResourceGetResults() /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -255,7 +324,7 @@ public virtual async Task> GetGraphReso /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -293,7 +362,7 @@ public virtual CosmosDBSqlDatabaseCollection GetCosmosDBSqlDatabases() /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -324,7 +393,7 @@ public virtual async Task> GetCosmosDBSqlD /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -362,7 +431,7 @@ public virtual CosmosDBSqlRoleDefinitionCollection GetCosmosDBSqlRoleDefinitions /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -393,7 +462,7 @@ public virtual async Task> GetCosmos /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -431,7 +500,7 @@ public virtual CosmosDBSqlRoleAssignmentCollection GetCosmosDBSqlRoleAssignments /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -462,7 +531,7 @@ public virtual async Task> GetCosmos /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -500,7 +569,7 @@ public virtual MongoDBDatabaseCollection GetMongoDBDatabases() /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -531,7 +600,7 @@ public virtual async Task> GetMongoDBDatabaseA /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -569,7 +638,7 @@ public virtual MongoDBRoleDefinitionCollection GetMongoDBRoleDefinitions() /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -600,7 +669,7 @@ public virtual async Task> GetMongoDBRol /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -638,7 +707,7 @@ public virtual MongoDBUserDefinitionCollection GetMongoDBUserDefinitions() /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -669,7 +738,7 @@ public virtual async Task> GetMongoDBUse /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -707,7 +776,7 @@ public virtual CosmosDBTableCollection GetCosmosDBTables() /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -738,7 +807,7 @@ public virtual async Task> GetCosmosDBTableAsync /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -776,7 +845,7 @@ public virtual CosmosDBTableRoleDefinitionCollection GetCosmosDBTableRoleDefinit /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -807,7 +876,7 @@ public virtual async Task> GetCosm /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -845,7 +914,7 @@ public virtual CosmosDBTableRoleAssignmentCollection GetCosmosDBTableRoleAssignm /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -876,7 +945,7 @@ public virtual async Task> GetCosm /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -914,7 +983,7 @@ public virtual CassandraKeyspaceCollection GetCassandraKeyspaces() /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -945,7 +1014,7 @@ public virtual async Task> GetCassandraKeysp /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -963,6 +1032,144 @@ public virtual Response GetCassandraKeyspace(string k return GetCassandraKeyspaces().Get(keyspaceName, cancellationToken); } + /// Gets a collection of CassandraRoleDefinitionResources in the CosmosDBAccount. + /// An object representing collection of CassandraRoleDefinitionResources and their operations over a CassandraRoleDefinitionResource. + public virtual CassandraRoleDefinitionResourceCollection GetCassandraRoleDefinitionResources() + { + return GetCachedClient(client => new CassandraRoleDefinitionResourceCollection(client, Id)); + } + + /// + /// Retrieves the properties of an existing Azure Cosmos DB Cassandra Role Definition with the given Id. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraRoleDefinitions/{roleDefinitionId} + /// + /// + /// Operation Id + /// CassandraResources_GetCassandraRoleDefinition + /// + /// + /// Default Api Version + /// 2025-05-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The GUID for the Role Definition. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetCassandraRoleDefinitionResourceAsync(string roleDefinitionId, CancellationToken cancellationToken = default) + { + return await GetCassandraRoleDefinitionResources().GetAsync(roleDefinitionId, cancellationToken).ConfigureAwait(false); + } + + /// + /// Retrieves the properties of an existing Azure Cosmos DB Cassandra Role Definition with the given Id. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraRoleDefinitions/{roleDefinitionId} + /// + /// + /// Operation Id + /// CassandraResources_GetCassandraRoleDefinition + /// + /// + /// Default Api Version + /// 2025-05-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The GUID for the Role Definition. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetCassandraRoleDefinitionResource(string roleDefinitionId, CancellationToken cancellationToken = default) + { + return GetCassandraRoleDefinitionResources().Get(roleDefinitionId, cancellationToken); + } + + /// Gets a collection of CassandraRoleAssignmentResources in the CosmosDBAccount. + /// An object representing collection of CassandraRoleAssignmentResources and their operations over a CassandraRoleAssignmentResource. + public virtual CassandraRoleAssignmentResourceCollection GetCassandraRoleAssignmentResources() + { + return GetCachedClient(client => new CassandraRoleAssignmentResourceCollection(client, Id)); + } + + /// + /// Retrieves the properties of an existing Azure Cosmos DB Cassandra Role Assignment with the given Id. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraRoleAssignments/{roleAssignmentId} + /// + /// + /// Operation Id + /// CassandraResources_GetCassandraRoleAssignment + /// + /// + /// Default Api Version + /// 2025-05-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The GUID for the Role Assignment. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetCassandraRoleAssignmentResourceAsync(string roleAssignmentId, CancellationToken cancellationToken = default) + { + return await GetCassandraRoleAssignmentResources().GetAsync(roleAssignmentId, cancellationToken).ConfigureAwait(false); + } + + /// + /// Retrieves the properties of an existing Azure Cosmos DB Cassandra Role Assignment with the given Id. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraRoleAssignments/{roleAssignmentId} + /// + /// + /// Operation Id + /// CassandraResources_GetCassandraRoleAssignment + /// + /// + /// Default Api Version + /// 2025-05-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The GUID for the Role Assignment. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetCassandraRoleAssignmentResource(string roleAssignmentId, CancellationToken cancellationToken = default) + { + return GetCassandraRoleAssignmentResources().Get(roleAssignmentId, cancellationToken); + } + /// Gets a collection of GremlinDatabaseResources in the CosmosDBAccount. /// An object representing collection of GremlinDatabaseResources and their operations over a GremlinDatabaseResource. public virtual GremlinDatabaseCollection GetGremlinDatabases() @@ -983,7 +1190,7 @@ public virtual GremlinDatabaseCollection GetGremlinDatabases() /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -1014,7 +1221,7 @@ public virtual async Task> GetGremlinDatabaseA /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -1032,6 +1239,144 @@ public virtual Response GetGremlinDatabase(string datab return GetGremlinDatabases().Get(databaseName, cancellationToken); } + /// Gets a collection of GremlinRoleDefinitionResources in the CosmosDBAccount. + /// An object representing collection of GremlinRoleDefinitionResources and their operations over a GremlinRoleDefinitionResource. + public virtual GremlinRoleDefinitionResourceCollection GetGremlinRoleDefinitionResources() + { + return GetCachedClient(client => new GremlinRoleDefinitionResourceCollection(client, Id)); + } + + /// + /// Retrieves the properties of an existing Azure Cosmos DB Gremlin Role Definition with the given Id. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinRoleDefinitions/{roleDefinitionId} + /// + /// + /// Operation Id + /// GremlinResources_GetGremlinRoleDefinition + /// + /// + /// Default Api Version + /// 2025-05-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The GUID for the Role Definition. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetGremlinRoleDefinitionResourceAsync(string roleDefinitionId, CancellationToken cancellationToken = default) + { + return await GetGremlinRoleDefinitionResources().GetAsync(roleDefinitionId, cancellationToken).ConfigureAwait(false); + } + + /// + /// Retrieves the properties of an existing Azure Cosmos DB Gremlin Role Definition with the given Id. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinRoleDefinitions/{roleDefinitionId} + /// + /// + /// Operation Id + /// GremlinResources_GetGremlinRoleDefinition + /// + /// + /// Default Api Version + /// 2025-05-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The GUID for the Role Definition. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetGremlinRoleDefinitionResource(string roleDefinitionId, CancellationToken cancellationToken = default) + { + return GetGremlinRoleDefinitionResources().Get(roleDefinitionId, cancellationToken); + } + + /// Gets a collection of GremlinRoleAssignmentResources in the CosmosDBAccount. + /// An object representing collection of GremlinRoleAssignmentResources and their operations over a GremlinRoleAssignmentResource. + public virtual GremlinRoleAssignmentResourceCollection GetGremlinRoleAssignmentResources() + { + return GetCachedClient(client => new GremlinRoleAssignmentResourceCollection(client, Id)); + } + + /// + /// Retrieves the properties of an existing Azure Cosmos DB Gremlin Role Assignment with the given Id. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinRoleAssignments/{roleAssignmentId} + /// + /// + /// Operation Id + /// GremlinResources_GetGremlinRoleAssignment + /// + /// + /// Default Api Version + /// 2025-05-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The GUID for the Role Assignment. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetGremlinRoleAssignmentResourceAsync(string roleAssignmentId, CancellationToken cancellationToken = default) + { + return await GetGremlinRoleAssignmentResources().GetAsync(roleAssignmentId, cancellationToken).ConfigureAwait(false); + } + + /// + /// Retrieves the properties of an existing Azure Cosmos DB Gremlin Role Assignment with the given Id. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinRoleAssignments/{roleAssignmentId} + /// + /// + /// Operation Id + /// GremlinResources_GetGremlinRoleAssignment + /// + /// + /// Default Api Version + /// 2025-05-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The GUID for the Role Assignment. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetGremlinRoleAssignmentResource(string roleAssignmentId, CancellationToken cancellationToken = default) + { + return GetGremlinRoleAssignmentResources().Get(roleAssignmentId, cancellationToken); + } + /// Gets a collection of DataTransferJobGetResultResources in the CosmosDBAccount. /// An object representing collection of DataTransferJobGetResultResources and their operations over a DataTransferJobGetResultResource. public virtual DataTransferJobGetResultCollection GetDataTransferJobGetResults() @@ -1052,7 +1397,7 @@ public virtual DataTransferJobGetResultCollection GetDataTransferJobGetResults() /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -1083,7 +1428,7 @@ public virtual async Task> GetDataTra /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -1121,7 +1466,7 @@ public virtual NetworkSecurityPerimeterConfigurationCollection GetNetworkSecurit /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -1152,7 +1497,7 @@ public virtual async Task /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -1190,7 +1535,7 @@ public virtual CosmosDBPrivateEndpointConnectionCollection GetCosmosDBPrivateEnd /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -1221,7 +1566,7 @@ public virtual async Task> G /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -1259,7 +1604,7 @@ public virtual CosmosDBPrivateLinkResourceCollection GetCosmosDBPrivateLinkResou /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -1290,7 +1635,7 @@ public virtual async Task> GetCosmosDBPriv /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -1328,7 +1673,7 @@ public virtual CosmosDBServiceCollection GetCosmosDBServices() /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -1359,7 +1704,7 @@ public virtual async Task> GetCosmosDBServiceA /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -1377,6 +1722,144 @@ public virtual Response GetCosmosDBService(string servi return GetCosmosDBServices().Get(serviceName, cancellationToken); } + /// Gets a collection of MongoMIRoleDefinitionResources in the CosmosDBAccount. + /// An object representing collection of MongoMIRoleDefinitionResources and their operations over a MongoMIRoleDefinitionResource. + public virtual MongoMIRoleDefinitionResourceCollection GetMongoMIRoleDefinitionResources() + { + return GetCachedClient(client => new MongoMIRoleDefinitionResourceCollection(client, Id)); + } + + /// + /// Retrieves the properties of an existing Azure Cosmos DB MongoMI Role Definition with the given Id. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongoMIRoleDefinitions/{roleDefinitionId} + /// + /// + /// Operation Id + /// MongoMIResources_GetMongoMIRoleDefinition + /// + /// + /// Default Api Version + /// 2025-05-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The GUID for the Role Definition. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetMongoMIRoleDefinitionResourceAsync(string roleDefinitionId, CancellationToken cancellationToken = default) + { + return await GetMongoMIRoleDefinitionResources().GetAsync(roleDefinitionId, cancellationToken).ConfigureAwait(false); + } + + /// + /// Retrieves the properties of an existing Azure Cosmos DB MongoMI Role Definition with the given Id. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongoMIRoleDefinitions/{roleDefinitionId} + /// + /// + /// Operation Id + /// MongoMIResources_GetMongoMIRoleDefinition + /// + /// + /// Default Api Version + /// 2025-05-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The GUID for the Role Definition. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetMongoMIRoleDefinitionResource(string roleDefinitionId, CancellationToken cancellationToken = default) + { + return GetMongoMIRoleDefinitionResources().Get(roleDefinitionId, cancellationToken); + } + + /// Gets a collection of MongoMIRoleAssignmentResources in the CosmosDBAccount. + /// An object representing collection of MongoMIRoleAssignmentResources and their operations over a MongoMIRoleAssignmentResource. + public virtual MongoMIRoleAssignmentResourceCollection GetMongoMIRoleAssignmentResources() + { + return GetCachedClient(client => new MongoMIRoleAssignmentResourceCollection(client, Id)); + } + + /// + /// Retrieves the properties of an existing Azure Cosmos DB MongoMI Role Assignment with the given Id. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongoMIRoleAssignments/{roleAssignmentId} + /// + /// + /// Operation Id + /// MongoMIResources_GetMongoMIRoleAssignment + /// + /// + /// Default Api Version + /// 2025-05-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The GUID for the Role Assignment. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetMongoMIRoleAssignmentResourceAsync(string roleAssignmentId, CancellationToken cancellationToken = default) + { + return await GetMongoMIRoleAssignmentResources().GetAsync(roleAssignmentId, cancellationToken).ConfigureAwait(false); + } + + /// + /// Retrieves the properties of an existing Azure Cosmos DB MongoMI Role Assignment with the given Id. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongoMIRoleAssignments/{roleAssignmentId} + /// + /// + /// Operation Id + /// MongoMIResources_GetMongoMIRoleAssignment + /// + /// + /// Default Api Version + /// 2025-05-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The GUID for the Role Assignment. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetMongoMIRoleAssignmentResource(string roleAssignmentId, CancellationToken cancellationToken = default) + { + return GetMongoMIRoleAssignmentResources().Get(roleAssignmentId, cancellationToken); + } + /// /// Retrieves the properties of an existing Azure Cosmos DB database account. /// @@ -1390,7 +1873,7 @@ public virtual Response GetCosmosDBService(string servi /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -1430,7 +1913,7 @@ public virtual async Task> GetAsync(Cancellati /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -1470,7 +1953,7 @@ public virtual Response Get(CancellationToken cancellat /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -1512,7 +1995,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -1554,7 +2037,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -1600,7 +2083,7 @@ public virtual async Task> UpdateAsync(Wai /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -1646,7 +2129,7 @@ public virtual ArmOperation Update(WaitUntil waitUntil, /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -1692,7 +2175,7 @@ public virtual async Task FailoverPriorityChangeAsync(WaitUntil wa /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -1738,7 +2221,7 @@ public virtual ArmOperation FailoverPriorityChange(WaitUntil waitUntil, CosmosDB /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -1776,7 +2259,7 @@ public virtual async Task> GetKeysAsync(Cancell /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -1814,7 +2297,7 @@ public virtual Response GetKeys(CancellationToken cancel /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -1843,7 +2326,7 @@ public virtual AsyncPageable GetConnectionStrin /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -1872,7 +2355,7 @@ public virtual Pageable GetConnectionStrings(Ca /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -1918,7 +2401,7 @@ public virtual async Task OfflineRegionAsync(WaitUntil waitUntil, /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -1964,7 +2447,7 @@ public virtual ArmOperation OfflineRegion(WaitUntil waitUntil, RegionForOnlineOf /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -2010,7 +2493,7 @@ public virtual async Task OnlineRegionAsync(WaitUntil waitUntil, R /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -2056,7 +2539,7 @@ public virtual ArmOperation OnlineRegion(WaitUntil waitUntil, RegionForOnlineOff /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -2094,7 +2577,7 @@ public virtual async Task> GetReadOnlyK /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -2132,7 +2615,7 @@ public virtual Response GetReadOnlyKeys(Cancella /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -2178,7 +2661,7 @@ public virtual async Task RegenerateKeyAsync(WaitUntil waitUntil, /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -2224,7 +2707,7 @@ public virtual ArmOperation RegenerateKey(WaitUntil waitUntil, CosmosDBAccountRe /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -2257,7 +2740,7 @@ public virtual AsyncPageable GetMetricsAsync(string filter, /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -2290,7 +2773,7 @@ public virtual Pageable GetMetrics(string filter, Cancellati /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -2320,7 +2803,7 @@ public virtual AsyncPageable GetUsagesAsync(string filter = n /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -2350,7 +2833,7 @@ public virtual Pageable GetUsages(string filter = null, Cance /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -2379,7 +2862,7 @@ public virtual AsyncPageable GetMetricDefinitionsAsync /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -2408,7 +2891,7 @@ public virtual Pageable GetMetricDefinitions(Cancellat /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// @@ -2440,7 +2923,7 @@ public virtual AsyncPageable GetMetricsDatabasesAsync(string /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// @@ -2472,7 +2955,7 @@ public virtual Pageable GetMetricsDatabases(string databaseR /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// @@ -2503,7 +2986,7 @@ public virtual AsyncPageable GetUsagesDatabasesAsync(string d /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// @@ -2534,7 +3017,7 @@ public virtual Pageable GetUsagesDatabases(string databaseRid /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// @@ -2564,7 +3047,7 @@ public virtual AsyncPageable GetMetricDefinitionsDatab /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// @@ -2594,7 +3077,7 @@ public virtual Pageable GetMetricDefinitionsDatabases( /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// @@ -2628,7 +3111,7 @@ public virtual AsyncPageable GetMetricsCollectionsAsync(stri /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// @@ -2662,7 +3145,7 @@ public virtual Pageable GetMetricsCollections(string databas /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// @@ -2695,7 +3178,7 @@ public virtual AsyncPageable GetUsagesCollectionsAsync(string /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// @@ -2728,7 +3211,7 @@ public virtual Pageable GetUsagesCollections(string databaseR /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// @@ -2760,7 +3243,7 @@ public virtual AsyncPageable GetMetricDefinitionsColle /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// @@ -2792,7 +3275,7 @@ public virtual Pageable GetMetricDefinitionsCollection /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// @@ -2828,7 +3311,7 @@ public virtual AsyncPageable GetMetricsCollectionRegionsAsyn /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// @@ -2864,7 +3347,7 @@ public virtual Pageable GetMetricsCollectionRegions(string r /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// @@ -2896,7 +3379,7 @@ public virtual AsyncPageable GetMetricsDatabaseAccountRegion /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// @@ -2928,7 +3411,7 @@ public virtual Pageable GetMetricsDatabaseAccountRegions(str /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// @@ -2962,7 +3445,7 @@ public virtual AsyncPageable GetMetricsPercentileSourc /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// @@ -2996,7 +3479,7 @@ public virtual Pageable GetMetricsPercentileSourceTarg /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// @@ -3028,7 +3511,7 @@ public virtual AsyncPageable GetMetricsPercentileTarge /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// @@ -3060,7 +3543,7 @@ public virtual Pageable GetMetricsPercentileTargets(st /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// @@ -3089,7 +3572,7 @@ public virtual AsyncPageable GetMetricsPercentilesAsyn /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// @@ -3118,7 +3601,7 @@ public virtual Pageable GetMetricsPercentiles(string f /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// @@ -3154,7 +3637,7 @@ public virtual AsyncPageable GetMetricsCollectionPartitionRegio /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// @@ -3190,7 +3673,7 @@ public virtual Pageable GetMetricsCollectionPartitionRegions(st /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// @@ -3224,7 +3707,7 @@ public virtual AsyncPageable GetMetricsCollectionPartitionsAsyn /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// @@ -3258,7 +3741,7 @@ public virtual Pageable GetMetricsCollectionPartitions(string d /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// @@ -3291,7 +3774,7 @@ public virtual AsyncPageable GetUsagesCollectionPartitionsAsync( /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// @@ -3324,7 +3807,7 @@ public virtual Pageable GetUsagesCollectionPartitions(string dat /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// @@ -3360,7 +3843,7 @@ public virtual AsyncPageable GetMetricsPartitionKeyRangeIdsAsyn /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// @@ -3396,7 +3879,7 @@ public virtual Pageable GetMetricsPartitionKeyRangeIds(string d /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// @@ -3434,7 +3917,7 @@ public virtual AsyncPageable GetMetricsPartitionKeyRangeIdRegio /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// @@ -3472,7 +3955,7 @@ public virtual Pageable GetMetricsPartitionKeyRangeIdRegions(st /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -3534,7 +4017,7 @@ public virtual async Task> AddTagAsync(string /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -3596,7 +4079,7 @@ public virtual Response AddTag(string key, string value /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -3653,7 +4136,7 @@ public virtual async Task> SetTagsAsync(IDicti /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -3710,7 +4193,7 @@ public virtual Response SetTags(IDictionary /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -3770,7 +4253,7 @@ public virtual async Task> RemoveTagAsync(stri /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBChaosFaultResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBChaosFaultResource.cs index a169f17faca0..6ab9ef6ea8e5 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBChaosFaultResource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBChaosFaultResource.cs @@ -101,7 +101,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -141,7 +141,7 @@ public virtual async Task> GetAsync(Cancell /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -181,7 +181,7 @@ public virtual Response Get(CancellationToken cancel /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -227,7 +227,7 @@ public virtual async Task> UpdateAsync( /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBChaosFaultResourceCollection.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBChaosFaultResourceCollection.cs index ec5dc1bdb601..e1783b4b335f 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBChaosFaultResourceCollection.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBChaosFaultResourceCollection.cs @@ -64,7 +64,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -113,7 +113,7 @@ public virtual async Task> CreateOrUpda /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -162,7 +162,7 @@ public virtual ArmOperation CreateOrUpdate(WaitUntil /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -207,7 +207,7 @@ public virtual async Task> GetAsync(string /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -252,7 +252,7 @@ public virtual Response Get(string chaosFault, Cance /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -282,7 +282,7 @@ public virtual AsyncPageable GetAllAsync(Cancellatio /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -312,7 +312,7 @@ public virtual Pageable GetAll(CancellationToken can /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -355,7 +355,7 @@ public virtual async Task> ExistsAsync(string chaosFault, Cancell /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -398,7 +398,7 @@ public virtual Response Exists(string chaosFault, CancellationToken cancel /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -443,7 +443,7 @@ public virtual async Task> GetIfExi /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBLocationCollection.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBLocationCollection.cs index c5470f6fa38b..078d74220bf4 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBLocationCollection.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBLocationCollection.cs @@ -65,7 +65,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -106,7 +106,7 @@ public virtual async Task> GetAsync(AzureLoca /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -147,7 +147,7 @@ public virtual Response Get(AzureLocation location, Ca /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -176,7 +176,7 @@ public virtual AsyncPageable GetAllAsync(CancellationT /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -205,7 +205,7 @@ public virtual Pageable GetAll(CancellationToken cance /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -244,7 +244,7 @@ public virtual async Task> ExistsAsync(AzureLocation location, Ca /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -283,7 +283,7 @@ public virtual Response Exists(AzureLocation location, CancellationToken c /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -324,7 +324,7 @@ public virtual async Task> GetIfExist /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBLocationResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBLocationResource.cs index 7a739802d1bb..b443b695013f 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBLocationResource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBLocationResource.cs @@ -107,7 +107,7 @@ public virtual RestorableCosmosDBAccountCollection GetRestorableCosmosDBAccounts /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -136,7 +136,7 @@ public virtual async Task> GetRestor /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -165,7 +165,7 @@ public virtual Response GetRestorableCosmosDB /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -205,7 +205,7 @@ public virtual async Task> GetAsync(Cancellat /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBPrivateEndpointConnectionCollection.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBPrivateEndpointConnectionCollection.cs index 0d597a913830..0f03527ad132 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBPrivateEndpointConnectionCollection.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBPrivateEndpointConnectionCollection.cs @@ -64,7 +64,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -113,7 +113,7 @@ public virtual async Task /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -162,7 +162,7 @@ public virtual ArmOperation CreateOrU /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -207,7 +207,7 @@ public virtual async Task> G /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -252,7 +252,7 @@ public virtual Response Get(string pr /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -281,7 +281,7 @@ public virtual AsyncPageable GetAllAs /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -310,7 +310,7 @@ public virtual Pageable GetAll(Cancel /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -353,7 +353,7 @@ public virtual async Task> ExistsAsync(string privateEndpointConn /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -396,7 +396,7 @@ public virtual Response Exists(string privateEndpointConnectionName, Cance /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -441,7 +441,7 @@ public virtual async Task /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBPrivateEndpointConnectionResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBPrivateEndpointConnectionResource.cs index d85590992d29..6f3226c3ec6e 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBPrivateEndpointConnectionResource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBPrivateEndpointConnectionResource.cs @@ -101,7 +101,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -141,7 +141,7 @@ public virtual async Task> G /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -181,7 +181,7 @@ public virtual Response Get(Cancellat /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -223,7 +223,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -265,7 +265,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -311,7 +311,7 @@ public virtual async Task /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBPrivateLinkResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBPrivateLinkResource.cs index 87134520dfee..a21a04c0c559 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBPrivateLinkResource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBPrivateLinkResource.cs @@ -101,7 +101,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -141,7 +141,7 @@ public virtual async Task> GetAsync(Cancel /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBPrivateLinkResourceCollection.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBPrivateLinkResourceCollection.cs index 24f2f2f31e77..ca9a530ae991 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBPrivateLinkResourceCollection.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBPrivateLinkResourceCollection.cs @@ -64,7 +64,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -109,7 +109,7 @@ public virtual async Task> GetAsync(string /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -154,7 +154,7 @@ public virtual Response Get(string groupName, Cance /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -183,7 +183,7 @@ public virtual AsyncPageable GetAllAsync(Cancellati /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -212,7 +212,7 @@ public virtual Pageable GetAll(CancellationToken ca /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -255,7 +255,7 @@ public virtual async Task> ExistsAsync(string groupName, Cancella /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -298,7 +298,7 @@ public virtual Response Exists(string groupName, CancellationToken cancell /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -343,7 +343,7 @@ public virtual async Task> GetIfEx /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBServiceCollection.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBServiceCollection.cs index 220cef718c42..d0fe3e699819 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBServiceCollection.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBServiceCollection.cs @@ -65,7 +65,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -114,7 +114,7 @@ public virtual async Task> CreateOrUpdateA /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -163,7 +163,7 @@ public virtual ArmOperation CreateOrUpdate(WaitUntil wa /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -208,7 +208,7 @@ public virtual async Task> GetAsync(string ser /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -253,7 +253,7 @@ public virtual Response Get(string serviceName, Cancell /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -282,7 +282,7 @@ public virtual AsyncPageable GetAllAsync(CancellationTo /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -311,7 +311,7 @@ public virtual Pageable GetAll(CancellationToken cancel /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -354,7 +354,7 @@ public virtual async Task> ExistsAsync(string serviceName, Cancel /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -397,7 +397,7 @@ public virtual Response Exists(string serviceName, CancellationToken cance /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -442,7 +442,7 @@ public virtual async Task> GetIfExists /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBServiceResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBServiceResource.cs index 998e15d2d9eb..0bf88a2bd5c5 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBServiceResource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBServiceResource.cs @@ -102,7 +102,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -142,7 +142,7 @@ public virtual async Task> GetAsync(Cancellati /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -182,7 +182,7 @@ public virtual Response Get(CancellationToken cancellat /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -224,7 +224,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -266,7 +266,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -312,7 +312,7 @@ public virtual async Task> UpdateAsync(Wai /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlClientEncryptionKeyCollection.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlClientEncryptionKeyCollection.cs index 47203e58cf51..32d832520c80 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlClientEncryptionKeyCollection.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlClientEncryptionKeyCollection.cs @@ -65,7 +65,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -114,7 +114,7 @@ public virtual async Task> /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -163,7 +163,7 @@ public virtual ArmOperation CreateOrUpda /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -208,7 +208,7 @@ public virtual async Task> GetA /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -253,7 +253,7 @@ public virtual Response Get(string clien /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -282,7 +282,7 @@ public virtual AsyncPageable GetAllAsync /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -311,7 +311,7 @@ public virtual Pageable GetAll(Cancellat /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -354,7 +354,7 @@ public virtual async Task> ExistsAsync(string clientEncryptionKey /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -397,7 +397,7 @@ public virtual Response Exists(string clientEncryptionKeyName, Cancellatio /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -442,7 +442,7 @@ public virtual async Task /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlClientEncryptionKeyResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlClientEncryptionKeyResource.cs index 14bd6b328520..5893b2edcccf 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlClientEncryptionKeyResource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlClientEncryptionKeyResource.cs @@ -103,7 +103,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -143,7 +143,7 @@ public virtual async Task> GetA /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -183,7 +183,7 @@ public virtual Response Get(Cancellation /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -229,7 +229,7 @@ public virtual async Task> /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlContainerCollection.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlContainerCollection.cs index 8fc95a0360d9..f98a781ed0b7 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlContainerCollection.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlContainerCollection.cs @@ -65,7 +65,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -114,7 +114,7 @@ public virtual async Task> CreateOrUp /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -163,7 +163,7 @@ public virtual ArmOperation CreateOrUpdate(WaitUnt /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -208,7 +208,7 @@ public virtual async Task> GetAsync(strin /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -253,7 +253,7 @@ public virtual Response Get(string containerName, /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -282,7 +282,7 @@ public virtual AsyncPageable GetAllAsync(Cancellat /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -311,7 +311,7 @@ public virtual Pageable GetAll(CancellationToken c /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -354,7 +354,7 @@ public virtual async Task> ExistsAsync(string containerName, Canc /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -397,7 +397,7 @@ public virtual Response Exists(string containerName, CancellationToken can /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -442,7 +442,7 @@ public virtual async Task> GetIfE /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlContainerResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlContainerResource.cs index 7440bad38844..3b0c8a0bbd67 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlContainerResource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlContainerResource.cs @@ -118,7 +118,7 @@ public virtual CosmosDBSqlStoredProcedureCollection GetCosmosDBSqlStoredProcedur /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -149,7 +149,7 @@ public virtual async Task> GetCosmo /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -187,7 +187,7 @@ public virtual CosmosDBSqlUserDefinedFunctionCollection GetCosmosDBSqlUserDefine /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -218,7 +218,7 @@ public virtual async Task> GetC /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -256,7 +256,7 @@ public virtual CosmosDBSqlTriggerCollection GetCosmosDBSqlTriggers() /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -287,7 +287,7 @@ public virtual async Task> GetCosmosDBSqlTr /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -318,7 +318,7 @@ public virtual Response GetCosmosDBSqlTrigger(string /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -358,7 +358,7 @@ public virtual async Task> GetAsync(Cance /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -398,7 +398,7 @@ public virtual Response Get(CancellationToken canc /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -440,7 +440,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -482,7 +482,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -528,7 +528,7 @@ public virtual async Task> UpdateAsyn /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -574,7 +574,7 @@ public virtual ArmOperation Update(WaitUntil waitU /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -620,7 +620,7 @@ public virtual async Task> /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -666,7 +666,7 @@ public virtual ArmOperation GetSqlContai /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -712,7 +712,7 @@ public virtual async Task> RetrieveConti /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -758,7 +758,7 @@ public virtual ArmOperation RetrieveContinuousBackupI /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -820,7 +820,7 @@ public virtual async Task> AddTagAsync(st /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -882,7 +882,7 @@ public virtual Response AddTag(string key, string /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -939,7 +939,7 @@ public virtual async Task> SetTagsAsync(I /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -996,7 +996,7 @@ public virtual Response SetTags(IDictionary /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -1056,7 +1056,7 @@ public virtual async Task> RemoveTagAsync /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlContainerThroughputSettingResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlContainerThroughputSettingResource.cs index 1d2ea77ab6ed..de805719a611 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlContainerThroughputSettingResource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlContainerThroughputSettingResource.cs @@ -104,7 +104,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -144,7 +144,7 @@ public virtual async Task /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -184,7 +184,7 @@ public virtual Response Get(Cance /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -230,7 +230,7 @@ public virtual async Task /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -276,7 +276,7 @@ public virtual ArmOperation Creat /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -318,7 +318,7 @@ public virtual async Task /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -360,7 +360,7 @@ public virtual ArmOperation Migra /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -402,7 +402,7 @@ public virtual async Task /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -444,7 +444,7 @@ public virtual ArmOperation Migra /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -490,7 +490,7 @@ public virtual async Task> S /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -536,7 +536,7 @@ public virtual ArmOperation SqlContainerR /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -582,7 +582,7 @@ public virtual async Task> S /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -628,7 +628,7 @@ public virtual ArmOperation SqlContainerR /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -690,7 +690,7 @@ public virtual async Task /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -752,7 +752,7 @@ public virtual Response AddTag(st /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -809,7 +809,7 @@ public virtual async Task /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -866,7 +866,7 @@ public virtual Response SetTags(I /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -926,7 +926,7 @@ public virtual async Task /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlDatabaseCollection.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlDatabaseCollection.cs index fcb3d2b5f4e3..1e400db8f959 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlDatabaseCollection.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlDatabaseCollection.cs @@ -65,7 +65,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -114,7 +114,7 @@ public virtual async Task> CreateOrUpd /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -163,7 +163,7 @@ public virtual ArmOperation CreateOrUpdate(WaitUnti /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -208,7 +208,7 @@ public virtual async Task> GetAsync(string /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -253,7 +253,7 @@ public virtual Response Get(string databaseName, Ca /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -282,7 +282,7 @@ public virtual AsyncPageable GetAllAsync(Cancellati /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -311,7 +311,7 @@ public virtual Pageable GetAll(CancellationToken ca /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -354,7 +354,7 @@ public virtual async Task> ExistsAsync(string databaseName, Cance /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -397,7 +397,7 @@ public virtual Response Exists(string databaseName, CancellationToken canc /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -442,7 +442,7 @@ public virtual async Task> GetIfEx /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlDatabaseResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlDatabaseResource.cs index 5a6467888e47..11ca687f9605 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlDatabaseResource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlDatabaseResource.cs @@ -117,7 +117,7 @@ public virtual CosmosDBSqlClientEncryptionKeyCollection GetCosmosDBSqlClientEncr /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -148,7 +148,7 @@ public virtual async Task> GetC /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -186,7 +186,7 @@ public virtual CosmosDBSqlContainerCollection GetCosmosDBSqlContainers() /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -217,7 +217,7 @@ public virtual async Task> GetCosmosDBSql /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -248,7 +248,7 @@ public virtual Response GetCosmosDBSqlContainer(st /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -288,7 +288,7 @@ public virtual async Task> GetAsync(Cancel /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -328,7 +328,7 @@ public virtual Response Get(CancellationToken cance /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -370,7 +370,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -412,7 +412,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -458,7 +458,7 @@ public virtual async Task> UpdateAsync /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -504,7 +504,7 @@ public virtual ArmOperation Update(WaitUntil waitUn /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -550,7 +550,7 @@ public virtual async Task> /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -596,7 +596,7 @@ public virtual ArmOperation SqlDatabaseP /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -658,7 +658,7 @@ public virtual async Task> AddTagAsync(str /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -720,7 +720,7 @@ public virtual Response AddTag(string key, string v /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -777,7 +777,7 @@ public virtual async Task> SetTagsAsync(ID /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -834,7 +834,7 @@ public virtual Response SetTags(IDictionary /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -894,7 +894,7 @@ public virtual async Task> RemoveTagAsync( /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlDatabaseThroughputSettingResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlDatabaseThroughputSettingResource.cs index 2d6d4022fe4d..694d77575974 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlDatabaseThroughputSettingResource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlDatabaseThroughputSettingResource.cs @@ -103,7 +103,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -143,7 +143,7 @@ public virtual async Task /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -183,7 +183,7 @@ public virtual Response Get(Cancel /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -229,7 +229,7 @@ public virtual async Task /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -275,7 +275,7 @@ public virtual ArmOperation Create /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -317,7 +317,7 @@ public virtual async Task /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -359,7 +359,7 @@ public virtual ArmOperation Migrat /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -401,7 +401,7 @@ public virtual async Task /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -443,7 +443,7 @@ public virtual ArmOperation Migrat /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -489,7 +489,7 @@ public virtual async Task> S /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -535,7 +535,7 @@ public virtual ArmOperation SqlDatabaseRe /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -581,7 +581,7 @@ public virtual async Task> S /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -627,7 +627,7 @@ public virtual ArmOperation SqlDatabaseRe /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -689,7 +689,7 @@ public virtual async Task /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -751,7 +751,7 @@ public virtual Response AddTag(str /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -808,7 +808,7 @@ public virtual async Task /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -865,7 +865,7 @@ public virtual Response SetTags(ID /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -925,7 +925,7 @@ public virtual async Task /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlRoleAssignmentCollection.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlRoleAssignmentCollection.cs index 5f0e557b23c4..c76d6f066ff2 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlRoleAssignmentCollection.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlRoleAssignmentCollection.cs @@ -65,7 +65,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -114,7 +114,7 @@ public virtual async Task> Creat /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -163,7 +163,7 @@ public virtual ArmOperation CreateOrUpdate(Wa /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -208,7 +208,7 @@ public virtual async Task> GetAsync( /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -253,7 +253,7 @@ public virtual Response Get(string roleAssign /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -282,7 +282,7 @@ public virtual AsyncPageable GetAllAsync(Canc /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -311,7 +311,7 @@ public virtual Pageable GetAll(CancellationTo /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -354,7 +354,7 @@ public virtual async Task> ExistsAsync(string roleAssignmentId, C /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -397,7 +397,7 @@ public virtual Response Exists(string roleAssignmentId, CancellationToken /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -442,7 +442,7 @@ public virtual async Task> G /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlRoleAssignmentResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlRoleAssignmentResource.cs index faad885d0a57..cd53dc5c4853 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlRoleAssignmentResource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlRoleAssignmentResource.cs @@ -102,7 +102,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -142,7 +142,7 @@ public virtual async Task> GetAsync( /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -182,7 +182,7 @@ public virtual Response Get(CancellationToken /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -224,7 +224,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -266,7 +266,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -312,7 +312,7 @@ public virtual async Task> Updat /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlRoleDefinitionCollection.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlRoleDefinitionCollection.cs index c11de872ca63..a71177ec2776 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlRoleDefinitionCollection.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlRoleDefinitionCollection.cs @@ -65,7 +65,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -114,7 +114,7 @@ public virtual async Task> Creat /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -163,7 +163,7 @@ public virtual ArmOperation CreateOrUpdate(Wa /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -208,7 +208,7 @@ public virtual async Task> GetAsync( /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -253,7 +253,7 @@ public virtual Response Get(string roleDefini /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -282,7 +282,7 @@ public virtual AsyncPageable GetAllAsync(Canc /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -311,7 +311,7 @@ public virtual Pageable GetAll(CancellationTo /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -354,7 +354,7 @@ public virtual async Task> ExistsAsync(string roleDefinitionId, C /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -397,7 +397,7 @@ public virtual Response Exists(string roleDefinitionId, CancellationToken /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -442,7 +442,7 @@ public virtual async Task> G /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlRoleDefinitionResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlRoleDefinitionResource.cs index b8af8f9ff8f4..d50eda32a544 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlRoleDefinitionResource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlRoleDefinitionResource.cs @@ -102,7 +102,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -142,7 +142,7 @@ public virtual async Task> GetAsync( /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -182,7 +182,7 @@ public virtual Response Get(CancellationToken /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -224,7 +224,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -266,7 +266,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -312,7 +312,7 @@ public virtual async Task> Updat /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlStoredProcedureCollection.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlStoredProcedureCollection.cs index 23d785d37b27..7f315ae107ba 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlStoredProcedureCollection.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlStoredProcedureCollection.cs @@ -65,7 +65,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -114,7 +114,7 @@ public virtual async Task> Crea /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -163,7 +163,7 @@ public virtual ArmOperation CreateOrUpdate(W /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -208,7 +208,7 @@ public virtual async Task> GetAsync /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -253,7 +253,7 @@ public virtual Response Get(string storedPro /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -282,7 +282,7 @@ public virtual AsyncPageable GetAllAsync(Can /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -311,7 +311,7 @@ public virtual Pageable GetAll(CancellationT /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -354,7 +354,7 @@ public virtual async Task> ExistsAsync(string storedProcedureName /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -397,7 +397,7 @@ public virtual Response Exists(string storedProcedureName, CancellationTok /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -442,7 +442,7 @@ public virtual async Task> /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlStoredProcedureResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlStoredProcedureResource.cs index 83b15644508d..d9e9b9bcd484 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlStoredProcedureResource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlStoredProcedureResource.cs @@ -105,7 +105,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -145,7 +145,7 @@ public virtual async Task> GetAsync /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -185,7 +185,7 @@ public virtual Response Get(CancellationToke /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -227,7 +227,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -269,7 +269,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -315,7 +315,7 @@ public virtual async Task> Upda /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -361,7 +361,7 @@ public virtual ArmOperation Update(WaitUntil /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -423,7 +423,7 @@ public virtual async Task> AddTagAs /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -485,7 +485,7 @@ public virtual Response AddTag(string key, s /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -542,7 +542,7 @@ public virtual async Task> SetTagsA /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -599,7 +599,7 @@ public virtual Response SetTags(IDictionary< /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -659,7 +659,7 @@ public virtual async Task> RemoveTa /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlTriggerCollection.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlTriggerCollection.cs index a9ffe73aa77a..885c075caedb 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlTriggerCollection.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlTriggerCollection.cs @@ -65,7 +65,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -114,7 +114,7 @@ public virtual async Task> CreateOrUpda /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -163,7 +163,7 @@ public virtual ArmOperation CreateOrUpdate(WaitUntil /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -208,7 +208,7 @@ public virtual async Task> GetAsync(string /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -253,7 +253,7 @@ public virtual Response Get(string triggerName, Canc /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -282,7 +282,7 @@ public virtual AsyncPageable GetAllAsync(Cancellatio /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -311,7 +311,7 @@ public virtual Pageable GetAll(CancellationToken can /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -354,7 +354,7 @@ public virtual async Task> ExistsAsync(string triggerName, Cancel /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -397,7 +397,7 @@ public virtual Response Exists(string triggerName, CancellationToken cance /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -442,7 +442,7 @@ public virtual async Task> GetIfExi /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlTriggerResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlTriggerResource.cs index 680f8c9bfd7d..0eef7d081859 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlTriggerResource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlTriggerResource.cs @@ -105,7 +105,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -145,7 +145,7 @@ public virtual async Task> GetAsync(Cancell /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -185,7 +185,7 @@ public virtual Response Get(CancellationToken cancel /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -227,7 +227,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -269,7 +269,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -315,7 +315,7 @@ public virtual async Task> UpdateAsync( /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -361,7 +361,7 @@ public virtual ArmOperation Update(WaitUntil waitUnt /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -423,7 +423,7 @@ public virtual async Task> AddTagAsync(stri /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -485,7 +485,7 @@ public virtual Response AddTag(string key, string va /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -542,7 +542,7 @@ public virtual async Task> SetTagsAsync(IDi /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -599,7 +599,7 @@ public virtual Response SetTags(IDictionary /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -659,7 +659,7 @@ public virtual async Task> RemoveTagAsync(s /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlUserDefinedFunctionCollection.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlUserDefinedFunctionCollection.cs index 44fd5a8e5e01..865f98efc824 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlUserDefinedFunctionCollection.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlUserDefinedFunctionCollection.cs @@ -65,7 +65,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -114,7 +114,7 @@ public virtual async Task> /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -163,7 +163,7 @@ public virtual ArmOperation CreateOrUpda /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -208,7 +208,7 @@ public virtual async Task> GetA /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -253,7 +253,7 @@ public virtual Response Get(string userD /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -282,7 +282,7 @@ public virtual AsyncPageable GetAllAsync /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -311,7 +311,7 @@ public virtual Pageable GetAll(Cancellat /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -354,7 +354,7 @@ public virtual async Task> ExistsAsync(string userDefinedFunction /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -397,7 +397,7 @@ public virtual Response Exists(string userDefinedFunctionName, Cancellatio /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -442,7 +442,7 @@ public virtual async Task /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlUserDefinedFunctionResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlUserDefinedFunctionResource.cs index 28453c58f7ba..aa654d49e0bc 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlUserDefinedFunctionResource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlUserDefinedFunctionResource.cs @@ -105,7 +105,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -145,7 +145,7 @@ public virtual async Task> GetA /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -185,7 +185,7 @@ public virtual Response Get(Cancellation /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -227,7 +227,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -269,7 +269,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -315,7 +315,7 @@ public virtual async Task> /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -361,7 +361,7 @@ public virtual ArmOperation Update(WaitU /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -423,7 +423,7 @@ public virtual async Task> AddT /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -485,7 +485,7 @@ public virtual Response AddTag(string ke /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -542,7 +542,7 @@ public virtual async Task> SetT /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -599,7 +599,7 @@ public virtual Response SetTags(IDiction /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -659,7 +659,7 @@ public virtual async Task> Remo /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBTableCollection.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBTableCollection.cs index d7da39faacfd..5fcec86489d0 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBTableCollection.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBTableCollection.cs @@ -65,7 +65,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -114,7 +114,7 @@ public virtual async Task> CreateOrUpdateAsy /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -163,7 +163,7 @@ public virtual ArmOperation CreateOrUpdate(WaitUntil wait /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -208,7 +208,7 @@ public virtual async Task> GetAsync(string table /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -253,7 +253,7 @@ public virtual Response Get(string tableName, Cancellatio /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -282,7 +282,7 @@ public virtual AsyncPageable GetAllAsync(CancellationToke /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -311,7 +311,7 @@ public virtual Pageable GetAll(CancellationToken cancella /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -354,7 +354,7 @@ public virtual async Task> ExistsAsync(string tableName, Cancella /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -397,7 +397,7 @@ public virtual Response Exists(string tableName, CancellationToken cancell /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -442,7 +442,7 @@ public virtual async Task> GetIfExistsAs /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBTableResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBTableResource.cs index 4cc46fc01292..940ac2d182e4 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBTableResource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBTableResource.cs @@ -110,7 +110,7 @@ public virtual CosmosTableThroughputSettingResource GetCosmosTableThroughputSett /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -150,7 +150,7 @@ public virtual async Task> GetAsync(Cancellation /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -190,7 +190,7 @@ public virtual Response Get(CancellationToken cancellatio /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -232,7 +232,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -274,7 +274,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -320,7 +320,7 @@ public virtual async Task> UpdateAsync(WaitU /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -366,7 +366,7 @@ public virtual ArmOperation Update(WaitUntil waitUntil, C /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -412,7 +412,7 @@ public virtual async Task> RetrieveConti /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -458,7 +458,7 @@ public virtual ArmOperation RetrieveContinuousBackupI /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -520,7 +520,7 @@ public virtual async Task> AddTagAsync(string ke /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -582,7 +582,7 @@ public virtual Response AddTag(string key, string value, /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -639,7 +639,7 @@ public virtual async Task> SetTagsAsync(IDiction /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -696,7 +696,7 @@ public virtual Response SetTags(IDictionary /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -756,7 +756,7 @@ public virtual async Task> RemoveTagAsync(string /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBTableRoleAssignmentCollection.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBTableRoleAssignmentCollection.cs index 77cb74248b2d..3f04845b8d5e 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBTableRoleAssignmentCollection.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBTableRoleAssignmentCollection.cs @@ -64,7 +64,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -113,7 +113,7 @@ public virtual async Task> Cre /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -162,7 +162,7 @@ public virtual ArmOperation CreateOrUpdate( /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -207,7 +207,7 @@ public virtual async Task> GetAsyn /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -252,7 +252,7 @@ public virtual Response Get(string roleAssi /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -281,7 +281,7 @@ public virtual AsyncPageable GetAllAsync(Ca /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -310,7 +310,7 @@ public virtual Pageable GetAll(Cancellation /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -353,7 +353,7 @@ public virtual async Task> ExistsAsync(string roleAssignmentId, C /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -396,7 +396,7 @@ public virtual Response Exists(string roleAssignmentId, CancellationToken /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -441,7 +441,7 @@ public virtual async Task> /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBTableRoleAssignmentResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBTableRoleAssignmentResource.cs index 94984c40b218..511062cff638 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBTableRoleAssignmentResource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBTableRoleAssignmentResource.cs @@ -101,7 +101,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -141,7 +141,7 @@ public virtual async Task> GetAsyn /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -181,7 +181,7 @@ public virtual Response Get(CancellationTok /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -223,7 +223,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -265,7 +265,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -311,7 +311,7 @@ public virtual async Task> Upd /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBTableRoleDefinitionCollection.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBTableRoleDefinitionCollection.cs index 2117a5172fde..d277a1f4397a 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBTableRoleDefinitionCollection.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBTableRoleDefinitionCollection.cs @@ -64,7 +64,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -113,7 +113,7 @@ public virtual async Task> Cre /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -162,7 +162,7 @@ public virtual ArmOperation CreateOrUpdate( /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -207,7 +207,7 @@ public virtual async Task> GetAsyn /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -252,7 +252,7 @@ public virtual Response Get(string roleDefi /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -281,7 +281,7 @@ public virtual AsyncPageable GetAllAsync(Ca /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -310,7 +310,7 @@ public virtual Pageable GetAll(Cancellation /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -353,7 +353,7 @@ public virtual async Task> ExistsAsync(string roleDefinitionId, C /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -396,7 +396,7 @@ public virtual Response Exists(string roleDefinitionId, CancellationToken /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -441,7 +441,7 @@ public virtual async Task> /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBTableRoleDefinitionResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBTableRoleDefinitionResource.cs index 51ed93561a6b..632ce74adc35 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBTableRoleDefinitionResource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBTableRoleDefinitionResource.cs @@ -101,7 +101,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -141,7 +141,7 @@ public virtual async Task> GetAsyn /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -181,7 +181,7 @@ public virtual Response Get(CancellationTok /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -223,7 +223,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -265,7 +265,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -311,7 +311,7 @@ public virtual async Task> Upd /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBThroughputPoolAccountCollection.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBThroughputPoolAccountCollection.cs index 36540aa2faac..849e2b5e5946 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBThroughputPoolAccountCollection.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBThroughputPoolAccountCollection.cs @@ -69,7 +69,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -118,7 +118,7 @@ public virtual async Task> C /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -167,7 +167,7 @@ public virtual ArmOperation CreateOrUpdat /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -212,7 +212,7 @@ public virtual async Task> GetAs /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -257,7 +257,7 @@ public virtual Response Get(string throug /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -287,7 +287,7 @@ public virtual AsyncPageable GetAllAsync( /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -317,7 +317,7 @@ public virtual Pageable GetAll(Cancellati /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -360,7 +360,7 @@ public virtual async Task> ExistsAsync(string throughputPoolAccou /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -403,7 +403,7 @@ public virtual Response Exists(string throughputPoolAccountName, Cancellat /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -448,7 +448,7 @@ public virtual async Task /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBThroughputPoolAccountResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBThroughputPoolAccountResource.cs index b6c998474128..09c523729179 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBThroughputPoolAccountResource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBThroughputPoolAccountResource.cs @@ -101,7 +101,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -141,7 +141,7 @@ public virtual async Task> GetAs /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -181,7 +181,7 @@ public virtual Response Get(CancellationT /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -223,7 +223,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -265,7 +265,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -311,7 +311,7 @@ public virtual async Task> U /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBThroughputPoolCollection.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBThroughputPoolCollection.cs index fff972d5cf3c..c6fa9989c7e9 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBThroughputPoolCollection.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBThroughputPoolCollection.cs @@ -70,7 +70,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -119,7 +119,7 @@ public virtual async Task> CreateOr /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -168,7 +168,7 @@ public virtual ArmOperation CreateOrUpdate(WaitU /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -213,7 +213,7 @@ public virtual async Task> GetAsync(str /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -258,7 +258,7 @@ public virtual Response Get(string throughputPoo /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -288,7 +288,7 @@ public virtual AsyncPageable GetAllAsync(Cancell /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -318,7 +318,7 @@ public virtual Pageable GetAll(CancellationToken /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -361,7 +361,7 @@ public virtual async Task> ExistsAsync(string throughputPoolName, /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -404,7 +404,7 @@ public virtual Response Exists(string throughputPoolName, CancellationToke /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -449,7 +449,7 @@ public virtual async Task> GetI /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBThroughputPoolResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBThroughputPoolResource.cs index 45bdcb8be9a8..168b096b0077 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBThroughputPoolResource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBThroughputPoolResource.cs @@ -109,7 +109,7 @@ public virtual CosmosDBThroughputPoolAccountCollection GetCosmosDBThroughputPool /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -140,7 +140,7 @@ public virtual async Task> GetCo /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -171,7 +171,7 @@ public virtual Response GetCosmosDBThroug /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -211,7 +211,7 @@ public virtual async Task> GetAsync(Can /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -251,7 +251,7 @@ public virtual Response Get(CancellationToken ca /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -293,7 +293,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -335,7 +335,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -381,7 +381,7 @@ public virtual async Task> UpdateAs /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosTableThroughputSettingResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosTableThroughputSettingResource.cs index 5a79c2ced285..cbde6348549b 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosTableThroughputSettingResource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosTableThroughputSettingResource.cs @@ -103,7 +103,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -143,7 +143,7 @@ public virtual async Task> GetAsy /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -183,7 +183,7 @@ public virtual Response Get(CancellationTo /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -229,7 +229,7 @@ public virtual async Task> Cr /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -275,7 +275,7 @@ public virtual ArmOperation CreateOrUpdate /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -317,7 +317,7 @@ public virtual async Task> Mi /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -359,7 +359,7 @@ public virtual ArmOperation MigrateTableTo /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -401,7 +401,7 @@ public virtual async Task> Mi /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -443,7 +443,7 @@ public virtual ArmOperation MigrateTableTo /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -505,7 +505,7 @@ public virtual async Task> AddTag /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -567,7 +567,7 @@ public virtual Response AddTag(string key, /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -624,7 +624,7 @@ public virtual async Task> SetTag /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -681,7 +681,7 @@ public virtual Response SetTags(IDictionar /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -741,7 +741,7 @@ public virtual async Task> Remove /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/DataTransferJobGetResultCollection.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/DataTransferJobGetResultCollection.cs index 41a781805471..9dc49b656d0c 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/DataTransferJobGetResultCollection.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/DataTransferJobGetResultCollection.cs @@ -65,7 +65,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -116,7 +116,7 @@ public virtual async Task> Create /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -167,7 +167,7 @@ public virtual ArmOperation CreateOrUpdate(Wai /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -212,7 +212,7 @@ public virtual async Task> GetAsync(s /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -257,7 +257,7 @@ public virtual Response Get(string jobName, Ca /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -287,7 +287,7 @@ public virtual AsyncPageable GetAllAsync(Cance /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -317,7 +317,7 @@ public virtual Pageable GetAll(CancellationTok /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -360,7 +360,7 @@ public virtual async Task> ExistsAsync(string jobName, Cancellati /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -403,7 +403,7 @@ public virtual Response Exists(string jobName, CancellationToken cancellat /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -448,7 +448,7 @@ public virtual async Task> Ge /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/DataTransferJobGetResultResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/DataTransferJobGetResultResource.cs index 4389dd31711d..93c3e6b27198 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/DataTransferJobGetResultResource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/DataTransferJobGetResultResource.cs @@ -102,7 +102,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -142,7 +142,7 @@ public virtual async Task> GetAsync(C /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -182,7 +182,7 @@ public virtual Response Get(CancellationToken /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -230,7 +230,7 @@ public virtual async Task> Update /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -278,7 +278,7 @@ public virtual ArmOperation Update(WaitUntil w /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -316,7 +316,7 @@ public virtual async Task> PauseAsync /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -354,7 +354,7 @@ public virtual Response Pause(CancellationToke /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -392,7 +392,7 @@ public virtual async Task> ResumeAsyn /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -430,7 +430,7 @@ public virtual Response Resume(CancellationTok /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -468,7 +468,7 @@ public virtual async Task> CancelAsyn /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -506,7 +506,7 @@ public virtual Response Cancel(CancellationTok /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -544,7 +544,7 @@ public virtual async Task> CompleteAs /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Extensions/CosmosDBExtensions.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Extensions/CosmosDBExtensions.cs index 14a704c1f2bd..78853505aaa3 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Extensions/CosmosDBExtensions.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Extensions/CosmosDBExtensions.cs @@ -56,6 +56,25 @@ public static CosmosDBChaosFaultResource GetCosmosDBChaosFaultResource(this ArmC return GetMockableCosmosDBArmClient(client).GetCosmosDBChaosFaultResource(id); } + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The resource ID of the resource to get. + /// is null. + /// Returns a object. + public static CopyJobGetResultResource GetCopyJobGetResultResource(this ArmClient client, ResourceIdentifier id) + { + Argument.AssertNotNull(client, nameof(client)); + + return GetMockableCosmosDBArmClient(client).GetCopyJobGetResultResource(id); + } + /// /// Gets an object representing a along with the instance operations that can be performed on it but with no data. /// You can use to create a from its components. @@ -626,6 +645,44 @@ public static CassandraViewGetResultResource GetCassandraViewGetResultResource(t return GetMockableCosmosDBArmClient(client).GetCassandraViewGetResultResource(id); } + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The resource ID of the resource to get. + /// is null. + /// Returns a object. + public static CassandraRoleDefinitionResource GetCassandraRoleDefinitionResource(this ArmClient client, ResourceIdentifier id) + { + Argument.AssertNotNull(client, nameof(client)); + + return GetMockableCosmosDBArmClient(client).GetCassandraRoleDefinitionResource(id); + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The resource ID of the resource to get. + /// is null. + /// Returns a object. + public static CassandraRoleAssignmentResource GetCassandraRoleAssignmentResource(this ArmClient client, ResourceIdentifier id) + { + Argument.AssertNotNull(client, nameof(client)); + + return GetMockableCosmosDBArmClient(client).GetCassandraRoleAssignmentResource(id); + } + /// /// Gets an object representing a along with the instance operations that can be performed on it but with no data. /// You can use to create a from its components. @@ -664,6 +721,44 @@ public static GremlinGraphResource GetGremlinGraphResource(this ArmClient client return GetMockableCosmosDBArmClient(client).GetGremlinGraphResource(id); } + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The resource ID of the resource to get. + /// is null. + /// Returns a object. + public static GremlinRoleDefinitionResource GetGremlinRoleDefinitionResource(this ArmClient client, ResourceIdentifier id) + { + Argument.AssertNotNull(client, nameof(client)); + + return GetMockableCosmosDBArmClient(client).GetGremlinRoleDefinitionResource(id); + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The resource ID of the resource to get. + /// is null. + /// Returns a object. + public static GremlinRoleAssignmentResource GetGremlinRoleAssignmentResource(this ArmClient client, ResourceIdentifier id) + { + Argument.AssertNotNull(client, nameof(client)); + + return GetMockableCosmosDBArmClient(client).GetGremlinRoleAssignmentResource(id); + } + /// /// Gets an object representing a along with the instance operations that can be performed on it but with no data. /// You can use to create a from its components. @@ -873,6 +968,120 @@ public static CosmosDBThroughputPoolAccountResource GetCosmosDBThroughputPoolAcc return GetMockableCosmosDBArmClient(client).GetCosmosDBThroughputPoolAccountResource(id); } + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The resource ID of the resource to get. + /// is null. + /// Returns a object. + public static MongoMIRoleDefinitionResource GetMongoMIRoleDefinitionResource(this ArmClient client, ResourceIdentifier id) + { + Argument.AssertNotNull(client, nameof(client)); + + return GetMockableCosmosDBArmClient(client).GetMongoMIRoleDefinitionResource(id); + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The resource ID of the resource to get. + /// is null. + /// Returns a object. + public static MongoMIRoleAssignmentResource GetMongoMIRoleAssignmentResource(this ArmClient client, ResourceIdentifier id) + { + Argument.AssertNotNull(client, nameof(client)); + + return GetMockableCosmosDBArmClient(client).GetMongoMIRoleAssignmentResource(id); + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The resource ID of the resource to get. + /// is null. + /// Returns a object. + public static FleetResource GetFleetResource(this ArmClient client, ResourceIdentifier id) + { + Argument.AssertNotNull(client, nameof(client)); + + return GetMockableCosmosDBArmClient(client).GetFleetResource(id); + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The resource ID of the resource to get. + /// is null. + /// Returns a object. + public static FleetAnalyticsResource GetFleetAnalyticsResource(this ArmClient client, ResourceIdentifier id) + { + Argument.AssertNotNull(client, nameof(client)); + + return GetMockableCosmosDBArmClient(client).GetFleetAnalyticsResource(id); + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The resource ID of the resource to get. + /// is null. + /// Returns a object. + public static FleetspaceResource GetFleetspaceResource(this ArmClient client, ResourceIdentifier id) + { + Argument.AssertNotNull(client, nameof(client)); + + return GetMockableCosmosDBArmClient(client).GetFleetspaceResource(id); + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The resource ID of the resource to get. + /// is null. + /// Returns a object. + public static FleetspaceAccountResource GetFleetspaceAccountResource(this ArmClient client, ResourceIdentifier id) + { + Argument.AssertNotNull(client, nameof(client)); + + return GetMockableCosmosDBArmClient(client).GetFleetspaceAccountResource(id); + } + /// /// Gets a collection of CosmosDBAccountResources in the ResourceGroupResource. /// @@ -903,7 +1112,7 @@ public static CosmosDBAccountCollection GetCosmosDBAccounts(this ResourceGroupRe /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -941,7 +1150,7 @@ public static async Task> GetCosmosDBAccountAs /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -996,7 +1205,7 @@ public static CassandraClusterCollection GetCassandraClusters(this ResourceGroup /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -1034,7 +1243,7 @@ public static async Task> GetCassandraCluster /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -1089,7 +1298,7 @@ public static CosmosDBThroughputPoolCollection GetCosmosDBThroughputPools(this R /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -1127,7 +1336,7 @@ public static async Task> GetCosmosDBTh /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -1152,6 +1361,99 @@ public static Response GetCosmosDBThroughputPool return GetMockableCosmosDBResourceGroupResource(resourceGroupResource).GetCosmosDBThroughputPool(throughputPoolName, cancellationToken); } + /// + /// Gets a collection of FleetResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// is null. + /// An object representing collection of FleetResources and their operations over a FleetResource. + public static FleetResourceCollection GetFleetResources(this ResourceGroupResource resourceGroupResource) + { + Argument.AssertNotNull(resourceGroupResource, nameof(resourceGroupResource)); + + return GetMockableCosmosDBResourceGroupResource(resourceGroupResource).GetFleetResources(); + } + + /// + /// Retrieves the properties of an existing Azure Cosmos DB fleet under a subscription + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/fleets/{fleetName} + /// + /// + /// Operation Id + /// Fleet_Get + /// + /// + /// Default Api Version + /// 2025-05-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// Cosmos DB fleet name. Needs to be unique under a subscription. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public static async Task> GetFleetResourceAsync(this ResourceGroupResource resourceGroupResource, string fleetName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(resourceGroupResource, nameof(resourceGroupResource)); + + return await GetMockableCosmosDBResourceGroupResource(resourceGroupResource).GetFleetResourceAsync(fleetName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Retrieves the properties of an existing Azure Cosmos DB fleet under a subscription + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/fleets/{fleetName} + /// + /// + /// Operation Id + /// Fleet_Get + /// + /// + /// Default Api Version + /// 2025-05-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// Cosmos DB fleet name. Needs to be unique under a subscription. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public static Response GetFleetResource(this ResourceGroupResource resourceGroupResource, string fleetName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(resourceGroupResource, nameof(resourceGroupResource)); + + return GetMockableCosmosDBResourceGroupResource(resourceGroupResource).GetFleetResource(fleetName, cancellationToken); + } + /// /// Gets a collection of CosmosDBLocationResources in the SubscriptionResource. /// @@ -1182,7 +1484,7 @@ public static CosmosDBLocationCollection GetCosmosDBLocations(this SubscriptionR /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -1219,7 +1521,7 @@ public static async Task> GetCosmosDBLocation /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -1256,7 +1558,7 @@ public static Response GetCosmosDBLocation(this Subscr /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -1292,7 +1594,7 @@ public static AsyncPageable GetCosmosDBAccountsAsync(th /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -1328,7 +1630,7 @@ public static Pageable GetCosmosDBAccounts(this Subscri /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -1364,7 +1666,7 @@ public static AsyncPageable GetCassandraClustersAsync( /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -1400,7 +1702,7 @@ public static Pageable GetCassandraClusters(this Subsc /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -1436,7 +1738,7 @@ public static AsyncPageable GetRestorableCosm /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -1472,7 +1774,7 @@ public static Pageable GetRestorableCosmosDBA /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -1508,7 +1810,7 @@ public static AsyncPageable GetCosmosDBThroughpu /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -1531,6 +1833,78 @@ public static Pageable GetCosmosDBThroughputPool return GetMockableCosmosDBSubscriptionResource(subscriptionResource).GetCosmosDBThroughputPools(cancellationToken); } + /// + /// Lists all the fleets under the subscription. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/fleets + /// + /// + /// Operation Id + /// Fleet_List + /// + /// + /// Default Api Version + /// 2025-05-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The cancellation token to use. + /// is null. + /// An async collection of that may take multiple service requests to iterate over. + public static AsyncPageable GetFleetResourcesAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); + + return GetMockableCosmosDBSubscriptionResource(subscriptionResource).GetFleetResourcesAsync(cancellationToken); + } + + /// + /// Lists all the fleets under the subscription. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/fleets + /// + /// + /// Operation Id + /// Fleet_List + /// + /// + /// Default Api Version + /// 2025-05-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The cancellation token to use. + /// is null. + /// A collection of that may take multiple service requests to iterate over. + public static Pageable GetFleetResources(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); + + return GetMockableCosmosDBSubscriptionResource(subscriptionResource).GetFleetResources(cancellationToken); + } + /// /// Checks that the Azure Cosmos DB account name already exists. A valid account name may contain only lowercase letters, numbers, and the '-' character, and must be between 3 and 50 characters. /// @@ -1544,7 +1918,7 @@ public static Pageable GetCosmosDBThroughputPool /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -1581,7 +1955,7 @@ public static async Task> CheckNameExistsDatabaseAccountAsync(thi /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Extensions/MockableCosmosDBArmClient.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Extensions/MockableCosmosDBArmClient.cs index 4fa1c05b5a45..96b494b2f569 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Extensions/MockableCosmosDBArmClient.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Extensions/MockableCosmosDBArmClient.cs @@ -46,6 +46,18 @@ public virtual CosmosDBChaosFaultResource GetCosmosDBChaosFaultResource(Resource return new CosmosDBChaosFaultResource(Client, id); } + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual CopyJobGetResultResource GetCopyJobGetResultResource(ResourceIdentifier id) + { + CopyJobGetResultResource.ValidateResourceId(id); + return new CopyJobGetResultResource(Client, id); + } + /// /// Gets an object representing a along with the instance operations that can be performed on it but with no data. /// You can use to create a from its components. @@ -406,6 +418,30 @@ public virtual CassandraViewGetResultResource GetCassandraViewGetResultResource( return new CassandraViewGetResultResource(Client, id); } + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual CassandraRoleDefinitionResource GetCassandraRoleDefinitionResource(ResourceIdentifier id) + { + CassandraRoleDefinitionResource.ValidateResourceId(id); + return new CassandraRoleDefinitionResource(Client, id); + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual CassandraRoleAssignmentResource GetCassandraRoleAssignmentResource(ResourceIdentifier id) + { + CassandraRoleAssignmentResource.ValidateResourceId(id); + return new CassandraRoleAssignmentResource(Client, id); + } + /// /// Gets an object representing a along with the instance operations that can be performed on it but with no data. /// You can use to create a from its components. @@ -430,6 +466,30 @@ public virtual GremlinGraphResource GetGremlinGraphResource(ResourceIdentifier i return new GremlinGraphResource(Client, id); } + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual GremlinRoleDefinitionResource GetGremlinRoleDefinitionResource(ResourceIdentifier id) + { + GremlinRoleDefinitionResource.ValidateResourceId(id); + return new GremlinRoleDefinitionResource(Client, id); + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual GremlinRoleAssignmentResource GetGremlinRoleAssignmentResource(ResourceIdentifier id) + { + GremlinRoleAssignmentResource.ValidateResourceId(id); + return new GremlinRoleAssignmentResource(Client, id); + } + /// /// Gets an object representing a along with the instance operations that can be performed on it but with no data. /// You can use to create a from its components. @@ -561,5 +621,77 @@ public virtual CosmosDBThroughputPoolAccountResource GetCosmosDBThroughputPoolAc CosmosDBThroughputPoolAccountResource.ValidateResourceId(id); return new CosmosDBThroughputPoolAccountResource(Client, id); } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual MongoMIRoleDefinitionResource GetMongoMIRoleDefinitionResource(ResourceIdentifier id) + { + MongoMIRoleDefinitionResource.ValidateResourceId(id); + return new MongoMIRoleDefinitionResource(Client, id); + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual MongoMIRoleAssignmentResource GetMongoMIRoleAssignmentResource(ResourceIdentifier id) + { + MongoMIRoleAssignmentResource.ValidateResourceId(id); + return new MongoMIRoleAssignmentResource(Client, id); + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual FleetResource GetFleetResource(ResourceIdentifier id) + { + FleetResource.ValidateResourceId(id); + return new FleetResource(Client, id); + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual FleetAnalyticsResource GetFleetAnalyticsResource(ResourceIdentifier id) + { + FleetAnalyticsResource.ValidateResourceId(id); + return new FleetAnalyticsResource(Client, id); + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual FleetspaceResource GetFleetspaceResource(ResourceIdentifier id) + { + FleetspaceResource.ValidateResourceId(id); + return new FleetspaceResource(Client, id); + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual FleetspaceAccountResource GetFleetspaceAccountResource(ResourceIdentifier id) + { + FleetspaceAccountResource.ValidateResourceId(id); + return new FleetspaceAccountResource(Client, id); + } } } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Extensions/MockableCosmosDBResourceGroupResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Extensions/MockableCosmosDBResourceGroupResource.cs index 93d39dd8e3e9..62479ec60982 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Extensions/MockableCosmosDBResourceGroupResource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Extensions/MockableCosmosDBResourceGroupResource.cs @@ -53,7 +53,7 @@ public virtual CosmosDBAccountCollection GetCosmosDBAccounts() /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -84,7 +84,7 @@ public virtual async Task> GetCosmosDBAccountA /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -122,7 +122,7 @@ public virtual CassandraClusterCollection GetCassandraClusters() /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -153,7 +153,7 @@ public virtual async Task> GetCassandraCluste /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -191,7 +191,7 @@ public virtual CosmosDBThroughputPoolCollection GetCosmosDBThroughputPools() /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -222,7 +222,7 @@ public virtual async Task> GetCosmosDBT /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -239,5 +239,74 @@ public virtual Response GetCosmosDBThroughputPoo { return GetCosmosDBThroughputPools().Get(throughputPoolName, cancellationToken); } + + /// Gets a collection of FleetResources in the ResourceGroupResource. + /// An object representing collection of FleetResources and their operations over a FleetResource. + public virtual FleetResourceCollection GetFleetResources() + { + return GetCachedClient(client => new FleetResourceCollection(client, Id)); + } + + /// + /// Retrieves the properties of an existing Azure Cosmos DB fleet under a subscription + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/fleets/{fleetName} + /// + /// + /// Operation Id + /// Fleet_Get + /// + /// + /// Default Api Version + /// 2025-05-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Cosmos DB fleet name. Needs to be unique under a subscription. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetFleetResourceAsync(string fleetName, CancellationToken cancellationToken = default) + { + return await GetFleetResources().GetAsync(fleetName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Retrieves the properties of an existing Azure Cosmos DB fleet under a subscription + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/fleets/{fleetName} + /// + /// + /// Operation Id + /// Fleet_Get + /// + /// + /// Default Api Version + /// 2025-05-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Cosmos DB fleet name. Needs to be unique under a subscription. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetFleetResource(string fleetName, CancellationToken cancellationToken = default) + { + return GetFleetResources().Get(fleetName, cancellationToken); + } } } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Extensions/MockableCosmosDBSubscriptionResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Extensions/MockableCosmosDBSubscriptionResource.cs index c38f8282a4cf..6f81ff66f961 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Extensions/MockableCosmosDBSubscriptionResource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Extensions/MockableCosmosDBSubscriptionResource.cs @@ -24,6 +24,8 @@ public partial class MockableCosmosDBSubscriptionResource : ArmResource private RestorableDatabaseAccountsRestOperations _restorableCosmosDBAccountRestorableDatabaseAccountsRestClient; private ClientDiagnostics _cosmosDBThroughputPoolThroughputPoolsClientDiagnostics; private ThroughputPoolsRestOperations _cosmosDBThroughputPoolThroughputPoolsRestClient; + private ClientDiagnostics _fleetResourceFleetClientDiagnostics; + private FleetRestOperations _fleetResourceFleetRestClient; /// Initializes a new instance of the class for mocking. protected MockableCosmosDBSubscriptionResource() @@ -45,6 +47,8 @@ internal MockableCosmosDBSubscriptionResource(ArmClient client, ResourceIdentifi private RestorableDatabaseAccountsRestOperations RestorableCosmosDBAccountRestorableDatabaseAccountsRestClient => _restorableCosmosDBAccountRestorableDatabaseAccountsRestClient ??= new RestorableDatabaseAccountsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, GetApiVersionOrNull(RestorableCosmosDBAccountResource.ResourceType)); private ClientDiagnostics CosmosDBThroughputPoolThroughputPoolsClientDiagnostics => _cosmosDBThroughputPoolThroughputPoolsClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.CosmosDB", CosmosDBThroughputPoolResource.ResourceType.Namespace, Diagnostics); private ThroughputPoolsRestOperations CosmosDBThroughputPoolThroughputPoolsRestClient => _cosmosDBThroughputPoolThroughputPoolsRestClient ??= new ThroughputPoolsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, GetApiVersionOrNull(CosmosDBThroughputPoolResource.ResourceType)); + private ClientDiagnostics FleetResourceFleetClientDiagnostics => _fleetResourceFleetClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.CosmosDB", FleetResource.ResourceType.Namespace, Diagnostics); + private FleetRestOperations FleetResourceFleetRestClient => _fleetResourceFleetRestClient ??= new FleetRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, GetApiVersionOrNull(FleetResource.ResourceType)); private string GetApiVersionOrNull(ResourceType resourceType) { @@ -72,7 +76,7 @@ public virtual CosmosDBLocationCollection GetCosmosDBLocations() /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -101,7 +105,7 @@ public virtual async Task> GetCosmosDBLocatio /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -130,7 +134,7 @@ public virtual Response GetCosmosDBLocation(AzureLocat /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -159,7 +163,7 @@ public virtual AsyncPageable GetCosmosDBAccountsAsync(C /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -188,7 +192,7 @@ public virtual Pageable GetCosmosDBAccounts(Cancellatio /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -217,7 +221,7 @@ public virtual AsyncPageable GetCassandraClustersAsync /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -246,7 +250,7 @@ public virtual Pageable GetCassandraClusters(Cancellat /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -275,7 +279,7 @@ public virtual AsyncPageable GetRestorableCos /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -304,7 +308,7 @@ public virtual Pageable GetRestorableCosmosDB /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -334,7 +338,7 @@ public virtual AsyncPageable GetCosmosDBThroughp /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -350,5 +354,65 @@ public virtual Pageable GetCosmosDBThroughputPoo HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CosmosDBThroughputPoolThroughputPoolsRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId); return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new CosmosDBThroughputPoolResource(Client, CosmosDBThroughputPoolData.DeserializeCosmosDBThroughputPoolData(e)), CosmosDBThroughputPoolThroughputPoolsClientDiagnostics, Pipeline, "MockableCosmosDBSubscriptionResource.GetCosmosDBThroughputPools", "value", "nextLink", cancellationToken); } + + /// + /// Lists all the fleets under the subscription. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/fleets + /// + /// + /// Operation Id + /// Fleet_List + /// + /// + /// Default Api Version + /// 2025-05-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetFleetResourcesAsync(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => FleetResourceFleetRestClient.CreateListRequest(Id.SubscriptionId); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => FleetResourceFleetRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new FleetResource(Client, FleetResourceData.DeserializeFleetResourceData(e)), FleetResourceFleetClientDiagnostics, Pipeline, "MockableCosmosDBSubscriptionResource.GetFleetResources", "value", "nextLink", cancellationToken); + } + + /// + /// Lists all the fleets under the subscription. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/fleets + /// + /// + /// Operation Id + /// Fleet_List + /// + /// + /// Default Api Version + /// 2025-05-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetFleetResources(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => FleetResourceFleetRestClient.CreateListRequest(Id.SubscriptionId); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => FleetResourceFleetRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new FleetResource(Client, FleetResourceData.DeserializeFleetResourceData(e)), FleetResourceFleetClientDiagnostics, Pipeline, "MockableCosmosDBSubscriptionResource.GetFleetResources", "value", "nextLink", cancellationToken); + } } } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Extensions/MockableCosmosDBTenantResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Extensions/MockableCosmosDBTenantResource.cs index e301cf7e9288..8a8b61a5a6ba 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Extensions/MockableCosmosDBTenantResource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Extensions/MockableCosmosDBTenantResource.cs @@ -53,7 +53,7 @@ private string GetApiVersionOrNull(ResourceType resourceType) /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -96,7 +96,7 @@ public virtual async Task> CheckNameExistsDatabaseAccountAsync(st /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/FleetAnalyticsResource.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/FleetAnalyticsResource.Serialization.cs new file mode 100644 index 000000000000..1e1197204034 --- /dev/null +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/FleetAnalyticsResource.Serialization.cs @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; + +namespace Azure.ResourceManager.CosmosDB +{ + public partial class FleetAnalyticsResource : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); + + FleetAnalyticsResourceData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options); + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options); + + FleetAnalyticsResourceData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options); + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)Data).GetFormatFromOptions(options); + } +} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/FleetAnalyticsResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/FleetAnalyticsResource.cs new file mode 100644 index 000000000000..d8bc1d202a64 --- /dev/null +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/FleetAnalyticsResource.cs @@ -0,0 +1,351 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.CosmosDB +{ + /// + /// A Class representing a FleetAnalyticsResource along with the instance operations that can be performed on it. + /// If you have a you can construct a + /// from an instance of using the GetFleetAnalyticsResource method. + /// Otherwise you can get one from its parent resource using the GetFleetAnalyticsResource method. + /// + public partial class FleetAnalyticsResource : ArmResource + { + /// Generate the resource identifier of a instance. + /// The subscriptionId. + /// The resourceGroupName. + /// The fleetName. + /// The fleetAnalyticsName. + public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string fleetName, string fleetAnalyticsName) + { + var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/fleets/{fleetName}/fleetAnalytics/{fleetAnalyticsName}"; + return new ResourceIdentifier(resourceId); + } + + private readonly ClientDiagnostics _fleetAnalyticsResourceFleetAnalyticsClientDiagnostics; + private readonly FleetAnalyticsRestOperations _fleetAnalyticsResourceFleetAnalyticsRestClient; + private readonly FleetAnalyticsResourceData _data; + + /// Gets the resource type for the operations. + public static readonly ResourceType ResourceType = "Microsoft.DocumentDB/fleets/fleetAnalytics"; + + /// Initializes a new instance of the class for mocking. + protected FleetAnalyticsResource() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The resource that is the target of operations. + internal FleetAnalyticsResource(ArmClient client, FleetAnalyticsResourceData data) : this(client, data.Id) + { + HasData = true; + _data = data; + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The identifier of the resource that is the target of operations. + internal FleetAnalyticsResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _fleetAnalyticsResourceFleetAnalyticsClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.CosmosDB", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string fleetAnalyticsResourceFleetAnalyticsApiVersion); + _fleetAnalyticsResourceFleetAnalyticsRestClient = new FleetAnalyticsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, fleetAnalyticsResourceFleetAnalyticsApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + /// Gets whether or not the current instance has data. + public virtual bool HasData { get; } + + /// Gets the data representing this Feature. + /// Throws if there is no data loaded in the current instance. + public virtual FleetAnalyticsResourceData Data + { + get + { + if (!HasData) + throw new InvalidOperationException("The current instance does not have data, you must call Get first."); + return _data; + } + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceType), nameof(id)); + } + + /// + /// Retrieves the properties of an existing Azure Cosmos DB FleetAnalytics under a fleet + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/fleets/{fleetName}/fleetAnalytics/{fleetAnalyticsName} + /// + /// + /// Operation Id + /// FleetAnalytics_Get + /// + /// + /// Default Api Version + /// 2025-05-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + { + using var scope = _fleetAnalyticsResourceFleetAnalyticsClientDiagnostics.CreateScope("FleetAnalyticsResource.Get"); + scope.Start(); + try + { + var response = await _fleetAnalyticsResourceFleetAnalyticsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new FleetAnalyticsResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Retrieves the properties of an existing Azure Cosmos DB FleetAnalytics under a fleet + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/fleets/{fleetName}/fleetAnalytics/{fleetAnalyticsName} + /// + /// + /// Operation Id + /// FleetAnalytics_Get + /// + /// + /// Default Api Version + /// 2025-05-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual Response Get(CancellationToken cancellationToken = default) + { + using var scope = _fleetAnalyticsResourceFleetAnalyticsClientDiagnostics.CreateScope("FleetAnalyticsResource.Get"); + scope.Start(); + try + { + var response = _fleetAnalyticsResourceFleetAnalyticsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new FleetAnalyticsResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Deletes an existing Azure Cosmos DB FleetAnalytics. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/fleets/{fleetName}/fleetAnalytics/{fleetAnalyticsName} + /// + /// + /// Operation Id + /// FleetAnalytics_Delete + /// + /// + /// Default Api Version + /// 2025-05-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The cancellation token to use. + public virtual async Task DeleteAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default) + { + using var scope = _fleetAnalyticsResourceFleetAnalyticsClientDiagnostics.CreateScope("FleetAnalyticsResource.Delete"); + scope.Start(); + try + { + var response = await _fleetAnalyticsResourceFleetAnalyticsRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + var operation = new CosmosDBArmOperation(_fleetAnalyticsResourceFleetAnalyticsClientDiagnostics, Pipeline, _fleetAnalyticsResourceFleetAnalyticsRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Deletes an existing Azure Cosmos DB FleetAnalytics. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/fleets/{fleetName}/fleetAnalytics/{fleetAnalyticsName} + /// + /// + /// Operation Id + /// FleetAnalytics_Delete + /// + /// + /// Default Api Version + /// 2025-05-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The cancellation token to use. + public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancellationToken = default) + { + using var scope = _fleetAnalyticsResourceFleetAnalyticsClientDiagnostics.CreateScope("FleetAnalyticsResource.Delete"); + scope.Start(); + try + { + var response = _fleetAnalyticsResourceFleetAnalyticsRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + var operation = new CosmosDBArmOperation(_fleetAnalyticsResourceFleetAnalyticsClientDiagnostics, Pipeline, _fleetAnalyticsResourceFleetAnalyticsRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletionResponse(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Creates an Azure Cosmos DB FleetAnalytics under a fleet. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/fleets/{fleetName}/fleetAnalytics/{fleetAnalyticsName} + /// + /// + /// Operation Id + /// FleetAnalytics_Create + /// + /// + /// Default Api Version + /// 2025-05-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The parameters to provide for the current FleetAnalytics. + /// The cancellation token to use. + /// is null. + public virtual async Task> UpdateAsync(WaitUntil waitUntil, FleetAnalyticsResourceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _fleetAnalyticsResourceFleetAnalyticsClientDiagnostics.CreateScope("FleetAnalyticsResource.Update"); + scope.Start(); + try + { + var response = await _fleetAnalyticsResourceFleetAnalyticsRestClient.CreateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, cancellationToken).ConfigureAwait(false); + var uri = _fleetAnalyticsResourceFleetAnalyticsRestClient.CreateCreateRequestUri(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data); + var rehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(RequestMethod.Put, uri.ToUri(), uri.ToString(), "None", null, OperationFinalStateVia.OriginalUri.ToString()); + var operation = new CosmosDBArmOperation(Response.FromValue(new FleetAnalyticsResource(Client, response), response.GetRawResponse()), rehydrationToken); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Creates an Azure Cosmos DB FleetAnalytics under a fleet. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/fleets/{fleetName}/fleetAnalytics/{fleetAnalyticsName} + /// + /// + /// Operation Id + /// FleetAnalytics_Create + /// + /// + /// Default Api Version + /// 2025-05-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The parameters to provide for the current FleetAnalytics. + /// The cancellation token to use. + /// is null. + public virtual ArmOperation Update(WaitUntil waitUntil, FleetAnalyticsResourceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _fleetAnalyticsResourceFleetAnalyticsClientDiagnostics.CreateScope("FleetAnalyticsResource.Update"); + scope.Start(); + try + { + var response = _fleetAnalyticsResourceFleetAnalyticsRestClient.Create(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, cancellationToken); + var uri = _fleetAnalyticsResourceFleetAnalyticsRestClient.CreateCreateRequestUri(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data); + var rehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(RequestMethod.Put, uri.ToUri(), uri.ToString(), "None", null, OperationFinalStateVia.OriginalUri.ToString()); + var operation = new CosmosDBArmOperation(Response.FromValue(new FleetAnalyticsResource(Client, response), response.GetRawResponse()), rehydrationToken); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/FleetAnalyticsResourceCollection.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/FleetAnalyticsResourceCollection.cs new file mode 100644 index 000000000000..3b1af0817d39 --- /dev/null +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/FleetAnalyticsResourceCollection.cs @@ -0,0 +1,497 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Autorest.CSharp.Core; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.CosmosDB +{ + /// + /// A class representing a collection of and their operations. + /// Each in the collection will belong to the same instance of . + /// To get a instance call the GetFleetAnalyticsResources method from an instance of . + /// + public partial class FleetAnalyticsResourceCollection : ArmCollection, IEnumerable, IAsyncEnumerable + { + private readonly ClientDiagnostics _fleetAnalyticsResourceFleetAnalyticsClientDiagnostics; + private readonly FleetAnalyticsRestOperations _fleetAnalyticsResourceFleetAnalyticsRestClient; + + /// Initializes a new instance of the class for mocking. + protected FleetAnalyticsResourceCollection() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The identifier of the parent resource that is the target of operations. + internal FleetAnalyticsResourceCollection(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _fleetAnalyticsResourceFleetAnalyticsClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.CosmosDB", FleetAnalyticsResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(FleetAnalyticsResource.ResourceType, out string fleetAnalyticsResourceFleetAnalyticsApiVersion); + _fleetAnalyticsResourceFleetAnalyticsRestClient = new FleetAnalyticsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, fleetAnalyticsResourceFleetAnalyticsApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != FleetResource.ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, FleetResource.ResourceType), nameof(id)); + } + + /// + /// Creates an Azure Cosmos DB FleetAnalytics under a fleet. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/fleets/{fleetName}/fleetAnalytics/{fleetAnalyticsName} + /// + /// + /// Operation Id + /// FleetAnalytics_Create + /// + /// + /// Default Api Version + /// 2025-05-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// Cosmos DB fleetAnalytics name. + /// The parameters to provide for the current FleetAnalytics. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// or is null. + public virtual async Task> CreateOrUpdateAsync(WaitUntil waitUntil, string fleetAnalyticsName, FleetAnalyticsResourceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(fleetAnalyticsName, nameof(fleetAnalyticsName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _fleetAnalyticsResourceFleetAnalyticsClientDiagnostics.CreateScope("FleetAnalyticsResourceCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = await _fleetAnalyticsResourceFleetAnalyticsRestClient.CreateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, fleetAnalyticsName, data, cancellationToken).ConfigureAwait(false); + var uri = _fleetAnalyticsResourceFleetAnalyticsRestClient.CreateCreateRequestUri(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, fleetAnalyticsName, data); + var rehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(RequestMethod.Put, uri.ToUri(), uri.ToString(), "None", null, OperationFinalStateVia.OriginalUri.ToString()); + var operation = new CosmosDBArmOperation(Response.FromValue(new FleetAnalyticsResource(Client, response), response.GetRawResponse()), rehydrationToken); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Creates an Azure Cosmos DB FleetAnalytics under a fleet. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/fleets/{fleetName}/fleetAnalytics/{fleetAnalyticsName} + /// + /// + /// Operation Id + /// FleetAnalytics_Create + /// + /// + /// Default Api Version + /// 2025-05-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// Cosmos DB fleetAnalytics name. + /// The parameters to provide for the current FleetAnalytics. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// or is null. + public virtual ArmOperation CreateOrUpdate(WaitUntil waitUntil, string fleetAnalyticsName, FleetAnalyticsResourceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(fleetAnalyticsName, nameof(fleetAnalyticsName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _fleetAnalyticsResourceFleetAnalyticsClientDiagnostics.CreateScope("FleetAnalyticsResourceCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = _fleetAnalyticsResourceFleetAnalyticsRestClient.Create(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, fleetAnalyticsName, data, cancellationToken); + var uri = _fleetAnalyticsResourceFleetAnalyticsRestClient.CreateCreateRequestUri(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, fleetAnalyticsName, data); + var rehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(RequestMethod.Put, uri.ToUri(), uri.ToString(), "None", null, OperationFinalStateVia.OriginalUri.ToString()); + var operation = new CosmosDBArmOperation(Response.FromValue(new FleetAnalyticsResource(Client, response), response.GetRawResponse()), rehydrationToken); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Retrieves the properties of an existing Azure Cosmos DB FleetAnalytics under a fleet + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/fleets/{fleetName}/fleetAnalytics/{fleetAnalyticsName} + /// + /// + /// Operation Id + /// FleetAnalytics_Get + /// + /// + /// Default Api Version + /// 2025-05-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Cosmos DB fleetAnalytics name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetAsync(string fleetAnalyticsName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(fleetAnalyticsName, nameof(fleetAnalyticsName)); + + using var scope = _fleetAnalyticsResourceFleetAnalyticsClientDiagnostics.CreateScope("FleetAnalyticsResourceCollection.Get"); + scope.Start(); + try + { + var response = await _fleetAnalyticsResourceFleetAnalyticsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, fleetAnalyticsName, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new FleetAnalyticsResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Retrieves the properties of an existing Azure Cosmos DB FleetAnalytics under a fleet + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/fleets/{fleetName}/fleetAnalytics/{fleetAnalyticsName} + /// + /// + /// Operation Id + /// FleetAnalytics_Get + /// + /// + /// Default Api Version + /// 2025-05-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Cosmos DB fleetAnalytics name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Get(string fleetAnalyticsName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(fleetAnalyticsName, nameof(fleetAnalyticsName)); + + using var scope = _fleetAnalyticsResourceFleetAnalyticsClientDiagnostics.CreateScope("FleetAnalyticsResourceCollection.Get"); + scope.Start(); + try + { + var response = _fleetAnalyticsResourceFleetAnalyticsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, fleetAnalyticsName, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new FleetAnalyticsResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Lists all the FleetAnalytics under a fleet. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/fleets/{fleetName}/fleetAnalytics + /// + /// + /// Operation Id + /// FleetAnalytics_List + /// + /// + /// Default Api Version + /// 2025-05-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetAllAsync(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _fleetAnalyticsResourceFleetAnalyticsRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _fleetAnalyticsResourceFleetAnalyticsRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new FleetAnalyticsResource(Client, FleetAnalyticsResourceData.DeserializeFleetAnalyticsResourceData(e)), _fleetAnalyticsResourceFleetAnalyticsClientDiagnostics, Pipeline, "FleetAnalyticsResourceCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Lists all the FleetAnalytics under a fleet. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/fleets/{fleetName}/fleetAnalytics + /// + /// + /// Operation Id + /// FleetAnalytics_List + /// + /// + /// Default Api Version + /// 2025-05-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetAll(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _fleetAnalyticsResourceFleetAnalyticsRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _fleetAnalyticsResourceFleetAnalyticsRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new FleetAnalyticsResource(Client, FleetAnalyticsResourceData.DeserializeFleetAnalyticsResourceData(e)), _fleetAnalyticsResourceFleetAnalyticsClientDiagnostics, Pipeline, "FleetAnalyticsResourceCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/fleets/{fleetName}/fleetAnalytics/{fleetAnalyticsName} + /// + /// + /// Operation Id + /// FleetAnalytics_Get + /// + /// + /// Default Api Version + /// 2025-05-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Cosmos DB fleetAnalytics name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> ExistsAsync(string fleetAnalyticsName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(fleetAnalyticsName, nameof(fleetAnalyticsName)); + + using var scope = _fleetAnalyticsResourceFleetAnalyticsClientDiagnostics.CreateScope("FleetAnalyticsResourceCollection.Exists"); + scope.Start(); + try + { + var response = await _fleetAnalyticsResourceFleetAnalyticsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, fleetAnalyticsName, cancellationToken: cancellationToken).ConfigureAwait(false); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/fleets/{fleetName}/fleetAnalytics/{fleetAnalyticsName} + /// + /// + /// Operation Id + /// FleetAnalytics_Get + /// + /// + /// Default Api Version + /// 2025-05-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Cosmos DB fleetAnalytics name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Exists(string fleetAnalyticsName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(fleetAnalyticsName, nameof(fleetAnalyticsName)); + + using var scope = _fleetAnalyticsResourceFleetAnalyticsClientDiagnostics.CreateScope("FleetAnalyticsResourceCollection.Exists"); + scope.Start(); + try + { + var response = _fleetAnalyticsResourceFleetAnalyticsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, fleetAnalyticsName, cancellationToken: cancellationToken); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/fleets/{fleetName}/fleetAnalytics/{fleetAnalyticsName} + /// + /// + /// Operation Id + /// FleetAnalytics_Get + /// + /// + /// Default Api Version + /// 2025-05-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Cosmos DB fleetAnalytics name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetIfExistsAsync(string fleetAnalyticsName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(fleetAnalyticsName, nameof(fleetAnalyticsName)); + + using var scope = _fleetAnalyticsResourceFleetAnalyticsClientDiagnostics.CreateScope("FleetAnalyticsResourceCollection.GetIfExists"); + scope.Start(); + try + { + var response = await _fleetAnalyticsResourceFleetAnalyticsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, fleetAnalyticsName, cancellationToken: cancellationToken).ConfigureAwait(false); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new FleetAnalyticsResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/fleets/{fleetName}/fleetAnalytics/{fleetAnalyticsName} + /// + /// + /// Operation Id + /// FleetAnalytics_Get + /// + /// + /// Default Api Version + /// 2025-05-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Cosmos DB fleetAnalytics name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual NullableResponse GetIfExists(string fleetAnalyticsName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(fleetAnalyticsName, nameof(fleetAnalyticsName)); + + using var scope = _fleetAnalyticsResourceFleetAnalyticsClientDiagnostics.CreateScope("FleetAnalyticsResourceCollection.GetIfExists"); + scope.Start(); + try + { + var response = _fleetAnalyticsResourceFleetAnalyticsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, fleetAnalyticsName, cancellationToken: cancellationToken); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new FleetAnalyticsResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetAll().GetEnumerator(); + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetAll().GetEnumerator(); + } + + IAsyncEnumerator IAsyncEnumerable.GetAsyncEnumerator(CancellationToken cancellationToken) + { + return GetAllAsync(cancellationToken: cancellationToken).GetAsyncEnumerator(cancellationToken); + } + } +} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/FleetAnalyticsResourceData.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/FleetAnalyticsResourceData.Serialization.cs new file mode 100644 index 000000000000..8339bedadcbe --- /dev/null +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/FleetAnalyticsResourceData.Serialization.cs @@ -0,0 +1,321 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text; +using System.Text.Json; +using Azure.Core; +using Azure.ResourceManager.CosmosDB.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.CosmosDB +{ + public partial class FleetAnalyticsResourceData : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(FleetAnalyticsResourceData)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + writer.WritePropertyName("properties"u8); + writer.WriteStartObject(); + if (Optional.IsDefined(ProvisioningState)) + { + writer.WritePropertyName("provisioningState"u8); + writer.WriteStringValue(ProvisioningState.Value.ToString()); + } + if (Optional.IsDefined(StorageLocationType)) + { + writer.WritePropertyName("storageLocationType"u8); + writer.WriteStringValue(StorageLocationType.Value.ToString()); + } + if (Optional.IsDefined(StorageLocationUri)) + { + writer.WritePropertyName("storageLocationUri"u8); + writer.WriteStringValue(StorageLocationUri.AbsoluteUri); + } + writer.WriteEndObject(); + } + + FleetAnalyticsResourceData 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(FleetAnalyticsResourceData)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeFleetAnalyticsResourceData(document.RootElement, options); + } + + internal static FleetAnalyticsResourceData DeserializeFleetAnalyticsResourceData(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ResourceIdentifier id = default; + string name = default; + ResourceType type = default; + SystemData systemData = default; + CosmosDBStatus? provisioningState = default; + FleetAnalyticsPropertiesStorageLocationType? storageLocationType = default; + Uri storageLocationUri = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("id"u8)) + { + id = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("type"u8)) + { + type = new ResourceType(property.Value.GetString()); + continue; + } + if (property.NameEquals("systemData"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + systemData = JsonSerializer.Deserialize(property.Value.GetRawText()); + continue; + } + if (property.NameEquals("properties"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + foreach (var property0 in property.Value.EnumerateObject()) + { + if (property0.NameEquals("provisioningState"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + provisioningState = new CosmosDBStatus(property0.Value.GetString()); + continue; + } + if (property0.NameEquals("storageLocationType"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + storageLocationType = new FleetAnalyticsPropertiesStorageLocationType(property0.Value.GetString()); + continue; + } + if (property0.NameEquals("storageLocationUri"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + storageLocationUri = new Uri(property0.Value.GetString()); + continue; + } + } + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new FleetAnalyticsResourceData( + id, + name, + type, + systemData, + provisioningState, + storageLocationType, + storageLocationUri, + serializedAdditionalRawData); + } + + private BinaryData SerializeBicep(ModelReaderWriterOptions options) + { + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Name), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" name: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Name)) + { + builder.Append(" name: "); + if (Name.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{Name}'''"); + } + else + { + builder.AppendLine($"'{Name}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Id), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" id: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Id)) + { + builder.Append(" id: "); + builder.AppendLine($"'{Id.ToString()}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(SystemData), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" systemData: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(SystemData)) + { + builder.Append(" systemData: "); + builder.AppendLine($"'{SystemData.ToString()}'"); + } + } + + builder.Append(" properties:"); + builder.AppendLine(" {"); + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(ProvisioningState), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" provisioningState: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(ProvisioningState)) + { + builder.Append(" provisioningState: "); + builder.AppendLine($"'{ProvisioningState.Value.ToString()}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(StorageLocationType), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" storageLocationType: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(StorageLocationType)) + { + builder.Append(" storageLocationType: "); + builder.AppendLine($"'{StorageLocationType.Value.ToString()}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(StorageLocationUri), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" storageLocationUri: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(StorageLocationUri)) + { + builder.Append(" storageLocationUri: "); + builder.AppendLine($"'{StorageLocationUri.AbsoluteUri}'"); + } + } + + builder.AppendLine(" }"); + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + case "bicep": + return SerializeBicep(options); + default: + throw new FormatException($"The model {nameof(FleetAnalyticsResourceData)} does not support writing '{options.Format}' format."); + } + } + + FleetAnalyticsResourceData 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 DeserializeFleetAnalyticsResourceData(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(FleetAnalyticsResourceData)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/FleetAnalyticsResourceData.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/FleetAnalyticsResourceData.cs new file mode 100644 index 000000000000..c5ed9eb41349 --- /dev/null +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/FleetAnalyticsResourceData.cs @@ -0,0 +1,86 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; +using Azure.ResourceManager.CosmosDB.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.CosmosDB +{ + /// + /// A class representing the FleetAnalyticsResource data model. + /// An Azure Cosmos DB FleetAnalytics. + /// + public partial class FleetAnalyticsResourceData : ResourceData + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public FleetAnalyticsResourceData() + { + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// A provisioning state of the FleetAnalytics. + /// The type of the fleet analytics resource. + /// The unique identifier of the fleet analytics resource. + /// Keeps track of any properties unknown to the library. + internal FleetAnalyticsResourceData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, CosmosDBStatus? provisioningState, FleetAnalyticsPropertiesStorageLocationType? storageLocationType, Uri storageLocationUri, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) + { + ProvisioningState = provisioningState; + StorageLocationType = storageLocationType; + StorageLocationUri = storageLocationUri; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// A provisioning state of the FleetAnalytics. + [WirePath("properties.provisioningState")] + public CosmosDBStatus? ProvisioningState { get; set; } + /// The type of the fleet analytics resource. + [WirePath("properties.storageLocationType")] + public FleetAnalyticsPropertiesStorageLocationType? StorageLocationType { get; set; } + /// The unique identifier of the fleet analytics resource. + [WirePath("properties.storageLocationUri")] + public Uri StorageLocationUri { get; set; } + } +} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/FleetResource.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/FleetResource.Serialization.cs new file mode 100644 index 000000000000..4676fbe96ebe --- /dev/null +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/FleetResource.Serialization.cs @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; + +namespace Azure.ResourceManager.CosmosDB +{ + public partial class FleetResource : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); + + FleetResourceData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options); + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options); + + FleetResourceData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options); + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)Data).GetFormatFromOptions(options); + } +} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/FleetResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/FleetResource.cs new file mode 100644 index 000000000000..3f06103b223f --- /dev/null +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/FleetResource.cs @@ -0,0 +1,478 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.CosmosDB.Models; +using Azure.ResourceManager.Resources; + +namespace Azure.ResourceManager.CosmosDB +{ + /// + /// A Class representing a FleetResource along with the instance operations that can be performed on it. + /// If you have a you can construct a + /// from an instance of using the GetFleetResource method. + /// Otherwise you can get one from its parent resource using the GetFleetResource method. + /// + public partial class FleetResource : ArmResource + { + /// Generate the resource identifier of a instance. + /// The subscriptionId. + /// The resourceGroupName. + /// The fleetName. + public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string fleetName) + { + var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/fleets/{fleetName}"; + return new ResourceIdentifier(resourceId); + } + + private readonly ClientDiagnostics _fleetResourceFleetClientDiagnostics; + private readonly FleetRestOperations _fleetResourceFleetRestClient; + private readonly FleetResourceData _data; + + /// Gets the resource type for the operations. + public static readonly ResourceType ResourceType = "Microsoft.DocumentDB/fleets"; + + /// Initializes a new instance of the class for mocking. + protected FleetResource() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The resource that is the target of operations. + internal FleetResource(ArmClient client, FleetResourceData data) : this(client, data.Id) + { + HasData = true; + _data = data; + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The identifier of the resource that is the target of operations. + internal FleetResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _fleetResourceFleetClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.CosmosDB", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string fleetResourceFleetApiVersion); + _fleetResourceFleetRestClient = new FleetRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, fleetResourceFleetApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + /// Gets whether or not the current instance has data. + public virtual bool HasData { get; } + + /// Gets the data representing this Feature. + /// Throws if there is no data loaded in the current instance. + public virtual FleetResourceData Data + { + get + { + if (!HasData) + throw new InvalidOperationException("The current instance does not have data, you must call Get first."); + return _data; + } + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceType), nameof(id)); + } + + /// Gets a collection of FleetAnalyticsResources in the FleetResource. + /// An object representing collection of FleetAnalyticsResources and their operations over a FleetAnalyticsResource. + public virtual FleetAnalyticsResourceCollection GetFleetAnalyticsResources() + { + return GetCachedClient(client => new FleetAnalyticsResourceCollection(client, Id)); + } + + /// + /// Retrieves the properties of an existing Azure Cosmos DB FleetAnalytics under a fleet + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/fleets/{fleetName}/fleetAnalytics/{fleetAnalyticsName} + /// + /// + /// Operation Id + /// FleetAnalytics_Get + /// + /// + /// Default Api Version + /// 2025-05-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Cosmos DB fleetAnalytics name. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetFleetAnalyticsResourceAsync(string fleetAnalyticsName, CancellationToken cancellationToken = default) + { + return await GetFleetAnalyticsResources().GetAsync(fleetAnalyticsName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Retrieves the properties of an existing Azure Cosmos DB FleetAnalytics under a fleet + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/fleets/{fleetName}/fleetAnalytics/{fleetAnalyticsName} + /// + /// + /// Operation Id + /// FleetAnalytics_Get + /// + /// + /// Default Api Version + /// 2025-05-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Cosmos DB fleetAnalytics name. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetFleetAnalyticsResource(string fleetAnalyticsName, CancellationToken cancellationToken = default) + { + return GetFleetAnalyticsResources().Get(fleetAnalyticsName, cancellationToken); + } + + /// Gets a collection of FleetspaceResources in the FleetResource. + /// An object representing collection of FleetspaceResources and their operations over a FleetspaceResource. + public virtual FleetspaceResourceCollection GetFleetspaceResources() + { + return GetCachedClient(client => new FleetspaceResourceCollection(client, Id)); + } + + /// + /// Retrieves the properties of an existing Azure Cosmos DB fleetspace under a fleet + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/fleets/{fleetName}/fleetspaces/{fleetspaceName} + /// + /// + /// Operation Id + /// Fleetspace_Get + /// + /// + /// Default Api Version + /// 2025-05-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Cosmos DB fleetspace name. Needs to be unique under a fleet. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetFleetspaceResourceAsync(string fleetspaceName, CancellationToken cancellationToken = default) + { + return await GetFleetspaceResources().GetAsync(fleetspaceName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Retrieves the properties of an existing Azure Cosmos DB fleetspace under a fleet + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/fleets/{fleetName}/fleetspaces/{fleetspaceName} + /// + /// + /// Operation Id + /// Fleetspace_Get + /// + /// + /// Default Api Version + /// 2025-05-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Cosmos DB fleetspace name. Needs to be unique under a fleet. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetFleetspaceResource(string fleetspaceName, CancellationToken cancellationToken = default) + { + return GetFleetspaceResources().Get(fleetspaceName, cancellationToken); + } + + /// + /// Retrieves the properties of an existing Azure Cosmos DB fleet under a subscription + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/fleets/{fleetName} + /// + /// + /// Operation Id + /// Fleet_Get + /// + /// + /// Default Api Version + /// 2025-05-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + { + using var scope = _fleetResourceFleetClientDiagnostics.CreateScope("FleetResource.Get"); + scope.Start(); + try + { + var response = await _fleetResourceFleetRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new FleetResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Retrieves the properties of an existing Azure Cosmos DB fleet under a subscription + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/fleets/{fleetName} + /// + /// + /// Operation Id + /// Fleet_Get + /// + /// + /// Default Api Version + /// 2025-05-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual Response Get(CancellationToken cancellationToken = default) + { + using var scope = _fleetResourceFleetClientDiagnostics.CreateScope("FleetResource.Get"); + scope.Start(); + try + { + var response = _fleetResourceFleetRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new FleetResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Deletes an existing Azure Cosmos DB Fleet. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/fleets/{fleetName} + /// + /// + /// Operation Id + /// Fleet_Delete + /// + /// + /// Default Api Version + /// 2025-05-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The cancellation token to use. + public virtual async Task DeleteAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default) + { + using var scope = _fleetResourceFleetClientDiagnostics.CreateScope("FleetResource.Delete"); + scope.Start(); + try + { + var response = await _fleetResourceFleetRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + var operation = new CosmosDBArmOperation(_fleetResourceFleetClientDiagnostics, Pipeline, _fleetResourceFleetRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Deletes an existing Azure Cosmos DB Fleet. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/fleets/{fleetName} + /// + /// + /// Operation Id + /// Fleet_Delete + /// + /// + /// Default Api Version + /// 2025-05-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The cancellation token to use. + public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancellationToken = default) + { + using var scope = _fleetResourceFleetClientDiagnostics.CreateScope("FleetResource.Delete"); + scope.Start(); + try + { + var response = _fleetResourceFleetRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + var operation = new CosmosDBArmOperation(_fleetResourceFleetClientDiagnostics, Pipeline, _fleetResourceFleetRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletionResponse(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Updates the properties of an existing Azure Cosmos DB Fleet. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/fleets/{fleetName} + /// + /// + /// Operation Id + /// Fleet_Update + /// + /// + /// Default Api Version + /// 2025-05-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The parameters to provide for the current fleet. + /// The cancellation token to use. + /// is null. + public virtual async Task> UpdateAsync(FleetResourcePatch patch, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(patch, nameof(patch)); + + using var scope = _fleetResourceFleetClientDiagnostics.CreateScope("FleetResource.Update"); + scope.Start(); + try + { + var response = await _fleetResourceFleetRestClient.UpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, patch, cancellationToken).ConfigureAwait(false); + return Response.FromValue(new FleetResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Updates the properties of an existing Azure Cosmos DB Fleet. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/fleets/{fleetName} + /// + /// + /// Operation Id + /// Fleet_Update + /// + /// + /// Default Api Version + /// 2025-05-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The parameters to provide for the current fleet. + /// The cancellation token to use. + /// is null. + public virtual Response Update(FleetResourcePatch patch, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(patch, nameof(patch)); + + using var scope = _fleetResourceFleetClientDiagnostics.CreateScope("FleetResource.Update"); + scope.Start(); + try + { + var response = _fleetResourceFleetRestClient.Update(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, patch, cancellationToken); + return Response.FromValue(new FleetResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/FleetResourceCollection.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/FleetResourceCollection.cs new file mode 100644 index 000000000000..838a631a7381 --- /dev/null +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/FleetResourceCollection.cs @@ -0,0 +1,498 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Autorest.CSharp.Core; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.Resources; + +namespace Azure.ResourceManager.CosmosDB +{ + /// + /// A class representing a collection of and their operations. + /// Each in the collection will belong to the same instance of . + /// To get a instance call the GetFleetResources method from an instance of . + /// + public partial class FleetResourceCollection : ArmCollection, IEnumerable, IAsyncEnumerable + { + private readonly ClientDiagnostics _fleetResourceFleetClientDiagnostics; + private readonly FleetRestOperations _fleetResourceFleetRestClient; + + /// Initializes a new instance of the class for mocking. + protected FleetResourceCollection() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The identifier of the parent resource that is the target of operations. + internal FleetResourceCollection(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _fleetResourceFleetClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.CosmosDB", FleetResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(FleetResource.ResourceType, out string fleetResourceFleetApiVersion); + _fleetResourceFleetRestClient = new FleetRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, fleetResourceFleetApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != ResourceGroupResource.ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceGroupResource.ResourceType), nameof(id)); + } + + /// + /// Creates an Azure Cosmos DB fleet under a subscription. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/fleets/{fleetName} + /// + /// + /// Operation Id + /// Fleet_Create + /// + /// + /// Default Api Version + /// 2025-05-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// Cosmos DB fleet name. Needs to be unique under a subscription. + /// The parameters to provide for the current fleet. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// or is null. + public virtual async Task> CreateOrUpdateAsync(WaitUntil waitUntil, string fleetName, FleetResourceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _fleetResourceFleetClientDiagnostics.CreateScope("FleetResourceCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = await _fleetResourceFleetRestClient.CreateAsync(Id.SubscriptionId, Id.ResourceGroupName, fleetName, data, cancellationToken).ConfigureAwait(false); + var uri = _fleetResourceFleetRestClient.CreateCreateRequestUri(Id.SubscriptionId, Id.ResourceGroupName, fleetName, data); + var rehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(RequestMethod.Put, uri.ToUri(), uri.ToString(), "None", null, OperationFinalStateVia.OriginalUri.ToString()); + var operation = new CosmosDBArmOperation(Response.FromValue(new FleetResource(Client, response), response.GetRawResponse()), rehydrationToken); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Creates an Azure Cosmos DB fleet under a subscription. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/fleets/{fleetName} + /// + /// + /// Operation Id + /// Fleet_Create + /// + /// + /// Default Api Version + /// 2025-05-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// Cosmos DB fleet name. Needs to be unique under a subscription. + /// The parameters to provide for the current fleet. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// or is null. + public virtual ArmOperation CreateOrUpdate(WaitUntil waitUntil, string fleetName, FleetResourceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _fleetResourceFleetClientDiagnostics.CreateScope("FleetResourceCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = _fleetResourceFleetRestClient.Create(Id.SubscriptionId, Id.ResourceGroupName, fleetName, data, cancellationToken); + var uri = _fleetResourceFleetRestClient.CreateCreateRequestUri(Id.SubscriptionId, Id.ResourceGroupName, fleetName, data); + var rehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(RequestMethod.Put, uri.ToUri(), uri.ToString(), "None", null, OperationFinalStateVia.OriginalUri.ToString()); + var operation = new CosmosDBArmOperation(Response.FromValue(new FleetResource(Client, response), response.GetRawResponse()), rehydrationToken); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Retrieves the properties of an existing Azure Cosmos DB fleet under a subscription + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/fleets/{fleetName} + /// + /// + /// Operation Id + /// Fleet_Get + /// + /// + /// Default Api Version + /// 2025-05-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Cosmos DB fleet name. Needs to be unique under a subscription. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetAsync(string fleetName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + + using var scope = _fleetResourceFleetClientDiagnostics.CreateScope("FleetResourceCollection.Get"); + scope.Start(); + try + { + var response = await _fleetResourceFleetRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, fleetName, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new FleetResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Retrieves the properties of an existing Azure Cosmos DB fleet under a subscription + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/fleets/{fleetName} + /// + /// + /// Operation Id + /// Fleet_Get + /// + /// + /// Default Api Version + /// 2025-05-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Cosmos DB fleet name. Needs to be unique under a subscription. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Get(string fleetName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + + using var scope = _fleetResourceFleetClientDiagnostics.CreateScope("FleetResourceCollection.Get"); + scope.Start(); + try + { + var response = _fleetResourceFleetRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, fleetName, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new FleetResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Lists all the fleets under the specified subscription and resource group. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/fleets + /// + /// + /// Operation Id + /// Fleet_ListByResourceGroup + /// + /// + /// Default Api Version + /// 2025-05-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetAllAsync(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _fleetResourceFleetRestClient.CreateListByResourceGroupRequest(Id.SubscriptionId, Id.ResourceGroupName); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _fleetResourceFleetRestClient.CreateListByResourceGroupNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new FleetResource(Client, FleetResourceData.DeserializeFleetResourceData(e)), _fleetResourceFleetClientDiagnostics, Pipeline, "FleetResourceCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Lists all the fleets under the specified subscription and resource group. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/fleets + /// + /// + /// Operation Id + /// Fleet_ListByResourceGroup + /// + /// + /// Default Api Version + /// 2025-05-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetAll(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _fleetResourceFleetRestClient.CreateListByResourceGroupRequest(Id.SubscriptionId, Id.ResourceGroupName); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _fleetResourceFleetRestClient.CreateListByResourceGroupNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new FleetResource(Client, FleetResourceData.DeserializeFleetResourceData(e)), _fleetResourceFleetClientDiagnostics, Pipeline, "FleetResourceCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/fleets/{fleetName} + /// + /// + /// Operation Id + /// Fleet_Get + /// + /// + /// Default Api Version + /// 2025-05-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Cosmos DB fleet name. Needs to be unique under a subscription. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> ExistsAsync(string fleetName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + + using var scope = _fleetResourceFleetClientDiagnostics.CreateScope("FleetResourceCollection.Exists"); + scope.Start(); + try + { + var response = await _fleetResourceFleetRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, fleetName, cancellationToken: cancellationToken).ConfigureAwait(false); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/fleets/{fleetName} + /// + /// + /// Operation Id + /// Fleet_Get + /// + /// + /// Default Api Version + /// 2025-05-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Cosmos DB fleet name. Needs to be unique under a subscription. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Exists(string fleetName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + + using var scope = _fleetResourceFleetClientDiagnostics.CreateScope("FleetResourceCollection.Exists"); + scope.Start(); + try + { + var response = _fleetResourceFleetRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, fleetName, cancellationToken: cancellationToken); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/fleets/{fleetName} + /// + /// + /// Operation Id + /// Fleet_Get + /// + /// + /// Default Api Version + /// 2025-05-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Cosmos DB fleet name. Needs to be unique under a subscription. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetIfExistsAsync(string fleetName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + + using var scope = _fleetResourceFleetClientDiagnostics.CreateScope("FleetResourceCollection.GetIfExists"); + scope.Start(); + try + { + var response = await _fleetResourceFleetRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, fleetName, cancellationToken: cancellationToken).ConfigureAwait(false); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new FleetResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/fleets/{fleetName} + /// + /// + /// Operation Id + /// Fleet_Get + /// + /// + /// Default Api Version + /// 2025-05-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Cosmos DB fleet name. Needs to be unique under a subscription. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual NullableResponse GetIfExists(string fleetName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + + using var scope = _fleetResourceFleetClientDiagnostics.CreateScope("FleetResourceCollection.GetIfExists"); + scope.Start(); + try + { + var response = _fleetResourceFleetRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, fleetName, cancellationToken: cancellationToken); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new FleetResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetAll().GetEnumerator(); + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetAll().GetEnumerator(); + } + + IAsyncEnumerator IAsyncEnumerable.GetAsyncEnumerator(CancellationToken cancellationToken) + { + return GetAllAsync(cancellationToken: cancellationToken).GetAsyncEnumerator(cancellationToken); + } + } +} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/FleetResourceData.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/FleetResourceData.Serialization.cs new file mode 100644 index 000000000000..3829f7332fd7 --- /dev/null +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/FleetResourceData.Serialization.cs @@ -0,0 +1,332 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Text.Json; +using Azure.Core; +using Azure.ResourceManager.CosmosDB.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.CosmosDB +{ + public partial class FleetResourceData : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(FleetResourceData)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + writer.WritePropertyName("properties"u8); + writer.WriteStartObject(); + if (Optional.IsDefined(ProvisioningState)) + { + writer.WritePropertyName("provisioningState"u8); + writer.WriteStringValue(ProvisioningState.Value.ToString()); + } + writer.WriteEndObject(); + } + + FleetResourceData 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(FleetResourceData)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeFleetResourceData(document.RootElement, options); + } + + internal static FleetResourceData DeserializeFleetResourceData(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IDictionary tags = default; + AzureLocation location = default; + ResourceIdentifier id = default; + string name = default; + ResourceType type = default; + SystemData systemData = default; + CosmosDBStatus? provisioningState = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("tags"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + Dictionary dictionary = new Dictionary(); + foreach (var property0 in property.Value.EnumerateObject()) + { + dictionary.Add(property0.Name, property0.Value.GetString()); + } + tags = dictionary; + continue; + } + if (property.NameEquals("location"u8)) + { + location = new AzureLocation(property.Value.GetString()); + continue; + } + if (property.NameEquals("id"u8)) + { + id = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("type"u8)) + { + type = new ResourceType(property.Value.GetString()); + continue; + } + if (property.NameEquals("systemData"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + systemData = JsonSerializer.Deserialize(property.Value.GetRawText()); + continue; + } + if (property.NameEquals("properties"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + foreach (var property0 in property.Value.EnumerateObject()) + { + if (property0.NameEquals("provisioningState"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + provisioningState = new CosmosDBStatus(property0.Value.GetString()); + continue; + } + } + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new FleetResourceData( + id, + name, + type, + systemData, + tags ?? new ChangeTrackingDictionary(), + location, + provisioningState, + serializedAdditionalRawData); + } + + private BinaryData SerializeBicep(ModelReaderWriterOptions options) + { + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Name), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" name: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Name)) + { + builder.Append(" name: "); + if (Name.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{Name}'''"); + } + else + { + builder.AppendLine($"'{Name}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Location), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" location: "); + builder.AppendLine(propertyOverride); + } + else + { + builder.Append(" location: "); + builder.AppendLine($"'{Location.ToString()}'"); + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Tags), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" tags: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsCollectionDefined(Tags)) + { + if (Tags.Any()) + { + builder.Append(" tags: "); + builder.AppendLine("{"); + foreach (var item in Tags) + { + builder.Append($" '{item.Key}': "); + if (item.Value == null) + { + builder.Append("null"); + continue; + } + if (item.Value.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{item.Value}'''"); + } + else + { + builder.AppendLine($"'{item.Value}'"); + } + } + builder.AppendLine(" }"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Id), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" id: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Id)) + { + builder.Append(" id: "); + builder.AppendLine($"'{Id.ToString()}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(SystemData), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" systemData: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(SystemData)) + { + builder.Append(" systemData: "); + builder.AppendLine($"'{SystemData.ToString()}'"); + } + } + + builder.Append(" properties:"); + builder.AppendLine(" {"); + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(ProvisioningState), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" provisioningState: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(ProvisioningState)) + { + builder.Append(" provisioningState: "); + builder.AppendLine($"'{ProvisioningState.Value.ToString()}'"); + } + } + + builder.AppendLine(" }"); + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + case "bicep": + return SerializeBicep(options); + default: + throw new FormatException($"The model {nameof(FleetResourceData)} does not support writing '{options.Format}' format."); + } + } + + FleetResourceData 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 DeserializeFleetResourceData(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(FleetResourceData)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/FleetResourceData.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/FleetResourceData.cs new file mode 100644 index 000000000000..bd25c79a5938 --- /dev/null +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/FleetResourceData.cs @@ -0,0 +1,84 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; +using Azure.ResourceManager.CosmosDB.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.CosmosDB +{ + /// + /// A class representing the FleetResource data model. + /// An Azure Cosmos DB FleetResource. + /// + public partial class FleetResourceData : TrackedResourceData + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The location. + public FleetResourceData(AzureLocation location) : base(location) + { + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The tags. + /// The location. + /// A provisioning state of the Fleet. + /// Keeps track of any properties unknown to the library. + internal FleetResourceData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, CosmosDBStatus? provisioningState, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) + { + ProvisioningState = provisioningState; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal FleetResourceData() + { + } + + /// A provisioning state of the Fleet. + [WirePath("properties.provisioningState")] + public CosmosDBStatus? ProvisioningState { get; set; } + } +} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/FleetspaceAccountResource.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/FleetspaceAccountResource.Serialization.cs new file mode 100644 index 000000000000..d002fa9e8ed3 --- /dev/null +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/FleetspaceAccountResource.Serialization.cs @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; + +namespace Azure.ResourceManager.CosmosDB +{ + public partial class FleetspaceAccountResource : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); + + FleetspaceAccountResourceData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options); + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options); + + FleetspaceAccountResourceData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options); + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)Data).GetFormatFromOptions(options); + } +} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/FleetspaceAccountResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/FleetspaceAccountResource.cs new file mode 100644 index 000000000000..49569db9c5a6 --- /dev/null +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/FleetspaceAccountResource.cs @@ -0,0 +1,348 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.CosmosDB +{ + /// + /// A Class representing a FleetspaceAccountResource along with the instance operations that can be performed on it. + /// If you have a you can construct a + /// from an instance of using the GetFleetspaceAccountResource method. + /// Otherwise you can get one from its parent resource using the GetFleetspaceAccountResource method. + /// + public partial class FleetspaceAccountResource : ArmResource + { + /// Generate the resource identifier of a instance. + /// The subscriptionId. + /// The resourceGroupName. + /// The fleetName. + /// The fleetspaceName. + /// The fleetspaceAccountName. + public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string fleetName, string fleetspaceName, string fleetspaceAccountName) + { + var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/fleets/{fleetName}/fleetspaces/{fleetspaceName}/fleetspaceAccounts/{fleetspaceAccountName}"; + return new ResourceIdentifier(resourceId); + } + + private readonly ClientDiagnostics _fleetspaceAccountResourceFleetspaceAccountClientDiagnostics; + private readonly FleetspaceAccountRestOperations _fleetspaceAccountResourceFleetspaceAccountRestClient; + private readonly FleetspaceAccountResourceData _data; + + /// Gets the resource type for the operations. + public static readonly ResourceType ResourceType = "Microsoft.DocumentDB/fleets/fleetspaces/fleetspaceAccounts"; + + /// Initializes a new instance of the class for mocking. + protected FleetspaceAccountResource() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The resource that is the target of operations. + internal FleetspaceAccountResource(ArmClient client, FleetspaceAccountResourceData data) : this(client, data.Id) + { + HasData = true; + _data = data; + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The identifier of the resource that is the target of operations. + internal FleetspaceAccountResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _fleetspaceAccountResourceFleetspaceAccountClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.CosmosDB", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string fleetspaceAccountResourceFleetspaceAccountApiVersion); + _fleetspaceAccountResourceFleetspaceAccountRestClient = new FleetspaceAccountRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, fleetspaceAccountResourceFleetspaceAccountApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + /// Gets whether or not the current instance has data. + public virtual bool HasData { get; } + + /// Gets the data representing this Feature. + /// Throws if there is no data loaded in the current instance. + public virtual FleetspaceAccountResourceData Data + { + get + { + if (!HasData) + throw new InvalidOperationException("The current instance does not have data, you must call Get first."); + return _data; + } + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceType), nameof(id)); + } + + /// + /// Retrieves the properties of an existing Azure Cosmos DB fleetspace account under a fleetspace + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/fleets/{fleetName}/fleetspaces/{fleetspaceName}/fleetspaceAccounts/{fleetspaceAccountName} + /// + /// + /// Operation Id + /// FleetspaceAccount_Get + /// + /// + /// Default Api Version + /// 2025-05-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + { + using var scope = _fleetspaceAccountResourceFleetspaceAccountClientDiagnostics.CreateScope("FleetspaceAccountResource.Get"); + scope.Start(); + try + { + var response = await _fleetspaceAccountResourceFleetspaceAccountRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new FleetspaceAccountResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Retrieves the properties of an existing Azure Cosmos DB fleetspace account under a fleetspace + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/fleets/{fleetName}/fleetspaces/{fleetspaceName}/fleetspaceAccounts/{fleetspaceAccountName} + /// + /// + /// Operation Id + /// FleetspaceAccount_Get + /// + /// + /// Default Api Version + /// 2025-05-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual Response Get(CancellationToken cancellationToken = default) + { + using var scope = _fleetspaceAccountResourceFleetspaceAccountClientDiagnostics.CreateScope("FleetspaceAccountResource.Get"); + scope.Start(); + try + { + var response = _fleetspaceAccountResourceFleetspaceAccountRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new FleetspaceAccountResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Removes an existing Azure Cosmos DB fleetspace account from a fleetspace. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/fleets/{fleetName}/fleetspaces/{fleetspaceName}/fleetspaceAccounts/{fleetspaceAccountName} + /// + /// + /// Operation Id + /// FleetspaceAccount_Delete + /// + /// + /// Default Api Version + /// 2025-05-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The cancellation token to use. + public virtual async Task DeleteAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default) + { + using var scope = _fleetspaceAccountResourceFleetspaceAccountClientDiagnostics.CreateScope("FleetspaceAccountResource.Delete"); + scope.Start(); + try + { + var response = await _fleetspaceAccountResourceFleetspaceAccountRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + var operation = new CosmosDBArmOperation(_fleetspaceAccountResourceFleetspaceAccountClientDiagnostics, Pipeline, _fleetspaceAccountResourceFleetspaceAccountRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Removes an existing Azure Cosmos DB fleetspace account from a fleetspace. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/fleets/{fleetName}/fleetspaces/{fleetspaceName}/fleetspaceAccounts/{fleetspaceAccountName} + /// + /// + /// Operation Id + /// FleetspaceAccount_Delete + /// + /// + /// Default Api Version + /// 2025-05-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The cancellation token to use. + public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancellationToken = default) + { + using var scope = _fleetspaceAccountResourceFleetspaceAccountClientDiagnostics.CreateScope("FleetspaceAccountResource.Delete"); + scope.Start(); + try + { + var response = _fleetspaceAccountResourceFleetspaceAccountRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken); + var operation = new CosmosDBArmOperation(_fleetspaceAccountResourceFleetspaceAccountClientDiagnostics, Pipeline, _fleetspaceAccountResourceFleetspaceAccountRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletionResponse(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Creates an Azure Cosmos DB fleetspace account under a fleetspace. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/fleets/{fleetName}/fleetspaces/{fleetspaceName}/fleetspaceAccounts/{fleetspaceAccountName} + /// + /// + /// Operation Id + /// FleetspaceAccount_Create + /// + /// + /// Default Api Version + /// 2025-05-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The parameters to provide for the current fleetspace account. + /// The cancellation token to use. + /// is null. + public virtual async Task> UpdateAsync(WaitUntil waitUntil, FleetspaceAccountResourceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _fleetspaceAccountResourceFleetspaceAccountClientDiagnostics.CreateScope("FleetspaceAccountResource.Update"); + scope.Start(); + try + { + var response = await _fleetspaceAccountResourceFleetspaceAccountRestClient.CreateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, data, cancellationToken).ConfigureAwait(false); + var operation = new CosmosDBArmOperation(new FleetspaceAccountResourceOperationSource(Client), _fleetspaceAccountResourceFleetspaceAccountClientDiagnostics, Pipeline, _fleetspaceAccountResourceFleetspaceAccountRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Creates an Azure Cosmos DB fleetspace account under a fleetspace. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/fleets/{fleetName}/fleetspaces/{fleetspaceName}/fleetspaceAccounts/{fleetspaceAccountName} + /// + /// + /// Operation Id + /// FleetspaceAccount_Create + /// + /// + /// Default Api Version + /// 2025-05-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The parameters to provide for the current fleetspace account. + /// The cancellation token to use. + /// is null. + public virtual ArmOperation Update(WaitUntil waitUntil, FleetspaceAccountResourceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _fleetspaceAccountResourceFleetspaceAccountClientDiagnostics.CreateScope("FleetspaceAccountResource.Update"); + scope.Start(); + try + { + var response = _fleetspaceAccountResourceFleetspaceAccountRestClient.Create(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, data, cancellationToken); + var operation = new CosmosDBArmOperation(new FleetspaceAccountResourceOperationSource(Client), _fleetspaceAccountResourceFleetspaceAccountClientDiagnostics, Pipeline, _fleetspaceAccountResourceFleetspaceAccountRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/FleetspaceAccountResourceCollection.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/FleetspaceAccountResourceCollection.cs new file mode 100644 index 000000000000..9bfc345bc33c --- /dev/null +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/FleetspaceAccountResourceCollection.cs @@ -0,0 +1,493 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Autorest.CSharp.Core; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.CosmosDB +{ + /// + /// A class representing a collection of and their operations. + /// Each in the collection will belong to the same instance of . + /// To get a instance call the GetFleetspaceAccountResources method from an instance of . + /// + public partial class FleetspaceAccountResourceCollection : ArmCollection, IEnumerable, IAsyncEnumerable + { + private readonly ClientDiagnostics _fleetspaceAccountResourceFleetspaceAccountClientDiagnostics; + private readonly FleetspaceAccountRestOperations _fleetspaceAccountResourceFleetspaceAccountRestClient; + + /// Initializes a new instance of the class for mocking. + protected FleetspaceAccountResourceCollection() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The identifier of the parent resource that is the target of operations. + internal FleetspaceAccountResourceCollection(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _fleetspaceAccountResourceFleetspaceAccountClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.CosmosDB", FleetspaceAccountResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(FleetspaceAccountResource.ResourceType, out string fleetspaceAccountResourceFleetspaceAccountApiVersion); + _fleetspaceAccountResourceFleetspaceAccountRestClient = new FleetspaceAccountRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, fleetspaceAccountResourceFleetspaceAccountApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != FleetspaceResource.ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, FleetspaceResource.ResourceType), nameof(id)); + } + + /// + /// Creates an Azure Cosmos DB fleetspace account under a fleetspace. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/fleets/{fleetName}/fleetspaces/{fleetspaceName}/fleetspaceAccounts/{fleetspaceAccountName} + /// + /// + /// Operation Id + /// FleetspaceAccount_Create + /// + /// + /// Default Api Version + /// 2025-05-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// Cosmos DB fleetspace account name. + /// The parameters to provide for the current fleetspace account. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// or is null. + public virtual async Task> CreateOrUpdateAsync(WaitUntil waitUntil, string fleetspaceAccountName, FleetspaceAccountResourceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(fleetspaceAccountName, nameof(fleetspaceAccountName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _fleetspaceAccountResourceFleetspaceAccountClientDiagnostics.CreateScope("FleetspaceAccountResourceCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = await _fleetspaceAccountResourceFleetspaceAccountRestClient.CreateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, fleetspaceAccountName, data, cancellationToken).ConfigureAwait(false); + var operation = new CosmosDBArmOperation(new FleetspaceAccountResourceOperationSource(Client), _fleetspaceAccountResourceFleetspaceAccountClientDiagnostics, Pipeline, _fleetspaceAccountResourceFleetspaceAccountRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, fleetspaceAccountName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Creates an Azure Cosmos DB fleetspace account under a fleetspace. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/fleets/{fleetName}/fleetspaces/{fleetspaceName}/fleetspaceAccounts/{fleetspaceAccountName} + /// + /// + /// Operation Id + /// FleetspaceAccount_Create + /// + /// + /// Default Api Version + /// 2025-05-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// Cosmos DB fleetspace account name. + /// The parameters to provide for the current fleetspace account. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// or is null. + public virtual ArmOperation CreateOrUpdate(WaitUntil waitUntil, string fleetspaceAccountName, FleetspaceAccountResourceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(fleetspaceAccountName, nameof(fleetspaceAccountName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _fleetspaceAccountResourceFleetspaceAccountClientDiagnostics.CreateScope("FleetspaceAccountResourceCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = _fleetspaceAccountResourceFleetspaceAccountRestClient.Create(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, fleetspaceAccountName, data, cancellationToken); + var operation = new CosmosDBArmOperation(new FleetspaceAccountResourceOperationSource(Client), _fleetspaceAccountResourceFleetspaceAccountClientDiagnostics, Pipeline, _fleetspaceAccountResourceFleetspaceAccountRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, fleetspaceAccountName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Retrieves the properties of an existing Azure Cosmos DB fleetspace account under a fleetspace + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/fleets/{fleetName}/fleetspaces/{fleetspaceName}/fleetspaceAccounts/{fleetspaceAccountName} + /// + /// + /// Operation Id + /// FleetspaceAccount_Get + /// + /// + /// Default Api Version + /// 2025-05-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Cosmos DB fleetspace account name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetAsync(string fleetspaceAccountName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(fleetspaceAccountName, nameof(fleetspaceAccountName)); + + using var scope = _fleetspaceAccountResourceFleetspaceAccountClientDiagnostics.CreateScope("FleetspaceAccountResourceCollection.Get"); + scope.Start(); + try + { + var response = await _fleetspaceAccountResourceFleetspaceAccountRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, fleetspaceAccountName, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new FleetspaceAccountResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Retrieves the properties of an existing Azure Cosmos DB fleetspace account under a fleetspace + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/fleets/{fleetName}/fleetspaces/{fleetspaceName}/fleetspaceAccounts/{fleetspaceAccountName} + /// + /// + /// Operation Id + /// FleetspaceAccount_Get + /// + /// + /// Default Api Version + /// 2025-05-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Cosmos DB fleetspace account name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Get(string fleetspaceAccountName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(fleetspaceAccountName, nameof(fleetspaceAccountName)); + + using var scope = _fleetspaceAccountResourceFleetspaceAccountClientDiagnostics.CreateScope("FleetspaceAccountResourceCollection.Get"); + scope.Start(); + try + { + var response = _fleetspaceAccountResourceFleetspaceAccountRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, fleetspaceAccountName, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new FleetspaceAccountResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Lists all the fleetspaces accounts under a fleetspace. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/fleets/{fleetName}/fleetspaces/{fleetspaceName}/fleetspaceAccounts + /// + /// + /// Operation Id + /// FleetspaceAccount_List + /// + /// + /// Default Api Version + /// 2025-05-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetAllAsync(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _fleetspaceAccountResourceFleetspaceAccountRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _fleetspaceAccountResourceFleetspaceAccountRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new FleetspaceAccountResource(Client, FleetspaceAccountResourceData.DeserializeFleetspaceAccountResourceData(e)), _fleetspaceAccountResourceFleetspaceAccountClientDiagnostics, Pipeline, "FleetspaceAccountResourceCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Lists all the fleetspaces accounts under a fleetspace. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/fleets/{fleetName}/fleetspaces/{fleetspaceName}/fleetspaceAccounts + /// + /// + /// Operation Id + /// FleetspaceAccount_List + /// + /// + /// Default Api Version + /// 2025-05-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetAll(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _fleetspaceAccountResourceFleetspaceAccountRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _fleetspaceAccountResourceFleetspaceAccountRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new FleetspaceAccountResource(Client, FleetspaceAccountResourceData.DeserializeFleetspaceAccountResourceData(e)), _fleetspaceAccountResourceFleetspaceAccountClientDiagnostics, Pipeline, "FleetspaceAccountResourceCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/fleets/{fleetName}/fleetspaces/{fleetspaceName}/fleetspaceAccounts/{fleetspaceAccountName} + /// + /// + /// Operation Id + /// FleetspaceAccount_Get + /// + /// + /// Default Api Version + /// 2025-05-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Cosmos DB fleetspace account name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> ExistsAsync(string fleetspaceAccountName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(fleetspaceAccountName, nameof(fleetspaceAccountName)); + + using var scope = _fleetspaceAccountResourceFleetspaceAccountClientDiagnostics.CreateScope("FleetspaceAccountResourceCollection.Exists"); + scope.Start(); + try + { + var response = await _fleetspaceAccountResourceFleetspaceAccountRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, fleetspaceAccountName, cancellationToken: cancellationToken).ConfigureAwait(false); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/fleets/{fleetName}/fleetspaces/{fleetspaceName}/fleetspaceAccounts/{fleetspaceAccountName} + /// + /// + /// Operation Id + /// FleetspaceAccount_Get + /// + /// + /// Default Api Version + /// 2025-05-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Cosmos DB fleetspace account name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Exists(string fleetspaceAccountName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(fleetspaceAccountName, nameof(fleetspaceAccountName)); + + using var scope = _fleetspaceAccountResourceFleetspaceAccountClientDiagnostics.CreateScope("FleetspaceAccountResourceCollection.Exists"); + scope.Start(); + try + { + var response = _fleetspaceAccountResourceFleetspaceAccountRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, fleetspaceAccountName, cancellationToken: cancellationToken); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/fleets/{fleetName}/fleetspaces/{fleetspaceName}/fleetspaceAccounts/{fleetspaceAccountName} + /// + /// + /// Operation Id + /// FleetspaceAccount_Get + /// + /// + /// Default Api Version + /// 2025-05-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Cosmos DB fleetspace account name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetIfExistsAsync(string fleetspaceAccountName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(fleetspaceAccountName, nameof(fleetspaceAccountName)); + + using var scope = _fleetspaceAccountResourceFleetspaceAccountClientDiagnostics.CreateScope("FleetspaceAccountResourceCollection.GetIfExists"); + scope.Start(); + try + { + var response = await _fleetspaceAccountResourceFleetspaceAccountRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, fleetspaceAccountName, cancellationToken: cancellationToken).ConfigureAwait(false); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new FleetspaceAccountResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/fleets/{fleetName}/fleetspaces/{fleetspaceName}/fleetspaceAccounts/{fleetspaceAccountName} + /// + /// + /// Operation Id + /// FleetspaceAccount_Get + /// + /// + /// Default Api Version + /// 2025-05-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Cosmos DB fleetspace account name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual NullableResponse GetIfExists(string fleetspaceAccountName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(fleetspaceAccountName, nameof(fleetspaceAccountName)); + + using var scope = _fleetspaceAccountResourceFleetspaceAccountClientDiagnostics.CreateScope("FleetspaceAccountResourceCollection.GetIfExists"); + scope.Start(); + try + { + var response = _fleetspaceAccountResourceFleetspaceAccountRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, fleetspaceAccountName, cancellationToken: cancellationToken); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new FleetspaceAccountResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetAll().GetEnumerator(); + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetAll().GetEnumerator(); + } + + IAsyncEnumerator IAsyncEnumerable.GetAsyncEnumerator(CancellationToken cancellationToken) + { + return GetAllAsync(cancellationToken: cancellationToken).GetAsyncEnumerator(cancellationToken); + } + } +} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/FleetspaceAccountResourceData.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/FleetspaceAccountResourceData.Serialization.cs new file mode 100644 index 000000000000..5c4e15aaa43b --- /dev/null +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/FleetspaceAccountResourceData.Serialization.cs @@ -0,0 +1,329 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text; +using System.Text.Json; +using Azure.Core; +using Azure.ResourceManager.CosmosDB.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.CosmosDB +{ + public partial class FleetspaceAccountResourceData : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(FleetspaceAccountResourceData)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + writer.WritePropertyName("properties"u8); + writer.WriteStartObject(); + if (Optional.IsDefined(ProvisioningState)) + { + writer.WritePropertyName("provisioningState"u8); + writer.WriteStringValue(ProvisioningState.Value.ToString()); + } + if (Optional.IsDefined(AccountResourceIdentifier)) + { + writer.WritePropertyName("accountResourceIdentifier"u8); + writer.WriteStringValue(AccountResourceIdentifier); + } + if (Optional.IsDefined(AccountLocation)) + { + writer.WritePropertyName("accountLocation"u8); + writer.WriteStringValue(AccountLocation); + } + writer.WriteEndObject(); + } + + FleetspaceAccountResourceData 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(FleetspaceAccountResourceData)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeFleetspaceAccountResourceData(document.RootElement, options); + } + + internal static FleetspaceAccountResourceData DeserializeFleetspaceAccountResourceData(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ResourceIdentifier id = default; + string name = default; + ResourceType type = default; + SystemData systemData = default; + CosmosDBStatus? provisioningState = default; + string accountResourceIdentifier = default; + string accountLocation = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("id"u8)) + { + id = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("type"u8)) + { + type = new ResourceType(property.Value.GetString()); + continue; + } + if (property.NameEquals("systemData"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + systemData = JsonSerializer.Deserialize(property.Value.GetRawText()); + continue; + } + if (property.NameEquals("properties"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + foreach (var property0 in property.Value.EnumerateObject()) + { + if (property0.NameEquals("provisioningState"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + provisioningState = new CosmosDBStatus(property0.Value.GetString()); + continue; + } + if (property0.NameEquals("accountResourceIdentifier"u8)) + { + accountResourceIdentifier = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("accountLocation"u8)) + { + accountLocation = property0.Value.GetString(); + continue; + } + } + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new FleetspaceAccountResourceData( + id, + name, + type, + systemData, + provisioningState, + accountResourceIdentifier, + accountLocation, + serializedAdditionalRawData); + } + + private BinaryData SerializeBicep(ModelReaderWriterOptions options) + { + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Name), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" name: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Name)) + { + builder.Append(" name: "); + if (Name.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{Name}'''"); + } + else + { + builder.AppendLine($"'{Name}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Id), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" id: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Id)) + { + builder.Append(" id: "); + builder.AppendLine($"'{Id.ToString()}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(SystemData), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" systemData: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(SystemData)) + { + builder.Append(" systemData: "); + builder.AppendLine($"'{SystemData.ToString()}'"); + } + } + + builder.Append(" properties:"); + builder.AppendLine(" {"); + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(ProvisioningState), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" provisioningState: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(ProvisioningState)) + { + builder.Append(" provisioningState: "); + builder.AppendLine($"'{ProvisioningState.Value.ToString()}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(AccountResourceIdentifier), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" accountResourceIdentifier: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(AccountResourceIdentifier)) + { + builder.Append(" accountResourceIdentifier: "); + if (AccountResourceIdentifier.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{AccountResourceIdentifier}'''"); + } + else + { + builder.AppendLine($"'{AccountResourceIdentifier}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(AccountLocation), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" accountLocation: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(AccountLocation)) + { + builder.Append(" accountLocation: "); + if (AccountLocation.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{AccountLocation}'''"); + } + else + { + builder.AppendLine($"'{AccountLocation}'"); + } + } + } + + builder.AppendLine(" }"); + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + case "bicep": + return SerializeBicep(options); + default: + throw new FormatException($"The model {nameof(FleetspaceAccountResourceData)} does not support writing '{options.Format}' format."); + } + } + + FleetspaceAccountResourceData 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 DeserializeFleetspaceAccountResourceData(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(FleetspaceAccountResourceData)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/FleetspaceAccountResourceData.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/FleetspaceAccountResourceData.cs new file mode 100644 index 000000000000..7a9c618b449a --- /dev/null +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/FleetspaceAccountResourceData.cs @@ -0,0 +1,86 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; +using Azure.ResourceManager.CosmosDB.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.CosmosDB +{ + /// + /// A class representing the FleetspaceAccountResource data model. + /// An Azure Cosmos DB Fleetspace Account + /// + public partial class FleetspaceAccountResourceData : ResourceData + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public FleetspaceAccountResourceData() + { + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// A provisioning state of the Fleetspace Account. + /// The resource identifier of global database account in the Fleetspace Account. + /// The location of global database account in the Fleetspace Account. + /// Keeps track of any properties unknown to the library. + internal FleetspaceAccountResourceData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, CosmosDBStatus? provisioningState, string accountResourceIdentifier, string accountLocation, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) + { + ProvisioningState = provisioningState; + AccountResourceIdentifier = accountResourceIdentifier; + AccountLocation = accountLocation; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// A provisioning state of the Fleetspace Account. + [WirePath("properties.provisioningState")] + public CosmosDBStatus? ProvisioningState { get; set; } + /// The resource identifier of global database account in the Fleetspace Account. + [WirePath("properties.accountResourceIdentifier")] + public string AccountResourceIdentifier { get; set; } + /// The location of global database account in the Fleetspace Account. + [WirePath("properties.accountLocation")] + public string AccountLocation { get; set; } + } +} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/FleetspaceResource.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/FleetspaceResource.Serialization.cs new file mode 100644 index 000000000000..07e9beabc50a --- /dev/null +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/FleetspaceResource.Serialization.cs @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; + +namespace Azure.ResourceManager.CosmosDB +{ + public partial class FleetspaceResource : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); + + FleetspaceResourceData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options); + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options); + + FleetspaceResourceData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options); + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)Data).GetFormatFromOptions(options); + } +} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/FleetspaceResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/FleetspaceResource.cs new file mode 100644 index 000000000000..f6a9734f52be --- /dev/null +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/FleetspaceResource.cs @@ -0,0 +1,417 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.CosmosDB.Models; + +namespace Azure.ResourceManager.CosmosDB +{ + /// + /// A Class representing a FleetspaceResource along with the instance operations that can be performed on it. + /// If you have a you can construct a + /// from an instance of using the GetFleetspaceResource method. + /// Otherwise you can get one from its parent resource using the GetFleetspaceResource method. + /// + public partial class FleetspaceResource : ArmResource + { + /// Generate the resource identifier of a instance. + /// The subscriptionId. + /// The resourceGroupName. + /// The fleetName. + /// The fleetspaceName. + public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string fleetName, string fleetspaceName) + { + var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/fleets/{fleetName}/fleetspaces/{fleetspaceName}"; + return new ResourceIdentifier(resourceId); + } + + private readonly ClientDiagnostics _fleetspaceResourceFleetspaceClientDiagnostics; + private readonly FleetspaceRestOperations _fleetspaceResourceFleetspaceRestClient; + private readonly FleetspaceResourceData _data; + + /// Gets the resource type for the operations. + public static readonly ResourceType ResourceType = "Microsoft.DocumentDB/fleets/fleetspaces"; + + /// Initializes a new instance of the class for mocking. + protected FleetspaceResource() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The resource that is the target of operations. + internal FleetspaceResource(ArmClient client, FleetspaceResourceData data) : this(client, data.Id) + { + HasData = true; + _data = data; + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The identifier of the resource that is the target of operations. + internal FleetspaceResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _fleetspaceResourceFleetspaceClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.CosmosDB", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string fleetspaceResourceFleetspaceApiVersion); + _fleetspaceResourceFleetspaceRestClient = new FleetspaceRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, fleetspaceResourceFleetspaceApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + /// Gets whether or not the current instance has data. + public virtual bool HasData { get; } + + /// Gets the data representing this Feature. + /// Throws if there is no data loaded in the current instance. + public virtual FleetspaceResourceData Data + { + get + { + if (!HasData) + throw new InvalidOperationException("The current instance does not have data, you must call Get first."); + return _data; + } + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceType), nameof(id)); + } + + /// Gets a collection of FleetspaceAccountResources in the FleetspaceResource. + /// An object representing collection of FleetspaceAccountResources and their operations over a FleetspaceAccountResource. + public virtual FleetspaceAccountResourceCollection GetFleetspaceAccountResources() + { + return GetCachedClient(client => new FleetspaceAccountResourceCollection(client, Id)); + } + + /// + /// Retrieves the properties of an existing Azure Cosmos DB fleetspace account under a fleetspace + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/fleets/{fleetName}/fleetspaces/{fleetspaceName}/fleetspaceAccounts/{fleetspaceAccountName} + /// + /// + /// Operation Id + /// FleetspaceAccount_Get + /// + /// + /// Default Api Version + /// 2025-05-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Cosmos DB fleetspace account name. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetFleetspaceAccountResourceAsync(string fleetspaceAccountName, CancellationToken cancellationToken = default) + { + return await GetFleetspaceAccountResources().GetAsync(fleetspaceAccountName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Retrieves the properties of an existing Azure Cosmos DB fleetspace account under a fleetspace + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/fleets/{fleetName}/fleetspaces/{fleetspaceName}/fleetspaceAccounts/{fleetspaceAccountName} + /// + /// + /// Operation Id + /// FleetspaceAccount_Get + /// + /// + /// Default Api Version + /// 2025-05-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Cosmos DB fleetspace account name. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetFleetspaceAccountResource(string fleetspaceAccountName, CancellationToken cancellationToken = default) + { + return GetFleetspaceAccountResources().Get(fleetspaceAccountName, cancellationToken); + } + + /// + /// Retrieves the properties of an existing Azure Cosmos DB fleetspace under a fleet + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/fleets/{fleetName}/fleetspaces/{fleetspaceName} + /// + /// + /// Operation Id + /// Fleetspace_Get + /// + /// + /// Default Api Version + /// 2025-05-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + { + using var scope = _fleetspaceResourceFleetspaceClientDiagnostics.CreateScope("FleetspaceResource.Get"); + scope.Start(); + try + { + var response = await _fleetspaceResourceFleetspaceRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new FleetspaceResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Retrieves the properties of an existing Azure Cosmos DB fleetspace under a fleet + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/fleets/{fleetName}/fleetspaces/{fleetspaceName} + /// + /// + /// Operation Id + /// Fleetspace_Get + /// + /// + /// Default Api Version + /// 2025-05-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual Response Get(CancellationToken cancellationToken = default) + { + using var scope = _fleetspaceResourceFleetspaceClientDiagnostics.CreateScope("FleetspaceResource.Get"); + scope.Start(); + try + { + var response = _fleetspaceResourceFleetspaceRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new FleetspaceResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Deletes an existing Azure Cosmos DB Fleetspace. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/fleets/{fleetName}/fleetspaces/{fleetspaceName} + /// + /// + /// Operation Id + /// Fleetspace_Delete + /// + /// + /// Default Api Version + /// 2025-05-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The cancellation token to use. + public virtual async Task DeleteAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default) + { + using var scope = _fleetspaceResourceFleetspaceClientDiagnostics.CreateScope("FleetspaceResource.Delete"); + scope.Start(); + try + { + var response = await _fleetspaceResourceFleetspaceRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + var operation = new CosmosDBArmOperation(_fleetspaceResourceFleetspaceClientDiagnostics, Pipeline, _fleetspaceResourceFleetspaceRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Deletes an existing Azure Cosmos DB Fleetspace. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/fleets/{fleetName}/fleetspaces/{fleetspaceName} + /// + /// + /// Operation Id + /// Fleetspace_Delete + /// + /// + /// Default Api Version + /// 2025-05-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The cancellation token to use. + public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancellationToken = default) + { + using var scope = _fleetspaceResourceFleetspaceClientDiagnostics.CreateScope("FleetspaceResource.Delete"); + scope.Start(); + try + { + var response = _fleetspaceResourceFleetspaceRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + var operation = new CosmosDBArmOperation(_fleetspaceResourceFleetspaceClientDiagnostics, Pipeline, _fleetspaceResourceFleetspaceRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletionResponse(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Update the properties of an existing Azure Cosmos DB fleetspace under a fleet. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/fleets/{fleetName}/fleetspaces/{fleetspaceName} + /// + /// + /// Operation Id + /// Fleetspace_Update + /// + /// + /// Default Api Version + /// 2025-05-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The parameters to provide for the current fleetspace. + /// The cancellation token to use. + /// is null. + public virtual async Task> UpdateAsync(WaitUntil waitUntil, FleetspaceResourcePatch patch, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(patch, nameof(patch)); + + using var scope = _fleetspaceResourceFleetspaceClientDiagnostics.CreateScope("FleetspaceResource.Update"); + scope.Start(); + try + { + var response = await _fleetspaceResourceFleetspaceRestClient.UpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, patch, cancellationToken).ConfigureAwait(false); + var operation = new CosmosDBArmOperation(new FleetspaceResourceOperationSource(Client), _fleetspaceResourceFleetspaceClientDiagnostics, Pipeline, _fleetspaceResourceFleetspaceRestClient.CreateUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, patch).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Update the properties of an existing Azure Cosmos DB fleetspace under a fleet. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/fleets/{fleetName}/fleetspaces/{fleetspaceName} + /// + /// + /// Operation Id + /// Fleetspace_Update + /// + /// + /// Default Api Version + /// 2025-05-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The parameters to provide for the current fleetspace. + /// The cancellation token to use. + /// is null. + public virtual ArmOperation Update(WaitUntil waitUntil, FleetspaceResourcePatch patch, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(patch, nameof(patch)); + + using var scope = _fleetspaceResourceFleetspaceClientDiagnostics.CreateScope("FleetspaceResource.Update"); + scope.Start(); + try + { + var response = _fleetspaceResourceFleetspaceRestClient.Update(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, patch, cancellationToken); + var operation = new CosmosDBArmOperation(new FleetspaceResourceOperationSource(Client), _fleetspaceResourceFleetspaceClientDiagnostics, Pipeline, _fleetspaceResourceFleetspaceRestClient.CreateUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, patch).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/FleetspaceResourceCollection.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/FleetspaceResourceCollection.cs new file mode 100644 index 000000000000..016d369c3fd9 --- /dev/null +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/FleetspaceResourceCollection.cs @@ -0,0 +1,493 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Autorest.CSharp.Core; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.CosmosDB +{ + /// + /// A class representing a collection of and their operations. + /// Each in the collection will belong to the same instance of . + /// To get a instance call the GetFleetspaceResources method from an instance of . + /// + public partial class FleetspaceResourceCollection : ArmCollection, IEnumerable, IAsyncEnumerable + { + private readonly ClientDiagnostics _fleetspaceResourceFleetspaceClientDiagnostics; + private readonly FleetspaceRestOperations _fleetspaceResourceFleetspaceRestClient; + + /// Initializes a new instance of the class for mocking. + protected FleetspaceResourceCollection() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The identifier of the parent resource that is the target of operations. + internal FleetspaceResourceCollection(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _fleetspaceResourceFleetspaceClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.CosmosDB", FleetspaceResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(FleetspaceResource.ResourceType, out string fleetspaceResourceFleetspaceApiVersion); + _fleetspaceResourceFleetspaceRestClient = new FleetspaceRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, fleetspaceResourceFleetspaceApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != FleetResource.ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, FleetResource.ResourceType), nameof(id)); + } + + /// + /// Creates an Azure Cosmos DB fleetspace under a fleet. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/fleets/{fleetName}/fleetspaces/{fleetspaceName} + /// + /// + /// Operation Id + /// Fleetspace_Create + /// + /// + /// Default Api Version + /// 2025-05-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// Cosmos DB fleetspace name. Needs to be unique under a fleet. + /// The parameters to provide for the current fleetspace. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// or is null. + public virtual async Task> CreateOrUpdateAsync(WaitUntil waitUntil, string fleetspaceName, FleetspaceResourceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(fleetspaceName, nameof(fleetspaceName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _fleetspaceResourceFleetspaceClientDiagnostics.CreateScope("FleetspaceResourceCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = await _fleetspaceResourceFleetspaceRestClient.CreateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, fleetspaceName, data, cancellationToken).ConfigureAwait(false); + var operation = new CosmosDBArmOperation(new FleetspaceResourceOperationSource(Client), _fleetspaceResourceFleetspaceClientDiagnostics, Pipeline, _fleetspaceResourceFleetspaceRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, fleetspaceName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Creates an Azure Cosmos DB fleetspace under a fleet. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/fleets/{fleetName}/fleetspaces/{fleetspaceName} + /// + /// + /// Operation Id + /// Fleetspace_Create + /// + /// + /// Default Api Version + /// 2025-05-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// Cosmos DB fleetspace name. Needs to be unique under a fleet. + /// The parameters to provide for the current fleetspace. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// or is null. + public virtual ArmOperation CreateOrUpdate(WaitUntil waitUntil, string fleetspaceName, FleetspaceResourceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(fleetspaceName, nameof(fleetspaceName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _fleetspaceResourceFleetspaceClientDiagnostics.CreateScope("FleetspaceResourceCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = _fleetspaceResourceFleetspaceRestClient.Create(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, fleetspaceName, data, cancellationToken); + var operation = new CosmosDBArmOperation(new FleetspaceResourceOperationSource(Client), _fleetspaceResourceFleetspaceClientDiagnostics, Pipeline, _fleetspaceResourceFleetspaceRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, fleetspaceName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Retrieves the properties of an existing Azure Cosmos DB fleetspace under a fleet + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/fleets/{fleetName}/fleetspaces/{fleetspaceName} + /// + /// + /// Operation Id + /// Fleetspace_Get + /// + /// + /// Default Api Version + /// 2025-05-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Cosmos DB fleetspace name. Needs to be unique under a fleet. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetAsync(string fleetspaceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(fleetspaceName, nameof(fleetspaceName)); + + using var scope = _fleetspaceResourceFleetspaceClientDiagnostics.CreateScope("FleetspaceResourceCollection.Get"); + scope.Start(); + try + { + var response = await _fleetspaceResourceFleetspaceRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, fleetspaceName, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new FleetspaceResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Retrieves the properties of an existing Azure Cosmos DB fleetspace under a fleet + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/fleets/{fleetName}/fleetspaces/{fleetspaceName} + /// + /// + /// Operation Id + /// Fleetspace_Get + /// + /// + /// Default Api Version + /// 2025-05-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Cosmos DB fleetspace name. Needs to be unique under a fleet. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Get(string fleetspaceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(fleetspaceName, nameof(fleetspaceName)); + + using var scope = _fleetspaceResourceFleetspaceClientDiagnostics.CreateScope("FleetspaceResourceCollection.Get"); + scope.Start(); + try + { + var response = _fleetspaceResourceFleetspaceRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, fleetspaceName, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new FleetspaceResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Lists all the fleetspaces under a fleet. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/fleets/{fleetName}/fleetspaces + /// + /// + /// Operation Id + /// Fleetspace_List + /// + /// + /// Default Api Version + /// 2025-05-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetAllAsync(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _fleetspaceResourceFleetspaceRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _fleetspaceResourceFleetspaceRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new FleetspaceResource(Client, FleetspaceResourceData.DeserializeFleetspaceResourceData(e)), _fleetspaceResourceFleetspaceClientDiagnostics, Pipeline, "FleetspaceResourceCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Lists all the fleetspaces under a fleet. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/fleets/{fleetName}/fleetspaces + /// + /// + /// Operation Id + /// Fleetspace_List + /// + /// + /// Default Api Version + /// 2025-05-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetAll(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _fleetspaceResourceFleetspaceRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _fleetspaceResourceFleetspaceRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new FleetspaceResource(Client, FleetspaceResourceData.DeserializeFleetspaceResourceData(e)), _fleetspaceResourceFleetspaceClientDiagnostics, Pipeline, "FleetspaceResourceCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/fleets/{fleetName}/fleetspaces/{fleetspaceName} + /// + /// + /// Operation Id + /// Fleetspace_Get + /// + /// + /// Default Api Version + /// 2025-05-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Cosmos DB fleetspace name. Needs to be unique under a fleet. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> ExistsAsync(string fleetspaceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(fleetspaceName, nameof(fleetspaceName)); + + using var scope = _fleetspaceResourceFleetspaceClientDiagnostics.CreateScope("FleetspaceResourceCollection.Exists"); + scope.Start(); + try + { + var response = await _fleetspaceResourceFleetspaceRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, fleetspaceName, cancellationToken: cancellationToken).ConfigureAwait(false); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/fleets/{fleetName}/fleetspaces/{fleetspaceName} + /// + /// + /// Operation Id + /// Fleetspace_Get + /// + /// + /// Default Api Version + /// 2025-05-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Cosmos DB fleetspace name. Needs to be unique under a fleet. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Exists(string fleetspaceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(fleetspaceName, nameof(fleetspaceName)); + + using var scope = _fleetspaceResourceFleetspaceClientDiagnostics.CreateScope("FleetspaceResourceCollection.Exists"); + scope.Start(); + try + { + var response = _fleetspaceResourceFleetspaceRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, fleetspaceName, cancellationToken: cancellationToken); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/fleets/{fleetName}/fleetspaces/{fleetspaceName} + /// + /// + /// Operation Id + /// Fleetspace_Get + /// + /// + /// Default Api Version + /// 2025-05-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Cosmos DB fleetspace name. Needs to be unique under a fleet. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetIfExistsAsync(string fleetspaceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(fleetspaceName, nameof(fleetspaceName)); + + using var scope = _fleetspaceResourceFleetspaceClientDiagnostics.CreateScope("FleetspaceResourceCollection.GetIfExists"); + scope.Start(); + try + { + var response = await _fleetspaceResourceFleetspaceRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, fleetspaceName, cancellationToken: cancellationToken).ConfigureAwait(false); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new FleetspaceResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/fleets/{fleetName}/fleetspaces/{fleetspaceName} + /// + /// + /// Operation Id + /// Fleetspace_Get + /// + /// + /// Default Api Version + /// 2025-05-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Cosmos DB fleetspace name. Needs to be unique under a fleet. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual NullableResponse GetIfExists(string fleetspaceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(fleetspaceName, nameof(fleetspaceName)); + + using var scope = _fleetspaceResourceFleetspaceClientDiagnostics.CreateScope("FleetspaceResourceCollection.GetIfExists"); + scope.Start(); + try + { + var response = _fleetspaceResourceFleetspaceRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, fleetspaceName, cancellationToken: cancellationToken); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new FleetspaceResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetAll().GetEnumerator(); + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetAll().GetEnumerator(); + } + + IAsyncEnumerator IAsyncEnumerable.GetAsyncEnumerator(CancellationToken cancellationToken) + { + return GetAllAsync(cancellationToken: cancellationToken).GetAsyncEnumerator(cancellationToken); + } + } +} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/FleetspaceResourceData.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/FleetspaceResourceData.Serialization.cs new file mode 100644 index 000000000000..7e67032a520f --- /dev/null +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/FleetspaceResourceData.Serialization.cs @@ -0,0 +1,321 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text; +using System.Text.Json; +using Azure.Core; +using Azure.ResourceManager.CosmosDB.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.CosmosDB +{ + public partial class FleetspaceResourceData : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(FleetspaceResourceData)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + writer.WritePropertyName("properties"u8); + writer.WriteStartObject(); + if (Optional.IsDefined(ProvisioningState)) + { + writer.WritePropertyName("provisioningState"u8); + writer.WriteStringValue(ProvisioningState.Value.ToString()); + } + if (Optional.IsDefined(FleetspaceApiKind)) + { + writer.WritePropertyName("fleetspaceApiKind"u8); + writer.WriteStringValue(FleetspaceApiKind.Value.ToString()); + } + if (Optional.IsDefined(ThroughputPoolConfiguration)) + { + writer.WritePropertyName("throughputPoolConfiguration"u8); + writer.WriteObjectValue(ThroughputPoolConfiguration, options); + } + writer.WriteEndObject(); + } + + FleetspaceResourceData 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(FleetspaceResourceData)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeFleetspaceResourceData(document.RootElement, options); + } + + internal static FleetspaceResourceData DeserializeFleetspaceResourceData(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ResourceIdentifier id = default; + string name = default; + ResourceType type = default; + SystemData systemData = default; + CosmosDBStatus? provisioningState = default; + FleetspacePropertiesFleetspaceApiKind? fleetspaceApiKind = default; + FleetspacePropertiesThroughputPoolConfiguration throughputPoolConfiguration = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("id"u8)) + { + id = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("type"u8)) + { + type = new ResourceType(property.Value.GetString()); + continue; + } + if (property.NameEquals("systemData"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + systemData = JsonSerializer.Deserialize(property.Value.GetRawText()); + continue; + } + if (property.NameEquals("properties"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + foreach (var property0 in property.Value.EnumerateObject()) + { + if (property0.NameEquals("provisioningState"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + provisioningState = new CosmosDBStatus(property0.Value.GetString()); + continue; + } + if (property0.NameEquals("fleetspaceApiKind"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + fleetspaceApiKind = new FleetspacePropertiesFleetspaceApiKind(property0.Value.GetString()); + continue; + } + if (property0.NameEquals("throughputPoolConfiguration"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + throughputPoolConfiguration = FleetspacePropertiesThroughputPoolConfiguration.DeserializeFleetspacePropertiesThroughputPoolConfiguration(property0.Value, options); + continue; + } + } + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new FleetspaceResourceData( + id, + name, + type, + systemData, + provisioningState, + fleetspaceApiKind, + throughputPoolConfiguration, + serializedAdditionalRawData); + } + + private BinaryData SerializeBicep(ModelReaderWriterOptions options) + { + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Name), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" name: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Name)) + { + builder.Append(" name: "); + if (Name.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{Name}'''"); + } + else + { + builder.AppendLine($"'{Name}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Id), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" id: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Id)) + { + builder.Append(" id: "); + builder.AppendLine($"'{Id.ToString()}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(SystemData), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" systemData: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(SystemData)) + { + builder.Append(" systemData: "); + builder.AppendLine($"'{SystemData.ToString()}'"); + } + } + + builder.Append(" properties:"); + builder.AppendLine(" {"); + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(ProvisioningState), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" provisioningState: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(ProvisioningState)) + { + builder.Append(" provisioningState: "); + builder.AppendLine($"'{ProvisioningState.Value.ToString()}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(FleetspaceApiKind), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" fleetspaceApiKind: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(FleetspaceApiKind)) + { + builder.Append(" fleetspaceApiKind: "); + builder.AppendLine($"'{FleetspaceApiKind.Value.ToString()}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(ThroughputPoolConfiguration), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" throughputPoolConfiguration: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(ThroughputPoolConfiguration)) + { + builder.Append(" throughputPoolConfiguration: "); + BicepSerializationHelpers.AppendChildObject(builder, ThroughputPoolConfiguration, options, 4, false, " throughputPoolConfiguration: "); + } + } + + builder.AppendLine(" }"); + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + case "bicep": + return SerializeBicep(options); + default: + throw new FormatException($"The model {nameof(FleetspaceResourceData)} does not support writing '{options.Format}' format."); + } + } + + FleetspaceResourceData 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 DeserializeFleetspaceResourceData(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(FleetspaceResourceData)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/FleetspaceResourceData.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/FleetspaceResourceData.cs new file mode 100644 index 000000000000..26384703d139 --- /dev/null +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/FleetspaceResourceData.cs @@ -0,0 +1,86 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; +using Azure.ResourceManager.CosmosDB.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.CosmosDB +{ + /// + /// A class representing the FleetspaceResource data model. + /// An Azure Cosmos DB Fleetspace. + /// + public partial class FleetspaceResourceData : ResourceData + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public FleetspaceResourceData() + { + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// A provisioning state of the Fleetspace. + /// The kind of API this fleetspace belongs to. Acceptable values: 'NoSQL'. + /// Configuration for throughput pool in the fleetspace. + /// Keeps track of any properties unknown to the library. + internal FleetspaceResourceData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, CosmosDBStatus? provisioningState, FleetspacePropertiesFleetspaceApiKind? fleetspaceApiKind, FleetspacePropertiesThroughputPoolConfiguration throughputPoolConfiguration, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) + { + ProvisioningState = provisioningState; + FleetspaceApiKind = fleetspaceApiKind; + ThroughputPoolConfiguration = throughputPoolConfiguration; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// A provisioning state of the Fleetspace. + [WirePath("properties.provisioningState")] + public CosmosDBStatus? ProvisioningState { get; set; } + /// The kind of API this fleetspace belongs to. Acceptable values: 'NoSQL'. + [WirePath("properties.fleetspaceApiKind")] + public FleetspacePropertiesFleetspaceApiKind? FleetspaceApiKind { get; set; } + /// Configuration for throughput pool in the fleetspace. + [WirePath("properties.throughputPoolConfiguration")] + public FleetspacePropertiesThroughputPoolConfiguration ThroughputPoolConfiguration { get; set; } + } +} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/GraphResourceGetResultCollection.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/GraphResourceGetResultCollection.cs index 1c085fec0690..b1aa3ea193c9 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/GraphResourceGetResultCollection.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/GraphResourceGetResultCollection.cs @@ -65,7 +65,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -114,7 +114,7 @@ public virtual async Task> CreateOr /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -163,7 +163,7 @@ public virtual ArmOperation CreateOrUpdate(WaitU /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -208,7 +208,7 @@ public virtual async Task> GetAsync(str /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -253,7 +253,7 @@ public virtual Response Get(string graphName, Ca /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -282,7 +282,7 @@ public virtual AsyncPageable GetAllAsync(Cancell /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -311,7 +311,7 @@ public virtual Pageable GetAll(CancellationToken /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -354,7 +354,7 @@ public virtual async Task> ExistsAsync(string graphName, Cancella /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -397,7 +397,7 @@ public virtual Response Exists(string graphName, CancellationToken cancell /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -442,7 +442,7 @@ public virtual async Task> GetI /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/GraphResourceGetResultResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/GraphResourceGetResultResource.cs index 01d1e63a7df7..7e1832f62fc6 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/GraphResourceGetResultResource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/GraphResourceGetResultResource.cs @@ -103,7 +103,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -143,7 +143,7 @@ public virtual async Task> GetAsync(Can /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -183,7 +183,7 @@ public virtual Response Get(CancellationToken ca /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -225,7 +225,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -267,7 +267,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -313,7 +313,7 @@ public virtual async Task> UpdateAs /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -359,7 +359,7 @@ public virtual ArmOperation Update(WaitUntil wai /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -421,7 +421,7 @@ public virtual async Task> AddTagAsync( /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -483,7 +483,7 @@ public virtual Response AddTag(string key, strin /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -540,7 +540,7 @@ public virtual async Task> SetTagsAsync /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -597,7 +597,7 @@ public virtual Response SetTags(IDictionary /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -657,7 +657,7 @@ public virtual async Task> RemoveTagAsy /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/GremlinDatabaseCollection.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/GremlinDatabaseCollection.cs index d952dcb00519..7faeae64a110 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/GremlinDatabaseCollection.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/GremlinDatabaseCollection.cs @@ -65,7 +65,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -114,7 +114,7 @@ public virtual async Task> CreateOrUpdateA /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -163,7 +163,7 @@ public virtual ArmOperation CreateOrUpdate(WaitUntil wa /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -208,7 +208,7 @@ public virtual async Task> GetAsync(string dat /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -253,7 +253,7 @@ public virtual Response Get(string databaseName, Cancel /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -282,7 +282,7 @@ public virtual AsyncPageable GetAllAsync(CancellationTo /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -311,7 +311,7 @@ public virtual Pageable GetAll(CancellationToken cancel /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -354,7 +354,7 @@ public virtual async Task> ExistsAsync(string databaseName, Cance /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -397,7 +397,7 @@ public virtual Response Exists(string databaseName, CancellationToken canc /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -442,7 +442,7 @@ public virtual async Task> GetIfExists /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/GremlinDatabaseResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/GremlinDatabaseResource.cs index d9025dcb002b..4e1cf1e0a7b4 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/GremlinDatabaseResource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/GremlinDatabaseResource.cs @@ -117,7 +117,7 @@ public virtual GremlinGraphCollection GetGremlinGraphs() /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -148,7 +148,7 @@ public virtual async Task> GetGremlinGraphAsync(s /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -179,7 +179,7 @@ public virtual Response GetGremlinGraph(string graphName, /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -219,7 +219,7 @@ public virtual async Task> GetAsync(Cancellati /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -259,7 +259,7 @@ public virtual Response Get(CancellationToken cancellat /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -301,7 +301,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -343,7 +343,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -389,7 +389,7 @@ public virtual async Task> UpdateAsync(Wai /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -435,7 +435,7 @@ public virtual ArmOperation Update(WaitUntil waitUntil, /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -497,7 +497,7 @@ public virtual async Task> AddTagAsync(string /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -559,7 +559,7 @@ public virtual Response AddTag(string key, string value /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -616,7 +616,7 @@ public virtual async Task> SetTagsAsync(IDicti /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -673,7 +673,7 @@ public virtual Response SetTags(IDictionary /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -733,7 +733,7 @@ public virtual async Task> RemoveTagAsync(stri /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/GremlinDatabaseThroughputSettingResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/GremlinDatabaseThroughputSettingResource.cs index 45aceb445eaa..3b9eb9550927 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/GremlinDatabaseThroughputSettingResource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/GremlinDatabaseThroughputSettingResource.cs @@ -103,7 +103,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -143,7 +143,7 @@ public virtual async Task> Ge /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -183,7 +183,7 @@ public virtual Response Get(Cancellati /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -229,7 +229,7 @@ public virtual async Task /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -275,7 +275,7 @@ public virtual ArmOperation CreateOrUp /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -317,7 +317,7 @@ public virtual async Task /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -359,7 +359,7 @@ public virtual ArmOperation MigrateGre /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -401,7 +401,7 @@ public virtual async Task /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -443,7 +443,7 @@ public virtual ArmOperation MigrateGre /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -505,7 +505,7 @@ public virtual async Task> Ad /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -567,7 +567,7 @@ public virtual Response AddTag(string /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -624,7 +624,7 @@ public virtual async Task> Se /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -681,7 +681,7 @@ public virtual Response SetTags(IDicti /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -741,7 +741,7 @@ public virtual async Task> Re /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/GremlinGraphCollection.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/GremlinGraphCollection.cs index 87814e0c8d3e..43f350722ec1 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/GremlinGraphCollection.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/GremlinGraphCollection.cs @@ -65,7 +65,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -114,7 +114,7 @@ public virtual async Task> CreateOrUpdateAsyn /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -163,7 +163,7 @@ public virtual ArmOperation CreateOrUpdate(WaitUntil waitU /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -208,7 +208,7 @@ public virtual async Task> GetAsync(string graphN /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -253,7 +253,7 @@ public virtual Response Get(string graphName, Cancellation /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -282,7 +282,7 @@ public virtual AsyncPageable GetAllAsync(CancellationToken /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -311,7 +311,7 @@ public virtual Pageable GetAll(CancellationToken cancellat /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -354,7 +354,7 @@ public virtual async Task> ExistsAsync(string graphName, Cancella /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -397,7 +397,7 @@ public virtual Response Exists(string graphName, CancellationToken cancell /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -442,7 +442,7 @@ public virtual async Task> GetIfExistsAsy /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/GremlinGraphResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/GremlinGraphResource.cs index c07e5d380308..e49265e1016b 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/GremlinGraphResource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/GremlinGraphResource.cs @@ -111,7 +111,7 @@ public virtual GremlinGraphThroughputSettingResource GetGremlinGraphThroughputSe /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -151,7 +151,7 @@ public virtual async Task> GetAsync(CancellationT /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -191,7 +191,7 @@ public virtual Response Get(CancellationToken cancellation /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -233,7 +233,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -275,7 +275,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -321,7 +321,7 @@ public virtual async Task> UpdateAsync(WaitUn /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -367,7 +367,7 @@ public virtual ArmOperation Update(WaitUntil waitUntil, Gr /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -413,7 +413,7 @@ public virtual async Task> RetrieveConti /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -459,7 +459,7 @@ public virtual ArmOperation RetrieveContinuousBackupI /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -521,7 +521,7 @@ public virtual async Task> AddTagAsync(string key /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -583,7 +583,7 @@ public virtual Response AddTag(string key, string value, C /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -640,7 +640,7 @@ public virtual async Task> SetTagsAsync(IDictiona /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -697,7 +697,7 @@ public virtual Response SetTags(IDictionary /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -757,7 +757,7 @@ public virtual async Task> RemoveTagAsync(string /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/GremlinGraphThroughputSettingResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/GremlinGraphThroughputSettingResource.cs index 3c4071e263b9..a5cd4cc7e3ca 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/GremlinGraphThroughputSettingResource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/GremlinGraphThroughputSettingResource.cs @@ -104,7 +104,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -144,7 +144,7 @@ public virtual async Task> GetAs /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -184,7 +184,7 @@ public virtual Response Get(CancellationT /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -230,7 +230,7 @@ public virtual async Task> C /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -276,7 +276,7 @@ public virtual ArmOperation CreateOrUpdat /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -318,7 +318,7 @@ public virtual async Task> M /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -360,7 +360,7 @@ public virtual ArmOperation MigrateGremli /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -402,7 +402,7 @@ public virtual async Task> M /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -444,7 +444,7 @@ public virtual ArmOperation MigrateGremli /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -506,7 +506,7 @@ public virtual async Task> AddTa /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -568,7 +568,7 @@ public virtual Response AddTag(string key /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -625,7 +625,7 @@ public virtual async Task> SetTa /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -682,7 +682,7 @@ public virtual Response SetTags(IDictiona /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -742,7 +742,7 @@ public virtual async Task> Remov /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/GremlinRoleAssignmentResource.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/GremlinRoleAssignmentResource.Serialization.cs new file mode 100644 index 000000000000..89f40949e460 --- /dev/null +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/GremlinRoleAssignmentResource.Serialization.cs @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; + +namespace Azure.ResourceManager.CosmosDB +{ + public partial class GremlinRoleAssignmentResource : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); + + GremlinRoleAssignmentResourceData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options); + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options); + + GremlinRoleAssignmentResourceData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options); + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)Data).GetFormatFromOptions(options); + } +} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/GremlinRoleAssignmentResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/GremlinRoleAssignmentResource.cs new file mode 100644 index 000000000000..c7ad3b499841 --- /dev/null +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/GremlinRoleAssignmentResource.cs @@ -0,0 +1,347 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.CosmosDB +{ + /// + /// A Class representing a GremlinRoleAssignmentResource along with the instance operations that can be performed on it. + /// If you have a you can construct a + /// from an instance of using the GetGremlinRoleAssignmentResource method. + /// Otherwise you can get one from its parent resource using the GetGremlinRoleAssignmentResource method. + /// + public partial class GremlinRoleAssignmentResource : ArmResource + { + /// Generate the resource identifier of a instance. + /// The subscriptionId. + /// The resourceGroupName. + /// The accountName. + /// The roleAssignmentId. + public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string accountName, string roleAssignmentId) + { + var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinRoleAssignments/{roleAssignmentId}"; + return new ResourceIdentifier(resourceId); + } + + private readonly ClientDiagnostics _gremlinRoleAssignmentResourceGremlinResourcesClientDiagnostics; + private readonly GremlinResourcesRestOperations _gremlinRoleAssignmentResourceGremlinResourcesRestClient; + private readonly GremlinRoleAssignmentResourceData _data; + + /// Gets the resource type for the operations. + public static readonly ResourceType ResourceType = "Microsoft.DocumentDB/databaseAccounts/gremlinRoleAssignments"; + + /// Initializes a new instance of the class for mocking. + protected GremlinRoleAssignmentResource() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The resource that is the target of operations. + internal GremlinRoleAssignmentResource(ArmClient client, GremlinRoleAssignmentResourceData data) : this(client, data.Id) + { + HasData = true; + _data = data; + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The identifier of the resource that is the target of operations. + internal GremlinRoleAssignmentResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _gremlinRoleAssignmentResourceGremlinResourcesClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.CosmosDB", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string gremlinRoleAssignmentResourceGremlinResourcesApiVersion); + _gremlinRoleAssignmentResourceGremlinResourcesRestClient = new GremlinResourcesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, gremlinRoleAssignmentResourceGremlinResourcesApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + /// Gets whether or not the current instance has data. + public virtual bool HasData { get; } + + /// Gets the data representing this Feature. + /// Throws if there is no data loaded in the current instance. + public virtual GremlinRoleAssignmentResourceData Data + { + get + { + if (!HasData) + throw new InvalidOperationException("The current instance does not have data, you must call Get first."); + return _data; + } + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceType), nameof(id)); + } + + /// + /// Retrieves the properties of an existing Azure Cosmos DB Gremlin Role Assignment with the given Id. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinRoleAssignments/{roleAssignmentId} + /// + /// + /// Operation Id + /// GremlinResources_GetGremlinRoleAssignment + /// + /// + /// Default Api Version + /// 2025-05-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + { + using var scope = _gremlinRoleAssignmentResourceGremlinResourcesClientDiagnostics.CreateScope("GremlinRoleAssignmentResource.Get"); + scope.Start(); + try + { + var response = await _gremlinRoleAssignmentResourceGremlinResourcesRestClient.GetGremlinRoleAssignmentAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new GremlinRoleAssignmentResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Retrieves the properties of an existing Azure Cosmos DB Gremlin Role Assignment with the given Id. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinRoleAssignments/{roleAssignmentId} + /// + /// + /// Operation Id + /// GremlinResources_GetGremlinRoleAssignment + /// + /// + /// Default Api Version + /// 2025-05-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual Response Get(CancellationToken cancellationToken = default) + { + using var scope = _gremlinRoleAssignmentResourceGremlinResourcesClientDiagnostics.CreateScope("GremlinRoleAssignmentResource.Get"); + scope.Start(); + try + { + var response = _gremlinRoleAssignmentResourceGremlinResourcesRestClient.GetGremlinRoleAssignment(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new GremlinRoleAssignmentResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Deletes an existing Azure Cosmos DB Gremlin Role Assignment. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinRoleAssignments/{roleAssignmentId} + /// + /// + /// Operation Id + /// GremlinResources_DeleteGremlinRoleAssignment + /// + /// + /// Default Api Version + /// 2025-05-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The cancellation token to use. + public virtual async Task DeleteAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default) + { + using var scope = _gremlinRoleAssignmentResourceGremlinResourcesClientDiagnostics.CreateScope("GremlinRoleAssignmentResource.Delete"); + scope.Start(); + try + { + var response = await _gremlinRoleAssignmentResourceGremlinResourcesRestClient.DeleteGremlinRoleAssignmentAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + var operation = new CosmosDBArmOperation(_gremlinRoleAssignmentResourceGremlinResourcesClientDiagnostics, Pipeline, _gremlinRoleAssignmentResourceGremlinResourcesRestClient.CreateDeleteGremlinRoleAssignmentRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Deletes an existing Azure Cosmos DB Gremlin Role Assignment. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinRoleAssignments/{roleAssignmentId} + /// + /// + /// Operation Id + /// GremlinResources_DeleteGremlinRoleAssignment + /// + /// + /// Default Api Version + /// 2025-05-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The cancellation token to use. + public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancellationToken = default) + { + using var scope = _gremlinRoleAssignmentResourceGremlinResourcesClientDiagnostics.CreateScope("GremlinRoleAssignmentResource.Delete"); + scope.Start(); + try + { + var response = _gremlinRoleAssignmentResourceGremlinResourcesRestClient.DeleteGremlinRoleAssignment(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + var operation = new CosmosDBArmOperation(_gremlinRoleAssignmentResourceGremlinResourcesClientDiagnostics, Pipeline, _gremlinRoleAssignmentResourceGremlinResourcesRestClient.CreateDeleteGremlinRoleAssignmentRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletionResponse(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Creates or updates an Azure Cosmos DB Gremlin Role Assignment. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinRoleAssignments/{roleAssignmentId} + /// + /// + /// Operation Id + /// GremlinResources_CreateUpdateGremlinRoleAssignment + /// + /// + /// Default Api Version + /// 2025-05-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The properties required to create or update a Role Assignment. + /// The cancellation token to use. + /// is null. + public virtual async Task> UpdateAsync(WaitUntil waitUntil, GremlinRoleAssignmentResourceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _gremlinRoleAssignmentResourceGremlinResourcesClientDiagnostics.CreateScope("GremlinRoleAssignmentResource.Update"); + scope.Start(); + try + { + var response = await _gremlinRoleAssignmentResourceGremlinResourcesRestClient.CreateUpdateGremlinRoleAssignmentAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, cancellationToken).ConfigureAwait(false); + var operation = new CosmosDBArmOperation(new GremlinRoleAssignmentResourceOperationSource(Client), _gremlinRoleAssignmentResourceGremlinResourcesClientDiagnostics, Pipeline, _gremlinRoleAssignmentResourceGremlinResourcesRestClient.CreateCreateUpdateGremlinRoleAssignmentRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Creates or updates an Azure Cosmos DB Gremlin Role Assignment. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinRoleAssignments/{roleAssignmentId} + /// + /// + /// Operation Id + /// GremlinResources_CreateUpdateGremlinRoleAssignment + /// + /// + /// Default Api Version + /// 2025-05-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The properties required to create or update a Role Assignment. + /// The cancellation token to use. + /// is null. + public virtual ArmOperation Update(WaitUntil waitUntil, GremlinRoleAssignmentResourceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _gremlinRoleAssignmentResourceGremlinResourcesClientDiagnostics.CreateScope("GremlinRoleAssignmentResource.Update"); + scope.Start(); + try + { + var response = _gremlinRoleAssignmentResourceGremlinResourcesRestClient.CreateUpdateGremlinRoleAssignment(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, cancellationToken); + var operation = new CosmosDBArmOperation(new GremlinRoleAssignmentResourceOperationSource(Client), _gremlinRoleAssignmentResourceGremlinResourcesClientDiagnostics, Pipeline, _gremlinRoleAssignmentResourceGremlinResourcesRestClient.CreateCreateUpdateGremlinRoleAssignmentRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/GremlinRoleAssignmentResourceCollection.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/GremlinRoleAssignmentResourceCollection.cs new file mode 100644 index 000000000000..599e760913f1 --- /dev/null +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/GremlinRoleAssignmentResourceCollection.cs @@ -0,0 +1,491 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Autorest.CSharp.Core; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.CosmosDB +{ + /// + /// A class representing a collection of and their operations. + /// Each in the collection will belong to the same instance of . + /// To get a instance call the GetGremlinRoleAssignmentResources method from an instance of . + /// + public partial class GremlinRoleAssignmentResourceCollection : ArmCollection, IEnumerable, IAsyncEnumerable + { + private readonly ClientDiagnostics _gremlinRoleAssignmentResourceGremlinResourcesClientDiagnostics; + private readonly GremlinResourcesRestOperations _gremlinRoleAssignmentResourceGremlinResourcesRestClient; + + /// Initializes a new instance of the class for mocking. + protected GremlinRoleAssignmentResourceCollection() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The identifier of the parent resource that is the target of operations. + internal GremlinRoleAssignmentResourceCollection(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _gremlinRoleAssignmentResourceGremlinResourcesClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.CosmosDB", GremlinRoleAssignmentResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(GremlinRoleAssignmentResource.ResourceType, out string gremlinRoleAssignmentResourceGremlinResourcesApiVersion); + _gremlinRoleAssignmentResourceGremlinResourcesRestClient = new GremlinResourcesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, gremlinRoleAssignmentResourceGremlinResourcesApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != CosmosDBAccountResource.ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, CosmosDBAccountResource.ResourceType), nameof(id)); + } + + /// + /// Creates or updates an Azure Cosmos DB Gremlin Role Assignment. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinRoleAssignments/{roleAssignmentId} + /// + /// + /// Operation Id + /// GremlinResources_CreateUpdateGremlinRoleAssignment + /// + /// + /// Default Api Version + /// 2025-05-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The GUID for the Role Assignment. + /// The properties required to create or update a Role Assignment. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// or is null. + public virtual async Task> CreateOrUpdateAsync(WaitUntil waitUntil, string roleAssignmentId, GremlinRoleAssignmentResourceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(roleAssignmentId, nameof(roleAssignmentId)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _gremlinRoleAssignmentResourceGremlinResourcesClientDiagnostics.CreateScope("GremlinRoleAssignmentResourceCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = await _gremlinRoleAssignmentResourceGremlinResourcesRestClient.CreateUpdateGremlinRoleAssignmentAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, roleAssignmentId, data, cancellationToken).ConfigureAwait(false); + var operation = new CosmosDBArmOperation(new GremlinRoleAssignmentResourceOperationSource(Client), _gremlinRoleAssignmentResourceGremlinResourcesClientDiagnostics, Pipeline, _gremlinRoleAssignmentResourceGremlinResourcesRestClient.CreateCreateUpdateGremlinRoleAssignmentRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, roleAssignmentId, data).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Creates or updates an Azure Cosmos DB Gremlin Role Assignment. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinRoleAssignments/{roleAssignmentId} + /// + /// + /// Operation Id + /// GremlinResources_CreateUpdateGremlinRoleAssignment + /// + /// + /// Default Api Version + /// 2025-05-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The GUID for the Role Assignment. + /// The properties required to create or update a Role Assignment. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// or is null. + public virtual ArmOperation CreateOrUpdate(WaitUntil waitUntil, string roleAssignmentId, GremlinRoleAssignmentResourceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(roleAssignmentId, nameof(roleAssignmentId)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _gremlinRoleAssignmentResourceGremlinResourcesClientDiagnostics.CreateScope("GremlinRoleAssignmentResourceCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = _gremlinRoleAssignmentResourceGremlinResourcesRestClient.CreateUpdateGremlinRoleAssignment(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, roleAssignmentId, data, cancellationToken); + var operation = new CosmosDBArmOperation(new GremlinRoleAssignmentResourceOperationSource(Client), _gremlinRoleAssignmentResourceGremlinResourcesClientDiagnostics, Pipeline, _gremlinRoleAssignmentResourceGremlinResourcesRestClient.CreateCreateUpdateGremlinRoleAssignmentRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, roleAssignmentId, data).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Retrieves the properties of an existing Azure Cosmos DB Gremlin Role Assignment with the given Id. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinRoleAssignments/{roleAssignmentId} + /// + /// + /// Operation Id + /// GremlinResources_GetGremlinRoleAssignment + /// + /// + /// Default Api Version + /// 2025-05-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The GUID for the Role Assignment. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetAsync(string roleAssignmentId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(roleAssignmentId, nameof(roleAssignmentId)); + + using var scope = _gremlinRoleAssignmentResourceGremlinResourcesClientDiagnostics.CreateScope("GremlinRoleAssignmentResourceCollection.Get"); + scope.Start(); + try + { + var response = await _gremlinRoleAssignmentResourceGremlinResourcesRestClient.GetGremlinRoleAssignmentAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, roleAssignmentId, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new GremlinRoleAssignmentResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Retrieves the properties of an existing Azure Cosmos DB Gremlin Role Assignment with the given Id. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinRoleAssignments/{roleAssignmentId} + /// + /// + /// Operation Id + /// GremlinResources_GetGremlinRoleAssignment + /// + /// + /// Default Api Version + /// 2025-05-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The GUID for the Role Assignment. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Get(string roleAssignmentId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(roleAssignmentId, nameof(roleAssignmentId)); + + using var scope = _gremlinRoleAssignmentResourceGremlinResourcesClientDiagnostics.CreateScope("GremlinRoleAssignmentResourceCollection.Get"); + scope.Start(); + try + { + var response = _gremlinRoleAssignmentResourceGremlinResourcesRestClient.GetGremlinRoleAssignment(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, roleAssignmentId, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new GremlinRoleAssignmentResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Retrieves the list of all Azure Cosmos DB Gremlin Role Assignments. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinRoleAssignments + /// + /// + /// Operation Id + /// GremlinResources_ListGremlinRoleAssignments + /// + /// + /// Default Api Version + /// 2025-05-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetAllAsync(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _gremlinRoleAssignmentResourceGremlinResourcesRestClient.CreateListGremlinRoleAssignmentsRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, null, e => new GremlinRoleAssignmentResource(Client, GremlinRoleAssignmentResourceData.DeserializeGremlinRoleAssignmentResourceData(e)), _gremlinRoleAssignmentResourceGremlinResourcesClientDiagnostics, Pipeline, "GremlinRoleAssignmentResourceCollection.GetAll", "value", null, cancellationToken); + } + + /// + /// Retrieves the list of all Azure Cosmos DB Gremlin Role Assignments. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinRoleAssignments + /// + /// + /// Operation Id + /// GremlinResources_ListGremlinRoleAssignments + /// + /// + /// Default Api Version + /// 2025-05-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetAll(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _gremlinRoleAssignmentResourceGremlinResourcesRestClient.CreateListGremlinRoleAssignmentsRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, null, e => new GremlinRoleAssignmentResource(Client, GremlinRoleAssignmentResourceData.DeserializeGremlinRoleAssignmentResourceData(e)), _gremlinRoleAssignmentResourceGremlinResourcesClientDiagnostics, Pipeline, "GremlinRoleAssignmentResourceCollection.GetAll", "value", null, cancellationToken); + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinRoleAssignments/{roleAssignmentId} + /// + /// + /// Operation Id + /// GremlinResources_GetGremlinRoleAssignment + /// + /// + /// Default Api Version + /// 2025-05-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The GUID for the Role Assignment. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> ExistsAsync(string roleAssignmentId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(roleAssignmentId, nameof(roleAssignmentId)); + + using var scope = _gremlinRoleAssignmentResourceGremlinResourcesClientDiagnostics.CreateScope("GremlinRoleAssignmentResourceCollection.Exists"); + scope.Start(); + try + { + var response = await _gremlinRoleAssignmentResourceGremlinResourcesRestClient.GetGremlinRoleAssignmentAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, roleAssignmentId, cancellationToken: cancellationToken).ConfigureAwait(false); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinRoleAssignments/{roleAssignmentId} + /// + /// + /// Operation Id + /// GremlinResources_GetGremlinRoleAssignment + /// + /// + /// Default Api Version + /// 2025-05-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The GUID for the Role Assignment. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Exists(string roleAssignmentId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(roleAssignmentId, nameof(roleAssignmentId)); + + using var scope = _gremlinRoleAssignmentResourceGremlinResourcesClientDiagnostics.CreateScope("GremlinRoleAssignmentResourceCollection.Exists"); + scope.Start(); + try + { + var response = _gremlinRoleAssignmentResourceGremlinResourcesRestClient.GetGremlinRoleAssignment(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, roleAssignmentId, cancellationToken: cancellationToken); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinRoleAssignments/{roleAssignmentId} + /// + /// + /// Operation Id + /// GremlinResources_GetGremlinRoleAssignment + /// + /// + /// Default Api Version + /// 2025-05-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The GUID for the Role Assignment. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetIfExistsAsync(string roleAssignmentId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(roleAssignmentId, nameof(roleAssignmentId)); + + using var scope = _gremlinRoleAssignmentResourceGremlinResourcesClientDiagnostics.CreateScope("GremlinRoleAssignmentResourceCollection.GetIfExists"); + scope.Start(); + try + { + var response = await _gremlinRoleAssignmentResourceGremlinResourcesRestClient.GetGremlinRoleAssignmentAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, roleAssignmentId, cancellationToken: cancellationToken).ConfigureAwait(false); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new GremlinRoleAssignmentResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinRoleAssignments/{roleAssignmentId} + /// + /// + /// Operation Id + /// GremlinResources_GetGremlinRoleAssignment + /// + /// + /// Default Api Version + /// 2025-05-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The GUID for the Role Assignment. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual NullableResponse GetIfExists(string roleAssignmentId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(roleAssignmentId, nameof(roleAssignmentId)); + + using var scope = _gremlinRoleAssignmentResourceGremlinResourcesClientDiagnostics.CreateScope("GremlinRoleAssignmentResourceCollection.GetIfExists"); + scope.Start(); + try + { + var response = _gremlinRoleAssignmentResourceGremlinResourcesRestClient.GetGremlinRoleAssignment(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, roleAssignmentId, cancellationToken: cancellationToken); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new GremlinRoleAssignmentResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetAll().GetEnumerator(); + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetAll().GetEnumerator(); + } + + IAsyncEnumerator IAsyncEnumerable.GetAsyncEnumerator(CancellationToken cancellationToken) + { + return GetAllAsync(cancellationToken: cancellationToken).GetAsyncEnumerator(cancellationToken); + } + } +} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/GremlinRoleAssignmentResourceData.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/GremlinRoleAssignmentResourceData.Serialization.cs new file mode 100644 index 000000000000..8a00d801221c --- /dev/null +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/GremlinRoleAssignmentResourceData.Serialization.cs @@ -0,0 +1,363 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text; +using System.Text.Json; +using Azure.Core; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.CosmosDB +{ + public partial class GremlinRoleAssignmentResourceData : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(GremlinRoleAssignmentResourceData)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + writer.WritePropertyName("properties"u8); + writer.WriteStartObject(); + if (Optional.IsDefined(RoleDefinitionId)) + { + writer.WritePropertyName("roleDefinitionId"u8); + writer.WriteStringValue(RoleDefinitionId); + } + if (Optional.IsDefined(Scope)) + { + writer.WritePropertyName("scope"u8); + writer.WriteStringValue(Scope); + } + if (Optional.IsDefined(PrincipalId)) + { + writer.WritePropertyName("principalId"u8); + writer.WriteStringValue(PrincipalId.Value); + } + if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) + { + writer.WritePropertyName("provisioningState"u8); + writer.WriteStringValue(ProvisioningState); + } + writer.WriteEndObject(); + } + + GremlinRoleAssignmentResourceData 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(GremlinRoleAssignmentResourceData)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeGremlinRoleAssignmentResourceData(document.RootElement, options); + } + + internal static GremlinRoleAssignmentResourceData DeserializeGremlinRoleAssignmentResourceData(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ResourceIdentifier id = default; + string name = default; + ResourceType type = default; + SystemData systemData = default; + string roleDefinitionId = default; + string scope = default; + Guid? principalId = default; + string provisioningState = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("id"u8)) + { + id = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("type"u8)) + { + type = new ResourceType(property.Value.GetString()); + continue; + } + if (property.NameEquals("systemData"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + systemData = JsonSerializer.Deserialize(property.Value.GetRawText()); + continue; + } + if (property.NameEquals("properties"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + foreach (var property0 in property.Value.EnumerateObject()) + { + if (property0.NameEquals("roleDefinitionId"u8)) + { + roleDefinitionId = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("scope"u8)) + { + scope = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("principalId"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + principalId = property0.Value.GetGuid(); + continue; + } + if (property0.NameEquals("provisioningState"u8)) + { + provisioningState = property0.Value.GetString(); + continue; + } + } + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new GremlinRoleAssignmentResourceData( + id, + name, + type, + systemData, + roleDefinitionId, + scope, + principalId, + provisioningState, + serializedAdditionalRawData); + } + + private BinaryData SerializeBicep(ModelReaderWriterOptions options) + { + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Name), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" name: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Name)) + { + builder.Append(" name: "); + if (Name.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{Name}'''"); + } + else + { + builder.AppendLine($"'{Name}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Id), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" id: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Id)) + { + builder.Append(" id: "); + builder.AppendLine($"'{Id.ToString()}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(SystemData), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" systemData: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(SystemData)) + { + builder.Append(" systemData: "); + builder.AppendLine($"'{SystemData.ToString()}'"); + } + } + + builder.Append(" properties:"); + builder.AppendLine(" {"); + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(RoleDefinitionId), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" roleDefinitionId: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(RoleDefinitionId)) + { + builder.Append(" roleDefinitionId: "); + if (RoleDefinitionId.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{RoleDefinitionId}'''"); + } + else + { + builder.AppendLine($"'{RoleDefinitionId}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Scope), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" scope: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Scope)) + { + builder.Append(" scope: "); + if (Scope.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{Scope}'''"); + } + else + { + builder.AppendLine($"'{Scope}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(PrincipalId), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" principalId: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(PrincipalId)) + { + builder.Append(" principalId: "); + builder.AppendLine($"'{PrincipalId.Value.ToString()}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(ProvisioningState), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" provisioningState: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(ProvisioningState)) + { + builder.Append(" provisioningState: "); + if (ProvisioningState.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{ProvisioningState}'''"); + } + else + { + builder.AppendLine($"'{ProvisioningState}'"); + } + } + } + + builder.AppendLine(" }"); + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + case "bicep": + return SerializeBicep(options); + default: + throw new FormatException($"The model {nameof(GremlinRoleAssignmentResourceData)} does not support writing '{options.Format}' format."); + } + } + + GremlinRoleAssignmentResourceData 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 DeserializeGremlinRoleAssignmentResourceData(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(GremlinRoleAssignmentResourceData)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/GremlinRoleAssignmentResourceData.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/GremlinRoleAssignmentResourceData.cs new file mode 100644 index 000000000000..e123d6a3414b --- /dev/null +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/GremlinRoleAssignmentResourceData.cs @@ -0,0 +1,90 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.CosmosDB +{ + /// + /// A class representing the GremlinRoleAssignmentResource data model. + /// Parameters to create and update an Azure Cosmos DB Gremlin Role Assignment. + /// + public partial class GremlinRoleAssignmentResourceData : ResourceData + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public GremlinRoleAssignmentResourceData() + { + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The unique identifier for the associated Role Definition. + /// The data plane resource path for which access is being granted through this Gremlin Role Assignment. + /// The unique identifier for the associated AAD principal in the AAD graph to which access is being granted through this Gremlin Role Assignment. Tenant ID for the principal is inferred using the tenant associated with the subscription. + /// Provisioning state of the resource. + /// Keeps track of any properties unknown to the library. + internal GremlinRoleAssignmentResourceData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, string roleDefinitionId, string scope, Guid? principalId, string provisioningState, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) + { + RoleDefinitionId = roleDefinitionId; + Scope = scope; + PrincipalId = principalId; + ProvisioningState = provisioningState; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The unique identifier for the associated Role Definition. + [WirePath("properties.roleDefinitionId")] + public string RoleDefinitionId { get; set; } + /// The data plane resource path for which access is being granted through this Gremlin Role Assignment. + [WirePath("properties.scope")] + public string Scope { get; set; } + /// The unique identifier for the associated AAD principal in the AAD graph to which access is being granted through this Gremlin Role Assignment. Tenant ID for the principal is inferred using the tenant associated with the subscription. + [WirePath("properties.principalId")] + public Guid? PrincipalId { get; set; } + /// Provisioning state of the resource. + [WirePath("properties.provisioningState")] + public string ProvisioningState { get; } + } +} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/GremlinRoleDefinitionResource.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/GremlinRoleDefinitionResource.Serialization.cs new file mode 100644 index 000000000000..073c7cb69da1 --- /dev/null +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/GremlinRoleDefinitionResource.Serialization.cs @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; + +namespace Azure.ResourceManager.CosmosDB +{ + public partial class GremlinRoleDefinitionResource : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); + + GremlinRoleDefinitionResourceData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options); + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options); + + GremlinRoleDefinitionResourceData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options); + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)Data).GetFormatFromOptions(options); + } +} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/GremlinRoleDefinitionResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/GremlinRoleDefinitionResource.cs new file mode 100644 index 000000000000..cd223a2f44ef --- /dev/null +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/GremlinRoleDefinitionResource.cs @@ -0,0 +1,347 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.CosmosDB +{ + /// + /// A Class representing a GremlinRoleDefinitionResource along with the instance operations that can be performed on it. + /// If you have a you can construct a + /// from an instance of using the GetGremlinRoleDefinitionResource method. + /// Otherwise you can get one from its parent resource using the GetGremlinRoleDefinitionResource method. + /// + public partial class GremlinRoleDefinitionResource : ArmResource + { + /// Generate the resource identifier of a instance. + /// The subscriptionId. + /// The resourceGroupName. + /// The accountName. + /// The roleDefinitionId. + public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string accountName, string roleDefinitionId) + { + var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinRoleDefinitions/{roleDefinitionId}"; + return new ResourceIdentifier(resourceId); + } + + private readonly ClientDiagnostics _gremlinRoleDefinitionResourceGremlinResourcesClientDiagnostics; + private readonly GremlinResourcesRestOperations _gremlinRoleDefinitionResourceGremlinResourcesRestClient; + private readonly GremlinRoleDefinitionResourceData _data; + + /// Gets the resource type for the operations. + public static readonly ResourceType ResourceType = "Microsoft.DocumentDB/databaseAccounts/gremlinRoleDefinitions"; + + /// Initializes a new instance of the class for mocking. + protected GremlinRoleDefinitionResource() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The resource that is the target of operations. + internal GremlinRoleDefinitionResource(ArmClient client, GremlinRoleDefinitionResourceData data) : this(client, data.Id) + { + HasData = true; + _data = data; + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The identifier of the resource that is the target of operations. + internal GremlinRoleDefinitionResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _gremlinRoleDefinitionResourceGremlinResourcesClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.CosmosDB", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string gremlinRoleDefinitionResourceGremlinResourcesApiVersion); + _gremlinRoleDefinitionResourceGremlinResourcesRestClient = new GremlinResourcesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, gremlinRoleDefinitionResourceGremlinResourcesApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + /// Gets whether or not the current instance has data. + public virtual bool HasData { get; } + + /// Gets the data representing this Feature. + /// Throws if there is no data loaded in the current instance. + public virtual GremlinRoleDefinitionResourceData Data + { + get + { + if (!HasData) + throw new InvalidOperationException("The current instance does not have data, you must call Get first."); + return _data; + } + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceType), nameof(id)); + } + + /// + /// Retrieves the properties of an existing Azure Cosmos DB Gremlin Role Definition with the given Id. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinRoleDefinitions/{roleDefinitionId} + /// + /// + /// Operation Id + /// GremlinResources_GetGremlinRoleDefinition + /// + /// + /// Default Api Version + /// 2025-05-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + { + using var scope = _gremlinRoleDefinitionResourceGremlinResourcesClientDiagnostics.CreateScope("GremlinRoleDefinitionResource.Get"); + scope.Start(); + try + { + var response = await _gremlinRoleDefinitionResourceGremlinResourcesRestClient.GetGremlinRoleDefinitionAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new GremlinRoleDefinitionResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Retrieves the properties of an existing Azure Cosmos DB Gremlin Role Definition with the given Id. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinRoleDefinitions/{roleDefinitionId} + /// + /// + /// Operation Id + /// GremlinResources_GetGremlinRoleDefinition + /// + /// + /// Default Api Version + /// 2025-05-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual Response Get(CancellationToken cancellationToken = default) + { + using var scope = _gremlinRoleDefinitionResourceGremlinResourcesClientDiagnostics.CreateScope("GremlinRoleDefinitionResource.Get"); + scope.Start(); + try + { + var response = _gremlinRoleDefinitionResourceGremlinResourcesRestClient.GetGremlinRoleDefinition(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new GremlinRoleDefinitionResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Deletes an existing Azure Cosmos DB Gremlin Role Definition. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinRoleDefinitions/{roleDefinitionId} + /// + /// + /// Operation Id + /// GremlinResources_DeleteGremlinRoleDefinition + /// + /// + /// Default Api Version + /// 2025-05-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The cancellation token to use. + public virtual async Task DeleteAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default) + { + using var scope = _gremlinRoleDefinitionResourceGremlinResourcesClientDiagnostics.CreateScope("GremlinRoleDefinitionResource.Delete"); + scope.Start(); + try + { + var response = await _gremlinRoleDefinitionResourceGremlinResourcesRestClient.DeleteGremlinRoleDefinitionAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + var operation = new CosmosDBArmOperation(_gremlinRoleDefinitionResourceGremlinResourcesClientDiagnostics, Pipeline, _gremlinRoleDefinitionResourceGremlinResourcesRestClient.CreateDeleteGremlinRoleDefinitionRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Deletes an existing Azure Cosmos DB Gremlin Role Definition. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinRoleDefinitions/{roleDefinitionId} + /// + /// + /// Operation Id + /// GremlinResources_DeleteGremlinRoleDefinition + /// + /// + /// Default Api Version + /// 2025-05-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The cancellation token to use. + public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancellationToken = default) + { + using var scope = _gremlinRoleDefinitionResourceGremlinResourcesClientDiagnostics.CreateScope("GremlinRoleDefinitionResource.Delete"); + scope.Start(); + try + { + var response = _gremlinRoleDefinitionResourceGremlinResourcesRestClient.DeleteGremlinRoleDefinition(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + var operation = new CosmosDBArmOperation(_gremlinRoleDefinitionResourceGremlinResourcesClientDiagnostics, Pipeline, _gremlinRoleDefinitionResourceGremlinResourcesRestClient.CreateDeleteGremlinRoleDefinitionRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletionResponse(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Creates or updates an Azure Cosmos DB Gremlin Role Definition. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinRoleDefinitions/{roleDefinitionId} + /// + /// + /// Operation Id + /// GremlinResources_CreateUpdateGremlinRoleDefinition + /// + /// + /// Default Api Version + /// 2025-05-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The properties required to create or update a Role Definition. + /// The cancellation token to use. + /// is null. + public virtual async Task> UpdateAsync(WaitUntil waitUntil, GremlinRoleDefinitionResourceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _gremlinRoleDefinitionResourceGremlinResourcesClientDiagnostics.CreateScope("GremlinRoleDefinitionResource.Update"); + scope.Start(); + try + { + var response = await _gremlinRoleDefinitionResourceGremlinResourcesRestClient.CreateUpdateGremlinRoleDefinitionAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, cancellationToken).ConfigureAwait(false); + var operation = new CosmosDBArmOperation(new GremlinRoleDefinitionResourceOperationSource(Client), _gremlinRoleDefinitionResourceGremlinResourcesClientDiagnostics, Pipeline, _gremlinRoleDefinitionResourceGremlinResourcesRestClient.CreateCreateUpdateGremlinRoleDefinitionRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Creates or updates an Azure Cosmos DB Gremlin Role Definition. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinRoleDefinitions/{roleDefinitionId} + /// + /// + /// Operation Id + /// GremlinResources_CreateUpdateGremlinRoleDefinition + /// + /// + /// Default Api Version + /// 2025-05-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The properties required to create or update a Role Definition. + /// The cancellation token to use. + /// is null. + public virtual ArmOperation Update(WaitUntil waitUntil, GremlinRoleDefinitionResourceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _gremlinRoleDefinitionResourceGremlinResourcesClientDiagnostics.CreateScope("GremlinRoleDefinitionResource.Update"); + scope.Start(); + try + { + var response = _gremlinRoleDefinitionResourceGremlinResourcesRestClient.CreateUpdateGremlinRoleDefinition(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, cancellationToken); + var operation = new CosmosDBArmOperation(new GremlinRoleDefinitionResourceOperationSource(Client), _gremlinRoleDefinitionResourceGremlinResourcesClientDiagnostics, Pipeline, _gremlinRoleDefinitionResourceGremlinResourcesRestClient.CreateCreateUpdateGremlinRoleDefinitionRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/GremlinRoleDefinitionResourceCollection.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/GremlinRoleDefinitionResourceCollection.cs new file mode 100644 index 000000000000..5307c20bd5c2 --- /dev/null +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/GremlinRoleDefinitionResourceCollection.cs @@ -0,0 +1,491 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Autorest.CSharp.Core; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.CosmosDB +{ + /// + /// A class representing a collection of and their operations. + /// Each in the collection will belong to the same instance of . + /// To get a instance call the GetGremlinRoleDefinitionResources method from an instance of . + /// + public partial class GremlinRoleDefinitionResourceCollection : ArmCollection, IEnumerable, IAsyncEnumerable + { + private readonly ClientDiagnostics _gremlinRoleDefinitionResourceGremlinResourcesClientDiagnostics; + private readonly GremlinResourcesRestOperations _gremlinRoleDefinitionResourceGremlinResourcesRestClient; + + /// Initializes a new instance of the class for mocking. + protected GremlinRoleDefinitionResourceCollection() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The identifier of the parent resource that is the target of operations. + internal GremlinRoleDefinitionResourceCollection(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _gremlinRoleDefinitionResourceGremlinResourcesClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.CosmosDB", GremlinRoleDefinitionResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(GremlinRoleDefinitionResource.ResourceType, out string gremlinRoleDefinitionResourceGremlinResourcesApiVersion); + _gremlinRoleDefinitionResourceGremlinResourcesRestClient = new GremlinResourcesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, gremlinRoleDefinitionResourceGremlinResourcesApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != CosmosDBAccountResource.ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, CosmosDBAccountResource.ResourceType), nameof(id)); + } + + /// + /// Creates or updates an Azure Cosmos DB Gremlin Role Definition. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinRoleDefinitions/{roleDefinitionId} + /// + /// + /// Operation Id + /// GremlinResources_CreateUpdateGremlinRoleDefinition + /// + /// + /// Default Api Version + /// 2025-05-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The GUID for the Role Definition. + /// The properties required to create or update a Role Definition. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// or is null. + public virtual async Task> CreateOrUpdateAsync(WaitUntil waitUntil, string roleDefinitionId, GremlinRoleDefinitionResourceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(roleDefinitionId, nameof(roleDefinitionId)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _gremlinRoleDefinitionResourceGremlinResourcesClientDiagnostics.CreateScope("GremlinRoleDefinitionResourceCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = await _gremlinRoleDefinitionResourceGremlinResourcesRestClient.CreateUpdateGremlinRoleDefinitionAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, roleDefinitionId, data, cancellationToken).ConfigureAwait(false); + var operation = new CosmosDBArmOperation(new GremlinRoleDefinitionResourceOperationSource(Client), _gremlinRoleDefinitionResourceGremlinResourcesClientDiagnostics, Pipeline, _gremlinRoleDefinitionResourceGremlinResourcesRestClient.CreateCreateUpdateGremlinRoleDefinitionRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, roleDefinitionId, data).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Creates or updates an Azure Cosmos DB Gremlin Role Definition. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinRoleDefinitions/{roleDefinitionId} + /// + /// + /// Operation Id + /// GremlinResources_CreateUpdateGremlinRoleDefinition + /// + /// + /// Default Api Version + /// 2025-05-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The GUID for the Role Definition. + /// The properties required to create or update a Role Definition. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// or is null. + public virtual ArmOperation CreateOrUpdate(WaitUntil waitUntil, string roleDefinitionId, GremlinRoleDefinitionResourceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(roleDefinitionId, nameof(roleDefinitionId)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _gremlinRoleDefinitionResourceGremlinResourcesClientDiagnostics.CreateScope("GremlinRoleDefinitionResourceCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = _gremlinRoleDefinitionResourceGremlinResourcesRestClient.CreateUpdateGremlinRoleDefinition(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, roleDefinitionId, data, cancellationToken); + var operation = new CosmosDBArmOperation(new GremlinRoleDefinitionResourceOperationSource(Client), _gremlinRoleDefinitionResourceGremlinResourcesClientDiagnostics, Pipeline, _gremlinRoleDefinitionResourceGremlinResourcesRestClient.CreateCreateUpdateGremlinRoleDefinitionRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, roleDefinitionId, data).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Retrieves the properties of an existing Azure Cosmos DB Gremlin Role Definition with the given Id. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinRoleDefinitions/{roleDefinitionId} + /// + /// + /// Operation Id + /// GremlinResources_GetGremlinRoleDefinition + /// + /// + /// Default Api Version + /// 2025-05-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The GUID for the Role Definition. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetAsync(string roleDefinitionId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(roleDefinitionId, nameof(roleDefinitionId)); + + using var scope = _gremlinRoleDefinitionResourceGremlinResourcesClientDiagnostics.CreateScope("GremlinRoleDefinitionResourceCollection.Get"); + scope.Start(); + try + { + var response = await _gremlinRoleDefinitionResourceGremlinResourcesRestClient.GetGremlinRoleDefinitionAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, roleDefinitionId, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new GremlinRoleDefinitionResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Retrieves the properties of an existing Azure Cosmos DB Gremlin Role Definition with the given Id. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinRoleDefinitions/{roleDefinitionId} + /// + /// + /// Operation Id + /// GremlinResources_GetGremlinRoleDefinition + /// + /// + /// Default Api Version + /// 2025-05-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The GUID for the Role Definition. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Get(string roleDefinitionId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(roleDefinitionId, nameof(roleDefinitionId)); + + using var scope = _gremlinRoleDefinitionResourceGremlinResourcesClientDiagnostics.CreateScope("GremlinRoleDefinitionResourceCollection.Get"); + scope.Start(); + try + { + var response = _gremlinRoleDefinitionResourceGremlinResourcesRestClient.GetGremlinRoleDefinition(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, roleDefinitionId, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new GremlinRoleDefinitionResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Retrieves the list of all Azure Cosmos DB Gremlin Role Definitions. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinRoleDefinitions + /// + /// + /// Operation Id + /// GremlinResources_ListGremlinRoleDefinitions + /// + /// + /// Default Api Version + /// 2025-05-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetAllAsync(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _gremlinRoleDefinitionResourceGremlinResourcesRestClient.CreateListGremlinRoleDefinitionsRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, null, e => new GremlinRoleDefinitionResource(Client, GremlinRoleDefinitionResourceData.DeserializeGremlinRoleDefinitionResourceData(e)), _gremlinRoleDefinitionResourceGremlinResourcesClientDiagnostics, Pipeline, "GremlinRoleDefinitionResourceCollection.GetAll", "value", null, cancellationToken); + } + + /// + /// Retrieves the list of all Azure Cosmos DB Gremlin Role Definitions. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinRoleDefinitions + /// + /// + /// Operation Id + /// GremlinResources_ListGremlinRoleDefinitions + /// + /// + /// Default Api Version + /// 2025-05-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetAll(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _gremlinRoleDefinitionResourceGremlinResourcesRestClient.CreateListGremlinRoleDefinitionsRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, null, e => new GremlinRoleDefinitionResource(Client, GremlinRoleDefinitionResourceData.DeserializeGremlinRoleDefinitionResourceData(e)), _gremlinRoleDefinitionResourceGremlinResourcesClientDiagnostics, Pipeline, "GremlinRoleDefinitionResourceCollection.GetAll", "value", null, cancellationToken); + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinRoleDefinitions/{roleDefinitionId} + /// + /// + /// Operation Id + /// GremlinResources_GetGremlinRoleDefinition + /// + /// + /// Default Api Version + /// 2025-05-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The GUID for the Role Definition. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> ExistsAsync(string roleDefinitionId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(roleDefinitionId, nameof(roleDefinitionId)); + + using var scope = _gremlinRoleDefinitionResourceGremlinResourcesClientDiagnostics.CreateScope("GremlinRoleDefinitionResourceCollection.Exists"); + scope.Start(); + try + { + var response = await _gremlinRoleDefinitionResourceGremlinResourcesRestClient.GetGremlinRoleDefinitionAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, roleDefinitionId, cancellationToken: cancellationToken).ConfigureAwait(false); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinRoleDefinitions/{roleDefinitionId} + /// + /// + /// Operation Id + /// GremlinResources_GetGremlinRoleDefinition + /// + /// + /// Default Api Version + /// 2025-05-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The GUID for the Role Definition. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Exists(string roleDefinitionId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(roleDefinitionId, nameof(roleDefinitionId)); + + using var scope = _gremlinRoleDefinitionResourceGremlinResourcesClientDiagnostics.CreateScope("GremlinRoleDefinitionResourceCollection.Exists"); + scope.Start(); + try + { + var response = _gremlinRoleDefinitionResourceGremlinResourcesRestClient.GetGremlinRoleDefinition(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, roleDefinitionId, cancellationToken: cancellationToken); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinRoleDefinitions/{roleDefinitionId} + /// + /// + /// Operation Id + /// GremlinResources_GetGremlinRoleDefinition + /// + /// + /// Default Api Version + /// 2025-05-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The GUID for the Role Definition. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetIfExistsAsync(string roleDefinitionId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(roleDefinitionId, nameof(roleDefinitionId)); + + using var scope = _gremlinRoleDefinitionResourceGremlinResourcesClientDiagnostics.CreateScope("GremlinRoleDefinitionResourceCollection.GetIfExists"); + scope.Start(); + try + { + var response = await _gremlinRoleDefinitionResourceGremlinResourcesRestClient.GetGremlinRoleDefinitionAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, roleDefinitionId, cancellationToken: cancellationToken).ConfigureAwait(false); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new GremlinRoleDefinitionResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinRoleDefinitions/{roleDefinitionId} + /// + /// + /// Operation Id + /// GremlinResources_GetGremlinRoleDefinition + /// + /// + /// Default Api Version + /// 2025-05-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The GUID for the Role Definition. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual NullableResponse GetIfExists(string roleDefinitionId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(roleDefinitionId, nameof(roleDefinitionId)); + + using var scope = _gremlinRoleDefinitionResourceGremlinResourcesClientDiagnostics.CreateScope("GremlinRoleDefinitionResourceCollection.GetIfExists"); + scope.Start(); + try + { + var response = _gremlinRoleDefinitionResourceGremlinResourcesRestClient.GetGremlinRoleDefinition(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, roleDefinitionId, cancellationToken: cancellationToken); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new GremlinRoleDefinitionResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetAll().GetEnumerator(); + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetAll().GetEnumerator(); + } + + IAsyncEnumerator IAsyncEnumerable.GetAsyncEnumerator(CancellationToken cancellationToken) + { + return GetAllAsync(cancellationToken: cancellationToken).GetAsyncEnumerator(cancellationToken); + } + } +} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/GremlinRoleDefinitionResourceData.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/GremlinRoleDefinitionResourceData.Serialization.cs new file mode 100644 index 000000000000..8c12beb89162 --- /dev/null +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/GremlinRoleDefinitionResourceData.Serialization.cs @@ -0,0 +1,441 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Text.Json; +using Azure.Core; +using Azure.ResourceManager.CosmosDB.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.CosmosDB +{ + public partial class GremlinRoleDefinitionResourceData : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(GremlinRoleDefinitionResourceData)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + writer.WritePropertyName("properties"u8); + writer.WriteStartObject(); + if (Optional.IsDefined(IdPropertiesId)) + { + writer.WritePropertyName("id"u8); + writer.WriteStringValue(IdPropertiesId); + } + if (Optional.IsDefined(RoleName)) + { + writer.WritePropertyName("roleName"u8); + writer.WriteStringValue(RoleName); + } + if (Optional.IsDefined(TypePropertiesType)) + { + writer.WritePropertyName("type"u8); + writer.WriteStringValue(TypePropertiesType.Value.ToSerialString()); + } + if (Optional.IsCollectionDefined(AssignableScopes)) + { + writer.WritePropertyName("assignableScopes"u8); + writer.WriteStartArray(); + foreach (var item in AssignableScopes) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(Permissions)) + { + writer.WritePropertyName("permissions"u8); + writer.WriteStartArray(); + foreach (var item in Permissions) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + writer.WriteEndObject(); + } + + GremlinRoleDefinitionResourceData 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(GremlinRoleDefinitionResourceData)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeGremlinRoleDefinitionResourceData(document.RootElement, options); + } + + internal static GremlinRoleDefinitionResourceData DeserializeGremlinRoleDefinitionResourceData(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ResourceIdentifier id = default; + string name = default; + ResourceType type = default; + SystemData systemData = default; + string id0 = default; + string roleName = default; + CosmosDBSqlRoleDefinitionType? type0 = default; + IList assignableScopes = default; + IList permissions = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("id"u8)) + { + id = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("type"u8)) + { + type = new ResourceType(property.Value.GetString()); + continue; + } + if (property.NameEquals("systemData"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + systemData = JsonSerializer.Deserialize(property.Value.GetRawText()); + continue; + } + if (property.NameEquals("properties"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + foreach (var property0 in property.Value.EnumerateObject()) + { + if (property0.NameEquals("id"u8)) + { + id0 = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("roleName"u8)) + { + roleName = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("type"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + type0 = property0.Value.GetString().ToCosmosDBSqlRoleDefinitionType(); + continue; + } + if (property0.NameEquals("assignableScopes"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property0.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + assignableScopes = array; + continue; + } + if (property0.NameEquals("permissions"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property0.Value.EnumerateArray()) + { + array.Add(Permission.DeserializePermission(item, options)); + } + permissions = array; + continue; + } + } + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new GremlinRoleDefinitionResourceData( + id, + name, + type, + systemData, + id0, + roleName, + type0, + assignableScopes ?? new ChangeTrackingList(), + permissions ?? new ChangeTrackingList(), + serializedAdditionalRawData); + } + + private BinaryData SerializeBicep(ModelReaderWriterOptions options) + { + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Name), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" name: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Name)) + { + builder.Append(" name: "); + if (Name.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{Name}'''"); + } + else + { + builder.AppendLine($"'{Name}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Id), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" id: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Id)) + { + builder.Append(" id: "); + builder.AppendLine($"'{Id.ToString()}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(SystemData), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" systemData: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(SystemData)) + { + builder.Append(" systemData: "); + builder.AppendLine($"'{SystemData.ToString()}'"); + } + } + + builder.Append(" properties:"); + builder.AppendLine(" {"); + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(IdPropertiesId), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" id: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(IdPropertiesId)) + { + builder.Append(" id: "); + if (IdPropertiesId.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{IdPropertiesId}'''"); + } + else + { + builder.AppendLine($"'{IdPropertiesId}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(RoleName), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" roleName: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(RoleName)) + { + builder.Append(" roleName: "); + if (RoleName.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{RoleName}'''"); + } + else + { + builder.AppendLine($"'{RoleName}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(TypePropertiesType), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" type: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(TypePropertiesType)) + { + builder.Append(" type: "); + builder.AppendLine($"'{TypePropertiesType.Value.ToSerialString()}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(AssignableScopes), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" assignableScopes: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsCollectionDefined(AssignableScopes)) + { + if (AssignableScopes.Any()) + { + builder.Append(" assignableScopes: "); + builder.AppendLine("["); + foreach (var item in AssignableScopes) + { + if (item == null) + { + builder.Append("null"); + continue; + } + if (item.Contains(Environment.NewLine)) + { + builder.AppendLine(" '''"); + builder.AppendLine($"{item}'''"); + } + else + { + builder.AppendLine($" '{item}'"); + } + } + builder.AppendLine(" ]"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Permissions), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" permissions: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsCollectionDefined(Permissions)) + { + if (Permissions.Any()) + { + builder.Append(" permissions: "); + builder.AppendLine("["); + foreach (var item in Permissions) + { + BicepSerializationHelpers.AppendChildObject(builder, item, options, 6, true, " permissions: "); + } + builder.AppendLine(" ]"); + } + } + } + + builder.AppendLine(" }"); + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + case "bicep": + return SerializeBicep(options); + default: + throw new FormatException($"The model {nameof(GremlinRoleDefinitionResourceData)} does not support writing '{options.Format}' format."); + } + } + + GremlinRoleDefinitionResourceData 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 DeserializeGremlinRoleDefinitionResourceData(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(GremlinRoleDefinitionResourceData)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/GremlinRoleDefinitionResourceData.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/GremlinRoleDefinitionResourceData.cs new file mode 100644 index 000000000000..19522ce1364b --- /dev/null +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/GremlinRoleDefinitionResourceData.cs @@ -0,0 +1,98 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; +using Azure.ResourceManager.CosmosDB.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.CosmosDB +{ + /// + /// A class representing the GremlinRoleDefinitionResource data model. + /// Parameters to create and update an Azure Cosmos DB Gremlin Role Definition. + /// + public partial class GremlinRoleDefinitionResourceData : ResourceData + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public GremlinRoleDefinitionResourceData() + { + AssignableScopes = new ChangeTrackingList(); + Permissions = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The path id for the Role Definition. + /// A user-friendly name for the Role Definition. Must be unique for the database account. + /// Indicates whether the Role Definition was built-in or user created. + /// A set of fully qualified Scopes at or below which Gremlin Role Assignments may be created using this Role Definition. This will allow application of this Role Definition on the entire database account or any underlying Database / Collection. Must have at least one element. Scopes higher than Database account are not enforceable as assignable Scopes. Note that resources referenced in assignable Scopes need not exist. + /// The set of operations allowed through this Role Definition. + /// Keeps track of any properties unknown to the library. + internal GremlinRoleDefinitionResourceData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, string idPropertiesId, string roleName, CosmosDBSqlRoleDefinitionType? typePropertiesType, IList assignableScopes, IList permissions, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) + { + IdPropertiesId = idPropertiesId; + RoleName = roleName; + TypePropertiesType = typePropertiesType; + AssignableScopes = assignableScopes; + Permissions = permissions; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The path id for the Role Definition. + [WirePath("properties.id")] + public string IdPropertiesId { get; set; } + /// A user-friendly name for the Role Definition. Must be unique for the database account. + [WirePath("properties.roleName")] + public string RoleName { get; set; } + /// Indicates whether the Role Definition was built-in or user created. + [WirePath("properties.type")] + public CosmosDBSqlRoleDefinitionType? TypePropertiesType { get; set; } + /// A set of fully qualified Scopes at or below which Gremlin Role Assignments may be created using this Role Definition. This will allow application of this Role Definition on the entire database account or any underlying Database / Collection. Must have at least one element. Scopes higher than Database account are not enforceable as assignable Scopes. Note that resources referenced in assignable Scopes need not exist. + [WirePath("properties.assignableScopes")] + public IList AssignableScopes { get; } + /// The set of operations allowed through this Role Definition. + [WirePath("properties.permissions")] + public IList Permissions { get; } + } +} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/LongRunningOperation/CassandraRoleAssignmentResourceOperationSource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/LongRunningOperation/CassandraRoleAssignmentResourceOperationSource.cs new file mode 100644 index 000000000000..c5fbb25cb806 --- /dev/null +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/LongRunningOperation/CassandraRoleAssignmentResourceOperationSource.cs @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.ClientModel.Primitives; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; + +namespace Azure.ResourceManager.CosmosDB +{ + internal class CassandraRoleAssignmentResourceOperationSource : IOperationSource + { + private readonly ArmClient _client; + + internal CassandraRoleAssignmentResourceOperationSource(ArmClient client) + { + _client = client; + } + + CassandraRoleAssignmentResource IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) + { + var data = ModelReaderWriter.Read(response.Content); + return new CassandraRoleAssignmentResource(_client, data); + } + + async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) + { + var data = ModelReaderWriter.Read(response.Content); + return await Task.FromResult(new CassandraRoleAssignmentResource(_client, data)).ConfigureAwait(false); + } + } +} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/LongRunningOperation/CassandraRoleDefinitionResourceOperationSource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/LongRunningOperation/CassandraRoleDefinitionResourceOperationSource.cs new file mode 100644 index 000000000000..42a7eac9dd2d --- /dev/null +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/LongRunningOperation/CassandraRoleDefinitionResourceOperationSource.cs @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.ClientModel.Primitives; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; + +namespace Azure.ResourceManager.CosmosDB +{ + internal class CassandraRoleDefinitionResourceOperationSource : IOperationSource + { + private readonly ArmClient _client; + + internal CassandraRoleDefinitionResourceOperationSource(ArmClient client) + { + _client = client; + } + + CassandraRoleDefinitionResource IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) + { + var data = ModelReaderWriter.Read(response.Content); + return new CassandraRoleDefinitionResource(_client, data); + } + + async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) + { + var data = ModelReaderWriter.Read(response.Content); + return await Task.FromResult(new CassandraRoleDefinitionResource(_client, data)).ConfigureAwait(false); + } + } +} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/LongRunningOperation/FleetspaceAccountResourceOperationSource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/LongRunningOperation/FleetspaceAccountResourceOperationSource.cs new file mode 100644 index 000000000000..d9ba36754bc9 --- /dev/null +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/LongRunningOperation/FleetspaceAccountResourceOperationSource.cs @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.ClientModel.Primitives; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; + +namespace Azure.ResourceManager.CosmosDB +{ + internal class FleetspaceAccountResourceOperationSource : IOperationSource + { + private readonly ArmClient _client; + + internal FleetspaceAccountResourceOperationSource(ArmClient client) + { + _client = client; + } + + FleetspaceAccountResource IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) + { + var data = ModelReaderWriter.Read(response.Content); + return new FleetspaceAccountResource(_client, data); + } + + async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) + { + var data = ModelReaderWriter.Read(response.Content); + return await Task.FromResult(new FleetspaceAccountResource(_client, data)).ConfigureAwait(false); + } + } +} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/LongRunningOperation/FleetspaceResourceOperationSource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/LongRunningOperation/FleetspaceResourceOperationSource.cs new file mode 100644 index 000000000000..e8aed245b8e4 --- /dev/null +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/LongRunningOperation/FleetspaceResourceOperationSource.cs @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.ClientModel.Primitives; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; + +namespace Azure.ResourceManager.CosmosDB +{ + internal class FleetspaceResourceOperationSource : IOperationSource + { + private readonly ArmClient _client; + + internal FleetspaceResourceOperationSource(ArmClient client) + { + _client = client; + } + + FleetspaceResource IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) + { + var data = ModelReaderWriter.Read(response.Content); + return new FleetspaceResource(_client, data); + } + + async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) + { + var data = ModelReaderWriter.Read(response.Content); + return await Task.FromResult(new FleetspaceResource(_client, data)).ConfigureAwait(false); + } + } +} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/LongRunningOperation/GremlinRoleAssignmentResourceOperationSource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/LongRunningOperation/GremlinRoleAssignmentResourceOperationSource.cs new file mode 100644 index 000000000000..1a84c7494ff8 --- /dev/null +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/LongRunningOperation/GremlinRoleAssignmentResourceOperationSource.cs @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.ClientModel.Primitives; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; + +namespace Azure.ResourceManager.CosmosDB +{ + internal class GremlinRoleAssignmentResourceOperationSource : IOperationSource + { + private readonly ArmClient _client; + + internal GremlinRoleAssignmentResourceOperationSource(ArmClient client) + { + _client = client; + } + + GremlinRoleAssignmentResource IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) + { + var data = ModelReaderWriter.Read(response.Content); + return new GremlinRoleAssignmentResource(_client, data); + } + + async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) + { + var data = ModelReaderWriter.Read(response.Content); + return await Task.FromResult(new GremlinRoleAssignmentResource(_client, data)).ConfigureAwait(false); + } + } +} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/LongRunningOperation/GremlinRoleDefinitionResourceOperationSource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/LongRunningOperation/GremlinRoleDefinitionResourceOperationSource.cs new file mode 100644 index 000000000000..7cef735b94f7 --- /dev/null +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/LongRunningOperation/GremlinRoleDefinitionResourceOperationSource.cs @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.ClientModel.Primitives; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; + +namespace Azure.ResourceManager.CosmosDB +{ + internal class GremlinRoleDefinitionResourceOperationSource : IOperationSource + { + private readonly ArmClient _client; + + internal GremlinRoleDefinitionResourceOperationSource(ArmClient client) + { + _client = client; + } + + GremlinRoleDefinitionResource IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) + { + var data = ModelReaderWriter.Read(response.Content); + return new GremlinRoleDefinitionResource(_client, data); + } + + async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) + { + var data = ModelReaderWriter.Read(response.Content); + return await Task.FromResult(new GremlinRoleDefinitionResource(_client, data)).ConfigureAwait(false); + } + } +} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/LongRunningOperation/MongoMIRoleAssignmentResourceOperationSource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/LongRunningOperation/MongoMIRoleAssignmentResourceOperationSource.cs new file mode 100644 index 000000000000..20d95b34d57c --- /dev/null +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/LongRunningOperation/MongoMIRoleAssignmentResourceOperationSource.cs @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.ClientModel.Primitives; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; + +namespace Azure.ResourceManager.CosmosDB +{ + internal class MongoMIRoleAssignmentResourceOperationSource : IOperationSource + { + private readonly ArmClient _client; + + internal MongoMIRoleAssignmentResourceOperationSource(ArmClient client) + { + _client = client; + } + + MongoMIRoleAssignmentResource IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) + { + var data = ModelReaderWriter.Read(response.Content); + return new MongoMIRoleAssignmentResource(_client, data); + } + + async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) + { + var data = ModelReaderWriter.Read(response.Content); + return await Task.FromResult(new MongoMIRoleAssignmentResource(_client, data)).ConfigureAwait(false); + } + } +} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/LongRunningOperation/MongoMIRoleDefinitionResourceOperationSource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/LongRunningOperation/MongoMIRoleDefinitionResourceOperationSource.cs new file mode 100644 index 000000000000..9e0d96de2892 --- /dev/null +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/LongRunningOperation/MongoMIRoleDefinitionResourceOperationSource.cs @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.ClientModel.Primitives; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; + +namespace Azure.ResourceManager.CosmosDB +{ + internal class MongoMIRoleDefinitionResourceOperationSource : IOperationSource + { + private readonly ArmClient _client; + + internal MongoMIRoleDefinitionResourceOperationSource(ArmClient client) + { + _client = client; + } + + MongoMIRoleDefinitionResource IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) + { + var data = ModelReaderWriter.Read(response.Content); + return new MongoMIRoleDefinitionResource(_client, data); + } + + async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) + { + var data = ModelReaderWriter.Read(response.Content); + return await Task.FromResult(new MongoMIRoleDefinitionResource(_client, data)).ConfigureAwait(false); + } + } +} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/AzureBlobContainer.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/AzureBlobContainer.Serialization.cs new file mode 100644 index 000000000000..492f0ad35fc8 --- /dev/null +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/AzureBlobContainer.Serialization.cs @@ -0,0 +1,167 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.CosmosDB.Models +{ + public partial class AzureBlobContainer : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AzureBlobContainer)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("containerName"u8); + writer.WriteStringValue(ContainerName); + 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 + } + } + } + + AzureBlobContainer 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(AzureBlobContainer)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAzureBlobContainer(document.RootElement, options); + } + + internal static AzureBlobContainer DeserializeAzureBlobContainer(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string containerName = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("containerName"u8)) + { + containerName = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new AzureBlobContainer(containerName, serializedAdditionalRawData); + } + + private BinaryData SerializeBicep(ModelReaderWriterOptions options) + { + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(ContainerName), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" containerName: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(ContainerName)) + { + builder.Append(" containerName: "); + if (ContainerName.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{ContainerName}'''"); + } + else + { + builder.AppendLine($"'{ContainerName}'"); + } + } + } + + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + case "bicep": + return SerializeBicep(options); + default: + throw new FormatException($"The model {nameof(AzureBlobContainer)} does not support writing '{options.Format}' format."); + } + } + + AzureBlobContainer 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 DeserializeAzureBlobContainer(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(AzureBlobContainer)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/AzureBlobContainer.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/AzureBlobContainer.cs new file mode 100644 index 000000000000..dbc9e466e1d6 --- /dev/null +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/AzureBlobContainer.cs @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.CosmosDB.Models +{ + /// An Azure Blob container. + public partial class AzureBlobContainer + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// Azure Blob container. + /// is null. + public AzureBlobContainer(string containerName) + { + Argument.AssertNotNull(containerName, nameof(containerName)); + + ContainerName = containerName; + } + + /// Initializes a new instance of . + /// Azure Blob container. + /// Keeps track of any properties unknown to the library. + internal AzureBlobContainer(string containerName, IDictionary serializedAdditionalRawData) + { + ContainerName = containerName; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal AzureBlobContainer() + { + } + + /// Azure Blob container. + [WirePath("containerName")] + public string ContainerName { get; set; } + } +} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/AzureBlobSourceSinkDetails.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/AzureBlobSourceSinkDetails.Serialization.cs new file mode 100644 index 000000000000..ad581395d697 --- /dev/null +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/AzureBlobSourceSinkDetails.Serialization.cs @@ -0,0 +1,159 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.CosmosDB.Models +{ + public partial class AzureBlobSourceSinkDetails : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AzureBlobSourceSinkDetails)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("endpointUrl"u8); + writer.WriteStringValue(EndpointUri.AbsoluteUri); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + AzureBlobSourceSinkDetails 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(AzureBlobSourceSinkDetails)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAzureBlobSourceSinkDetails(document.RootElement, options); + } + + internal static AzureBlobSourceSinkDetails DeserializeAzureBlobSourceSinkDetails(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Uri endpointUrl = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("endpointUrl"u8)) + { + endpointUrl = new Uri(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new AzureBlobSourceSinkDetails(endpointUrl, serializedAdditionalRawData); + } + + private BinaryData SerializeBicep(ModelReaderWriterOptions options) + { + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(EndpointUri), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" endpointUrl: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(EndpointUri)) + { + builder.Append(" endpointUrl: "); + builder.AppendLine($"'{EndpointUri.AbsoluteUri}'"); + } + } + + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + case "bicep": + return SerializeBicep(options); + default: + throw new FormatException($"The model {nameof(AzureBlobSourceSinkDetails)} does not support writing '{options.Format}' format."); + } + } + + AzureBlobSourceSinkDetails 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 DeserializeAzureBlobSourceSinkDetails(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(AzureBlobSourceSinkDetails)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/AzureBlobSourceSinkDetails.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/AzureBlobSourceSinkDetails.cs new file mode 100644 index 000000000000..1a4864b4c110 --- /dev/null +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/AzureBlobSourceSinkDetails.cs @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.CosmosDB.Models +{ + /// An Azure Blob Storage data source/sink. + public partial class AzureBlobSourceSinkDetails + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// Azure Blob container endpoint. + /// is null. + public AzureBlobSourceSinkDetails(Uri endpointUri) + { + Argument.AssertNotNull(endpointUri, nameof(endpointUri)); + + EndpointUri = endpointUri; + } + + /// Initializes a new instance of . + /// Azure Blob container endpoint. + /// Keeps track of any properties unknown to the library. + internal AzureBlobSourceSinkDetails(Uri endpointUri, IDictionary serializedAdditionalRawData) + { + EndpointUri = endpointUri; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal AzureBlobSourceSinkDetails() + { + } + + /// Azure Blob container endpoint. + [WirePath("endpointUrl")] + public Uri EndpointUri { get; set; } + } +} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/BaseCopyJobProperties.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/BaseCopyJobProperties.Serialization.cs new file mode 100644 index 000000000000..a231d0d6f57a --- /dev/null +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/BaseCopyJobProperties.Serialization.cs @@ -0,0 +1,153 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.CosmosDB.Models +{ + [PersistableModelProxy(typeof(UnknownBaseCopyJobProperties))] + public partial class BaseCopyJobProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(BaseCopyJobProperties)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("jobType"u8); + writer.WriteStringValue(JobType.ToString()); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + BaseCopyJobProperties 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(BaseCopyJobProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeBaseCopyJobProperties(document.RootElement, options); + } + + internal static BaseCopyJobProperties DeserializeBaseCopyJobProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + if (element.TryGetProperty("jobType", out JsonElement discriminator)) + { + switch (discriminator.GetString()) + { + case "AzureBlobStorageToCassandraRU": return BlobToCassandraRUCopyJobProperties.DeserializeBlobToCassandraRUCopyJobProperties(element, options); + case "CassandraRUToAzureBlobStorage": return CassandraRUToBlobCopyJobProperties.DeserializeCassandraRUToBlobCopyJobProperties(element, options); + case "CassandraRUToCassandraRU": return CassandraRUToCassandraRUCopyJobProperties.DeserializeCassandraRUToCassandraRUCopyJobProperties(element, options); + case "MongoRUToMongoRU": return MongoRUToMongoRUCopyJobProperties.DeserializeMongoRUToMongoRUCopyJobProperties(element, options); + case "MongoRUToMongoVCore": return MongoRUToMongoVCoreCopyJobProperties.DeserializeMongoRUToMongoVCoreCopyJobProperties(element, options); + case "NoSqlRUToNoSqlRU": return NoSqlRUToNoSqlRUCopyJobProperties.DeserializeNoSqlRUToNoSqlRUCopyJobProperties(element, options); + } + } + return UnknownBaseCopyJobProperties.DeserializeUnknownBaseCopyJobProperties(element, options); + } + + private BinaryData SerializeBicep(ModelReaderWriterOptions options) + { + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(JobType), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" jobType: "); + builder.AppendLine(propertyOverride); + } + else + { + builder.Append(" jobType: "); + builder.AppendLine($"'{JobType.ToString()}'"); + } + + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + case "bicep": + return SerializeBicep(options); + default: + throw new FormatException($"The model {nameof(BaseCopyJobProperties)} does not support writing '{options.Format}' format."); + } + } + + BaseCopyJobProperties 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 DeserializeBaseCopyJobProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(BaseCopyJobProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/BaseCopyJobProperties.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/BaseCopyJobProperties.cs new file mode 100644 index 000000000000..ffbd5b124eb9 --- /dev/null +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/BaseCopyJobProperties.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.CosmosDB.Models +{ + /// + /// Base copy job properties + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include , , , , and . + /// + public abstract partial class BaseCopyJobProperties + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private protected IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + protected BaseCopyJobProperties() + { + } + + /// Initializes a new instance of . + /// Copy Job Type. + /// Keeps track of any properties unknown to the library. + internal BaseCopyJobProperties(CopyJobType jobType, IDictionary serializedAdditionalRawData) + { + JobType = jobType; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Copy Job Type. + internal CopyJobType JobType { get; set; } + } +} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/BaseCopyJobTask.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/BaseCopyJobTask.Serialization.cs new file mode 100644 index 000000000000..c356497f981e --- /dev/null +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/BaseCopyJobTask.Serialization.cs @@ -0,0 +1,196 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.CosmosDB.Models +{ + public partial class BaseCopyJobTask : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(BaseCopyJobTask)} does not support writing '{format}' format."); + } + + if (options.Format != "W" && Optional.IsDefined(TotalCount)) + { + writer.WritePropertyName("totalCount"u8); + writer.WriteNumberValue(TotalCount.Value); + } + if (options.Format != "W" && Optional.IsDefined(ProcessedCount)) + { + writer.WritePropertyName("processedCount"u8); + writer.WriteNumberValue(ProcessedCount.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 + } + } + } + + BaseCopyJobTask 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(BaseCopyJobTask)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeBaseCopyJobTask(document.RootElement, options); + } + + internal static BaseCopyJobTask DeserializeBaseCopyJobTask(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + long? totalCount = default; + long? processedCount = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("totalCount"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + totalCount = property.Value.GetInt64(); + continue; + } + if (property.NameEquals("processedCount"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + processedCount = property.Value.GetInt64(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new BaseCopyJobTask(totalCount, processedCount, serializedAdditionalRawData); + } + + private BinaryData SerializeBicep(ModelReaderWriterOptions options) + { + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(TotalCount), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" totalCount: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(TotalCount)) + { + builder.Append(" totalCount: "); + builder.AppendLine($"'{TotalCount.Value.ToString()}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(ProcessedCount), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" processedCount: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(ProcessedCount)) + { + builder.Append(" processedCount: "); + builder.AppendLine($"'{ProcessedCount.Value.ToString()}'"); + } + } + + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + case "bicep": + return SerializeBicep(options); + default: + throw new FormatException($"The model {nameof(BaseCopyJobTask)} does not support writing '{options.Format}' format."); + } + } + + BaseCopyJobTask 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 DeserializeBaseCopyJobTask(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(BaseCopyJobTask)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/BaseCopyJobTask.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/BaseCopyJobTask.cs new file mode 100644 index 000000000000..8323485727c5 --- /dev/null +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/BaseCopyJobTask.cs @@ -0,0 +1,71 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.CosmosDB.Models +{ + /// The properties of a Copy Job Task. + public partial class BaseCopyJobTask + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private protected IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public BaseCopyJobTask() + { + } + + /// Initializes a new instance of . + /// Task level Total Count. + /// Task level Processed Count. + /// Keeps track of any properties unknown to the library. + internal BaseCopyJobTask(long? totalCount, long? processedCount, IDictionary serializedAdditionalRawData) + { + TotalCount = totalCount; + ProcessedCount = processedCount; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Task level Total Count. + [WirePath("totalCount")] + public long? TotalCount { get; } + /// Task level Processed Count. + [WirePath("processedCount")] + public long? ProcessedCount { get; } + } +} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/BlobToCassandraRUCopyJobProperties.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/BlobToCassandraRUCopyJobProperties.Serialization.cs new file mode 100644 index 000000000000..e3c9ed9ea794 --- /dev/null +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/BlobToCassandraRUCopyJobProperties.Serialization.cs @@ -0,0 +1,241 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.CosmosDB.Models +{ + public partial class BlobToCassandraRUCopyJobProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(BlobToCassandraRUCopyJobProperties)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + writer.WritePropertyName("sourceDetails"u8); + writer.WriteObjectValue(SourceDetails, options); + if (Optional.IsDefined(DestinationDetails)) + { + writer.WritePropertyName("destinationDetails"u8); + writer.WriteObjectValue(DestinationDetails, options); + } + writer.WritePropertyName("tasks"u8); + writer.WriteStartArray(); + foreach (var item in Tasks) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + + BlobToCassandraRUCopyJobProperties 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(BlobToCassandraRUCopyJobProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeBlobToCassandraRUCopyJobProperties(document.RootElement, options); + } + + internal static BlobToCassandraRUCopyJobProperties DeserializeBlobToCassandraRUCopyJobProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + AzureBlobSourceSinkDetails sourceDetails = default; + CosmosDBSourceSinkDetails destinationDetails = default; + IList tasks = default; + CopyJobType jobType = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("sourceDetails"u8)) + { + sourceDetails = AzureBlobSourceSinkDetails.DeserializeAzureBlobSourceSinkDetails(property.Value, options); + continue; + } + if (property.NameEquals("destinationDetails"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + destinationDetails = CosmosDBSourceSinkDetails.DeserializeCosmosDBSourceSinkDetails(property.Value, options); + continue; + } + if (property.NameEquals("tasks"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(BlobToCassandraRUCopyJobTask.DeserializeBlobToCassandraRUCopyJobTask(item, options)); + } + tasks = array; + continue; + } + if (property.NameEquals("jobType"u8)) + { + jobType = new CopyJobType(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new BlobToCassandraRUCopyJobProperties(jobType, serializedAdditionalRawData, sourceDetails, destinationDetails, tasks); + } + + private BinaryData SerializeBicep(ModelReaderWriterOptions options) + { + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue("SourceDetailsEndpointUri", out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" sourceDetails: "); + builder.AppendLine("{"); + builder.Append(" endpointUrl: "); + builder.AppendLine(propertyOverride); + builder.AppendLine(" }"); + } + else + { + if (Optional.IsDefined(SourceDetails)) + { + builder.Append(" sourceDetails: "); + BicepSerializationHelpers.AppendChildObject(builder, SourceDetails, options, 2, false, " sourceDetails: "); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue("DestinationDetailsRemoteAccountName", out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" destinationDetails: "); + builder.AppendLine("{"); + builder.Append(" remoteAccountName: "); + builder.AppendLine(propertyOverride); + builder.AppendLine(" }"); + } + else + { + if (Optional.IsDefined(DestinationDetails)) + { + builder.Append(" destinationDetails: "); + BicepSerializationHelpers.AppendChildObject(builder, DestinationDetails, options, 2, false, " destinationDetails: "); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Tasks), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" tasks: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsCollectionDefined(Tasks)) + { + if (Tasks.Any()) + { + builder.Append(" tasks: "); + builder.AppendLine("["); + foreach (var item in Tasks) + { + BicepSerializationHelpers.AppendChildObject(builder, item, options, 4, true, " tasks: "); + } + builder.AppendLine(" ]"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(JobType), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" jobType: "); + builder.AppendLine(propertyOverride); + } + else + { + builder.Append(" jobType: "); + builder.AppendLine($"'{JobType.ToString()}'"); + } + + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + case "bicep": + return SerializeBicep(options); + default: + throw new FormatException($"The model {nameof(BlobToCassandraRUCopyJobProperties)} does not support writing '{options.Format}' format."); + } + } + + BlobToCassandraRUCopyJobProperties 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 DeserializeBlobToCassandraRUCopyJobProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(BlobToCassandraRUCopyJobProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/BlobToCassandraRUCopyJobProperties.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/BlobToCassandraRUCopyJobProperties.cs new file mode 100644 index 000000000000..ed070b23ee8f --- /dev/null +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/BlobToCassandraRUCopyJobProperties.cs @@ -0,0 +1,79 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.ResourceManager.CosmosDB.Models +{ + /// Source Azure Blob Storage to Destination Cassandra copy job properties. + public partial class BlobToCassandraRUCopyJobProperties : BaseCopyJobProperties + { + /// Initializes a new instance of . + /// Azure Storage container DataStore details. + /// Copy Job tasks. + /// or is null. + public BlobToCassandraRUCopyJobProperties(AzureBlobSourceSinkDetails sourceDetails, IEnumerable tasks) + { + Argument.AssertNotNull(sourceDetails, nameof(sourceDetails)); + Argument.AssertNotNull(tasks, nameof(tasks)); + + SourceDetails = sourceDetails; + Tasks = tasks.ToList(); + JobType = CopyJobType.AzureBlobStorageToCassandraRU; + } + + /// Initializes a new instance of . + /// Copy Job Type. + /// Keeps track of any properties unknown to the library. + /// Azure Storage container DataStore details. + /// Destination Cassandra DataStore details. + /// Copy Job tasks. + internal BlobToCassandraRUCopyJobProperties(CopyJobType jobType, IDictionary serializedAdditionalRawData, AzureBlobSourceSinkDetails sourceDetails, CosmosDBSourceSinkDetails destinationDetails, IList tasks) : base(jobType, serializedAdditionalRawData) + { + SourceDetails = sourceDetails; + DestinationDetails = destinationDetails; + Tasks = tasks; + JobType = jobType; + } + + /// Initializes a new instance of for deserialization. + internal BlobToCassandraRUCopyJobProperties() + { + } + + /// Azure Storage container DataStore details. + internal AzureBlobSourceSinkDetails SourceDetails { get; set; } + /// Azure Blob container endpoint. + [WirePath("sourceDetails.endpointUrl")] + public Uri SourceDetailsEndpointUri + { + get => SourceDetails is null ? default : SourceDetails.EndpointUri; + set => SourceDetails = new AzureBlobSourceSinkDetails(value); + } + + /// Destination Cassandra DataStore details. + internal CosmosDBSourceSinkDetails DestinationDetails { get; set; } + /// Name of remote account in case of cross-account data transfer. + [WirePath("destinationDetails.remoteAccountName")] + public string DestinationDetailsRemoteAccountName + { + get => DestinationDetails is null ? default : DestinationDetails.RemoteAccountName; + set + { + if (DestinationDetails is null) + DestinationDetails = new CosmosDBSourceSinkDetails(); + DestinationDetails.RemoteAccountName = value; + } + } + + /// Copy Job tasks. + [WirePath("tasks")] + public IList Tasks { get; } + } +} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/BlobToCassandraRUCopyJobTask.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/BlobToCassandraRUCopyJobTask.Serialization.cs new file mode 100644 index 000000000000..be8f5d6f761a --- /dev/null +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/BlobToCassandraRUCopyJobTask.Serialization.cs @@ -0,0 +1,221 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.CosmosDB.Models +{ + public partial class BlobToCassandraRUCopyJobTask : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(BlobToCassandraRUCopyJobTask)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + writer.WritePropertyName("source"u8); + writer.WriteObjectValue(Source, options); + writer.WritePropertyName("destination"u8); + writer.WriteObjectValue(Destination, options); + } + + BlobToCassandraRUCopyJobTask 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(BlobToCassandraRUCopyJobTask)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeBlobToCassandraRUCopyJobTask(document.RootElement, options); + } + + internal static BlobToCassandraRUCopyJobTask DeserializeBlobToCassandraRUCopyJobTask(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + AzureBlobContainer source = default; + CosmosDBCassandraTable destination = default; + long? totalCount = default; + long? processedCount = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("source"u8)) + { + source = AzureBlobContainer.DeserializeAzureBlobContainer(property.Value, options); + continue; + } + if (property.NameEquals("destination"u8)) + { + destination = CosmosDBCassandraTable.DeserializeCosmosDBCassandraTable(property.Value, options); + continue; + } + if (property.NameEquals("totalCount"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + totalCount = property.Value.GetInt64(); + continue; + } + if (property.NameEquals("processedCount"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + processedCount = property.Value.GetInt64(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new BlobToCassandraRUCopyJobTask(totalCount, processedCount, serializedAdditionalRawData, source, destination); + } + + private BinaryData SerializeBicep(ModelReaderWriterOptions options) + { + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue("SourceContainerName", out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" source: "); + builder.AppendLine("{"); + builder.Append(" containerName: "); + builder.AppendLine(propertyOverride); + builder.AppendLine(" }"); + } + else + { + if (Optional.IsDefined(Source)) + { + builder.Append(" source: "); + BicepSerializationHelpers.AppendChildObject(builder, Source, options, 2, false, " source: "); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Destination), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" destination: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Destination)) + { + builder.Append(" destination: "); + BicepSerializationHelpers.AppendChildObject(builder, Destination, options, 2, false, " destination: "); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(TotalCount), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" totalCount: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(TotalCount)) + { + builder.Append(" totalCount: "); + builder.AppendLine($"'{TotalCount.Value.ToString()}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(ProcessedCount), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" processedCount: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(ProcessedCount)) + { + builder.Append(" processedCount: "); + builder.AppendLine($"'{ProcessedCount.Value.ToString()}'"); + } + } + + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + case "bicep": + return SerializeBicep(options); + default: + throw new FormatException($"The model {nameof(BlobToCassandraRUCopyJobTask)} does not support writing '{options.Format}' format."); + } + } + + BlobToCassandraRUCopyJobTask 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 DeserializeBlobToCassandraRUCopyJobTask(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(BlobToCassandraRUCopyJobTask)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/BlobToCassandraRUCopyJobTask.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/BlobToCassandraRUCopyJobTask.cs new file mode 100644 index 000000000000..e1738b818b08 --- /dev/null +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/BlobToCassandraRUCopyJobTask.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.CosmosDB.Models +{ + /// The BlobToCassandraRUCopyJobTask. + public partial class BlobToCassandraRUCopyJobTask : BaseCopyJobTask + { + /// Initializes a new instance of . + /// Source Azure Blob container. + /// Destination Cassandra table. + /// or is null. + public BlobToCassandraRUCopyJobTask(AzureBlobContainer source, CosmosDBCassandraTable destination) + { + Argument.AssertNotNull(source, nameof(source)); + Argument.AssertNotNull(destination, nameof(destination)); + + Source = source; + Destination = destination; + } + + /// Initializes a new instance of . + /// Task level Total Count. + /// Task level Processed Count. + /// Keeps track of any properties unknown to the library. + /// Source Azure Blob container. + /// Destination Cassandra table. + internal BlobToCassandraRUCopyJobTask(long? totalCount, long? processedCount, IDictionary serializedAdditionalRawData, AzureBlobContainer source, CosmosDBCassandraTable destination) : base(totalCount, processedCount, serializedAdditionalRawData) + { + Source = source; + Destination = destination; + } + + /// Initializes a new instance of for deserialization. + internal BlobToCassandraRUCopyJobTask() + { + } + + /// Source Azure Blob container. + internal AzureBlobContainer Source { get; set; } + /// Azure Blob container. + [WirePath("source.containerName")] + public string SourceContainerName + { + get => Source is null ? default : Source.ContainerName; + set => Source = new AzureBlobContainer(value); + } + + /// Destination Cassandra table. + [WirePath("destination")] + public CosmosDBCassandraTable Destination { get; set; } + } +} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraRUToBlobCopyJobProperties.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraRUToBlobCopyJobProperties.Serialization.cs new file mode 100644 index 000000000000..35d36987c5e6 --- /dev/null +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraRUToBlobCopyJobProperties.Serialization.cs @@ -0,0 +1,241 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.CosmosDB.Models +{ + public partial class CassandraRUToBlobCopyJobProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(CassandraRUToBlobCopyJobProperties)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + if (Optional.IsDefined(SourceDetails)) + { + writer.WritePropertyName("sourceDetails"u8); + writer.WriteObjectValue(SourceDetails, options); + } + writer.WritePropertyName("destinationDetails"u8); + writer.WriteObjectValue(DestinationDetails, options); + writer.WritePropertyName("tasks"u8); + writer.WriteStartArray(); + foreach (var item in Tasks) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + + CassandraRUToBlobCopyJobProperties 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(CassandraRUToBlobCopyJobProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeCassandraRUToBlobCopyJobProperties(document.RootElement, options); + } + + internal static CassandraRUToBlobCopyJobProperties DeserializeCassandraRUToBlobCopyJobProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + CosmosDBSourceSinkDetails sourceDetails = default; + AzureBlobSourceSinkDetails destinationDetails = default; + IList tasks = default; + CopyJobType jobType = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("sourceDetails"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + sourceDetails = CosmosDBSourceSinkDetails.DeserializeCosmosDBSourceSinkDetails(property.Value, options); + continue; + } + if (property.NameEquals("destinationDetails"u8)) + { + destinationDetails = AzureBlobSourceSinkDetails.DeserializeAzureBlobSourceSinkDetails(property.Value, options); + continue; + } + if (property.NameEquals("tasks"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(CassandraRUToBlobCopyJobTask.DeserializeCassandraRUToBlobCopyJobTask(item, options)); + } + tasks = array; + continue; + } + if (property.NameEquals("jobType"u8)) + { + jobType = new CopyJobType(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new CassandraRUToBlobCopyJobProperties(jobType, serializedAdditionalRawData, sourceDetails, destinationDetails, tasks); + } + + private BinaryData SerializeBicep(ModelReaderWriterOptions options) + { + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue("SourceDetailsRemoteAccountName", out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" sourceDetails: "); + builder.AppendLine("{"); + builder.Append(" remoteAccountName: "); + builder.AppendLine(propertyOverride); + builder.AppendLine(" }"); + } + else + { + if (Optional.IsDefined(SourceDetails)) + { + builder.Append(" sourceDetails: "); + BicepSerializationHelpers.AppendChildObject(builder, SourceDetails, options, 2, false, " sourceDetails: "); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue("DestinationDetailsEndpointUri", out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" destinationDetails: "); + builder.AppendLine("{"); + builder.Append(" endpointUrl: "); + builder.AppendLine(propertyOverride); + builder.AppendLine(" }"); + } + else + { + if (Optional.IsDefined(DestinationDetails)) + { + builder.Append(" destinationDetails: "); + BicepSerializationHelpers.AppendChildObject(builder, DestinationDetails, options, 2, false, " destinationDetails: "); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Tasks), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" tasks: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsCollectionDefined(Tasks)) + { + if (Tasks.Any()) + { + builder.Append(" tasks: "); + builder.AppendLine("["); + foreach (var item in Tasks) + { + BicepSerializationHelpers.AppendChildObject(builder, item, options, 4, true, " tasks: "); + } + builder.AppendLine(" ]"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(JobType), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" jobType: "); + builder.AppendLine(propertyOverride); + } + else + { + builder.Append(" jobType: "); + builder.AppendLine($"'{JobType.ToString()}'"); + } + + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + case "bicep": + return SerializeBicep(options); + default: + throw new FormatException($"The model {nameof(CassandraRUToBlobCopyJobProperties)} does not support writing '{options.Format}' format."); + } + } + + CassandraRUToBlobCopyJobProperties 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 DeserializeCassandraRUToBlobCopyJobProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(CassandraRUToBlobCopyJobProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraRUToBlobCopyJobProperties.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraRUToBlobCopyJobProperties.cs new file mode 100644 index 000000000000..adf560e5425d --- /dev/null +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraRUToBlobCopyJobProperties.cs @@ -0,0 +1,79 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.ResourceManager.CosmosDB.Models +{ + /// Source Cassandra to Destination Azure Blob Storage copy job properties. + public partial class CassandraRUToBlobCopyJobProperties : BaseCopyJobProperties + { + /// Initializes a new instance of . + /// Destination Cassandra DataStore details. + /// Copy Job tasks. + /// or is null. + public CassandraRUToBlobCopyJobProperties(AzureBlobSourceSinkDetails destinationDetails, IEnumerable tasks) + { + Argument.AssertNotNull(destinationDetails, nameof(destinationDetails)); + Argument.AssertNotNull(tasks, nameof(tasks)); + + DestinationDetails = destinationDetails; + Tasks = tasks.ToList(); + JobType = CopyJobType.CassandraRUToAzureBlobStorage; + } + + /// Initializes a new instance of . + /// Copy Job Type. + /// Keeps track of any properties unknown to the library. + /// Source Cassandra DataStore details. + /// Destination Cassandra DataStore details. + /// Copy Job tasks. + internal CassandraRUToBlobCopyJobProperties(CopyJobType jobType, IDictionary serializedAdditionalRawData, CosmosDBSourceSinkDetails sourceDetails, AzureBlobSourceSinkDetails destinationDetails, IList tasks) : base(jobType, serializedAdditionalRawData) + { + SourceDetails = sourceDetails; + DestinationDetails = destinationDetails; + Tasks = tasks; + JobType = jobType; + } + + /// Initializes a new instance of for deserialization. + internal CassandraRUToBlobCopyJobProperties() + { + } + + /// Source Cassandra DataStore details. + internal CosmosDBSourceSinkDetails SourceDetails { get; set; } + /// Name of remote account in case of cross-account data transfer. + [WirePath("sourceDetails.remoteAccountName")] + public string SourceDetailsRemoteAccountName + { + get => SourceDetails is null ? default : SourceDetails.RemoteAccountName; + set + { + if (SourceDetails is null) + SourceDetails = new CosmosDBSourceSinkDetails(); + SourceDetails.RemoteAccountName = value; + } + } + + /// Destination Cassandra DataStore details. + internal AzureBlobSourceSinkDetails DestinationDetails { get; set; } + /// Azure Blob container endpoint. + [WirePath("destinationDetails.endpointUrl")] + public Uri DestinationDetailsEndpointUri + { + get => DestinationDetails is null ? default : DestinationDetails.EndpointUri; + set => DestinationDetails = new AzureBlobSourceSinkDetails(value); + } + + /// Copy Job tasks. + [WirePath("tasks")] + public IList Tasks { get; } + } +} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraRUToBlobCopyJobTask.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraRUToBlobCopyJobTask.Serialization.cs new file mode 100644 index 000000000000..4babe0a3d505 --- /dev/null +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraRUToBlobCopyJobTask.Serialization.cs @@ -0,0 +1,221 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.CosmosDB.Models +{ + public partial class CassandraRUToBlobCopyJobTask : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(CassandraRUToBlobCopyJobTask)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + writer.WritePropertyName("source"u8); + writer.WriteObjectValue(Source, options); + writer.WritePropertyName("destination"u8); + writer.WriteObjectValue(Destination, options); + } + + CassandraRUToBlobCopyJobTask 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(CassandraRUToBlobCopyJobTask)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeCassandraRUToBlobCopyJobTask(document.RootElement, options); + } + + internal static CassandraRUToBlobCopyJobTask DeserializeCassandraRUToBlobCopyJobTask(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + CosmosDBCassandraTable source = default; + AzureBlobContainer destination = default; + long? totalCount = default; + long? processedCount = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("source"u8)) + { + source = CosmosDBCassandraTable.DeserializeCosmosDBCassandraTable(property.Value, options); + continue; + } + if (property.NameEquals("destination"u8)) + { + destination = AzureBlobContainer.DeserializeAzureBlobContainer(property.Value, options); + continue; + } + if (property.NameEquals("totalCount"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + totalCount = property.Value.GetInt64(); + continue; + } + if (property.NameEquals("processedCount"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + processedCount = property.Value.GetInt64(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new CassandraRUToBlobCopyJobTask(totalCount, processedCount, serializedAdditionalRawData, source, destination); + } + + private BinaryData SerializeBicep(ModelReaderWriterOptions options) + { + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Source), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" source: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Source)) + { + builder.Append(" source: "); + BicepSerializationHelpers.AppendChildObject(builder, Source, options, 2, false, " source: "); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue("DestinationContainerName", out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" destination: "); + builder.AppendLine("{"); + builder.Append(" containerName: "); + builder.AppendLine(propertyOverride); + builder.AppendLine(" }"); + } + else + { + if (Optional.IsDefined(Destination)) + { + builder.Append(" destination: "); + BicepSerializationHelpers.AppendChildObject(builder, Destination, options, 2, false, " destination: "); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(TotalCount), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" totalCount: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(TotalCount)) + { + builder.Append(" totalCount: "); + builder.AppendLine($"'{TotalCount.Value.ToString()}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(ProcessedCount), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" processedCount: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(ProcessedCount)) + { + builder.Append(" processedCount: "); + builder.AppendLine($"'{ProcessedCount.Value.ToString()}'"); + } + } + + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + case "bicep": + return SerializeBicep(options); + default: + throw new FormatException($"The model {nameof(CassandraRUToBlobCopyJobTask)} does not support writing '{options.Format}' format."); + } + } + + CassandraRUToBlobCopyJobTask 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 DeserializeCassandraRUToBlobCopyJobTask(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(CassandraRUToBlobCopyJobTask)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraRUToBlobCopyJobTask.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraRUToBlobCopyJobTask.cs new file mode 100644 index 000000000000..0cb34d12a72b --- /dev/null +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraRUToBlobCopyJobTask.cs @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.CosmosDB.Models +{ + /// The CassandraRUToBlobCopyJobTask. + public partial class CassandraRUToBlobCopyJobTask : BaseCopyJobTask + { + /// Initializes a new instance of . + /// Source Cassandra table. + /// Destination Azure Blob container. + /// or is null. + public CassandraRUToBlobCopyJobTask(CosmosDBCassandraTable source, AzureBlobContainer destination) + { + Argument.AssertNotNull(source, nameof(source)); + Argument.AssertNotNull(destination, nameof(destination)); + + Source = source; + Destination = destination; + } + + /// Initializes a new instance of . + /// Task level Total Count. + /// Task level Processed Count. + /// Keeps track of any properties unknown to the library. + /// Source Cassandra table. + /// Destination Azure Blob container. + internal CassandraRUToBlobCopyJobTask(long? totalCount, long? processedCount, IDictionary serializedAdditionalRawData, CosmosDBCassandraTable source, AzureBlobContainer destination) : base(totalCount, processedCount, serializedAdditionalRawData) + { + Source = source; + Destination = destination; + } + + /// Initializes a new instance of for deserialization. + internal CassandraRUToBlobCopyJobTask() + { + } + + /// Source Cassandra table. + [WirePath("source")] + public CosmosDBCassandraTable Source { get; set; } + /// Destination Azure Blob container. + internal AzureBlobContainer Destination { get; set; } + /// Azure Blob container. + [WirePath("destination.containerName")] + public string DestinationContainerName + { + get => Destination is null ? default : Destination.ContainerName; + set => Destination = new AzureBlobContainer(value); + } + } +} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraRUToCassandraRUCopyJobProperties.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraRUToCassandraRUCopyJobProperties.Serialization.cs new file mode 100644 index 000000000000..ed84e01c988f --- /dev/null +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraRUToCassandraRUCopyJobProperties.Serialization.cs @@ -0,0 +1,248 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.CosmosDB.Models +{ + public partial class CassandraRUToCassandraRUCopyJobProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(CassandraRUToCassandraRUCopyJobProperties)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + if (Optional.IsDefined(SourceDetails)) + { + writer.WritePropertyName("sourceDetails"u8); + writer.WriteObjectValue(SourceDetails, options); + } + if (Optional.IsDefined(DestinationDetails)) + { + writer.WritePropertyName("destinationDetails"u8); + writer.WriteObjectValue(DestinationDetails, options); + } + writer.WritePropertyName("tasks"u8); + writer.WriteStartArray(); + foreach (var item in Tasks) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + + CassandraRUToCassandraRUCopyJobProperties 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(CassandraRUToCassandraRUCopyJobProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeCassandraRUToCassandraRUCopyJobProperties(document.RootElement, options); + } + + internal static CassandraRUToCassandraRUCopyJobProperties DeserializeCassandraRUToCassandraRUCopyJobProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + CosmosDBSourceSinkDetails sourceDetails = default; + CosmosDBSourceSinkDetails destinationDetails = default; + IList tasks = default; + CopyJobType jobType = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("sourceDetails"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + sourceDetails = CosmosDBSourceSinkDetails.DeserializeCosmosDBSourceSinkDetails(property.Value, options); + continue; + } + if (property.NameEquals("destinationDetails"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + destinationDetails = CosmosDBSourceSinkDetails.DeserializeCosmosDBSourceSinkDetails(property.Value, options); + continue; + } + if (property.NameEquals("tasks"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(CassandraRUToCassandraRUCopyJobTask.DeserializeCassandraRUToCassandraRUCopyJobTask(item, options)); + } + tasks = array; + continue; + } + if (property.NameEquals("jobType"u8)) + { + jobType = new CopyJobType(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new CassandraRUToCassandraRUCopyJobProperties(jobType, serializedAdditionalRawData, sourceDetails, destinationDetails, tasks); + } + + private BinaryData SerializeBicep(ModelReaderWriterOptions options) + { + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue("SourceDetailsRemoteAccountName", out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" sourceDetails: "); + builder.AppendLine("{"); + builder.Append(" remoteAccountName: "); + builder.AppendLine(propertyOverride); + builder.AppendLine(" }"); + } + else + { + if (Optional.IsDefined(SourceDetails)) + { + builder.Append(" sourceDetails: "); + BicepSerializationHelpers.AppendChildObject(builder, SourceDetails, options, 2, false, " sourceDetails: "); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue("DestinationDetailsRemoteAccountName", out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" destinationDetails: "); + builder.AppendLine("{"); + builder.Append(" remoteAccountName: "); + builder.AppendLine(propertyOverride); + builder.AppendLine(" }"); + } + else + { + if (Optional.IsDefined(DestinationDetails)) + { + builder.Append(" destinationDetails: "); + BicepSerializationHelpers.AppendChildObject(builder, DestinationDetails, options, 2, false, " destinationDetails: "); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Tasks), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" tasks: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsCollectionDefined(Tasks)) + { + if (Tasks.Any()) + { + builder.Append(" tasks: "); + builder.AppendLine("["); + foreach (var item in Tasks) + { + BicepSerializationHelpers.AppendChildObject(builder, item, options, 4, true, " tasks: "); + } + builder.AppendLine(" ]"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(JobType), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" jobType: "); + builder.AppendLine(propertyOverride); + } + else + { + builder.Append(" jobType: "); + builder.AppendLine($"'{JobType.ToString()}'"); + } + + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + case "bicep": + return SerializeBicep(options); + default: + throw new FormatException($"The model {nameof(CassandraRUToCassandraRUCopyJobProperties)} does not support writing '{options.Format}' format."); + } + } + + CassandraRUToCassandraRUCopyJobProperties 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 DeserializeCassandraRUToCassandraRUCopyJobProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(CassandraRUToCassandraRUCopyJobProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraRUToCassandraRUCopyJobProperties.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraRUToCassandraRUCopyJobProperties.cs new file mode 100644 index 000000000000..df1aff902d19 --- /dev/null +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraRUToCassandraRUCopyJobProperties.cs @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.ResourceManager.CosmosDB.Models +{ + /// Source Cassandra to Destination Cassandra copy job properties. + public partial class CassandraRUToCassandraRUCopyJobProperties : BaseCopyJobProperties + { + /// Initializes a new instance of . + /// Copy Job tasks. + /// is null. + public CassandraRUToCassandraRUCopyJobProperties(IEnumerable tasks) + { + Argument.AssertNotNull(tasks, nameof(tasks)); + + Tasks = tasks.ToList(); + JobType = CopyJobType.CassandraRUToCassandraRU; + } + + /// Initializes a new instance of . + /// Copy Job Type. + /// Keeps track of any properties unknown to the library. + /// Source Cassandra DataStore details. + /// Destination Cassandra DataStore details. + /// Copy Job tasks. + internal CassandraRUToCassandraRUCopyJobProperties(CopyJobType jobType, IDictionary serializedAdditionalRawData, CosmosDBSourceSinkDetails sourceDetails, CosmosDBSourceSinkDetails destinationDetails, IList tasks) : base(jobType, serializedAdditionalRawData) + { + SourceDetails = sourceDetails; + DestinationDetails = destinationDetails; + Tasks = tasks; + JobType = jobType; + } + + /// Initializes a new instance of for deserialization. + internal CassandraRUToCassandraRUCopyJobProperties() + { + } + + /// Source Cassandra DataStore details. + internal CosmosDBSourceSinkDetails SourceDetails { get; set; } + /// Name of remote account in case of cross-account data transfer. + [WirePath("sourceDetails.remoteAccountName")] + public string SourceDetailsRemoteAccountName + { + get => SourceDetails is null ? default : SourceDetails.RemoteAccountName; + set + { + if (SourceDetails is null) + SourceDetails = new CosmosDBSourceSinkDetails(); + SourceDetails.RemoteAccountName = value; + } + } + + /// Destination Cassandra DataStore details. + internal CosmosDBSourceSinkDetails DestinationDetails { get; set; } + /// Name of remote account in case of cross-account data transfer. + [WirePath("destinationDetails.remoteAccountName")] + public string DestinationDetailsRemoteAccountName + { + get => DestinationDetails is null ? default : DestinationDetails.RemoteAccountName; + set + { + if (DestinationDetails is null) + DestinationDetails = new CosmosDBSourceSinkDetails(); + DestinationDetails.RemoteAccountName = value; + } + } + + /// Copy Job tasks. + [WirePath("tasks")] + public IList Tasks { get; } + } +} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraRUToCassandraRUCopyJobTask.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraRUToCassandraRUCopyJobTask.Serialization.cs new file mode 100644 index 000000000000..944b60e23195 --- /dev/null +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraRUToCassandraRUCopyJobTask.Serialization.cs @@ -0,0 +1,218 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.CosmosDB.Models +{ + public partial class CassandraRUToCassandraRUCopyJobTask : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(CassandraRUToCassandraRUCopyJobTask)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + writer.WritePropertyName("source"u8); + writer.WriteObjectValue(Source, options); + writer.WritePropertyName("destination"u8); + writer.WriteObjectValue(Destination, options); + } + + CassandraRUToCassandraRUCopyJobTask 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(CassandraRUToCassandraRUCopyJobTask)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeCassandraRUToCassandraRUCopyJobTask(document.RootElement, options); + } + + internal static CassandraRUToCassandraRUCopyJobTask DeserializeCassandraRUToCassandraRUCopyJobTask(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + CosmosDBCassandraTable source = default; + CosmosDBCassandraTable destination = default; + long? totalCount = default; + long? processedCount = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("source"u8)) + { + source = CosmosDBCassandraTable.DeserializeCosmosDBCassandraTable(property.Value, options); + continue; + } + if (property.NameEquals("destination"u8)) + { + destination = CosmosDBCassandraTable.DeserializeCosmosDBCassandraTable(property.Value, options); + continue; + } + if (property.NameEquals("totalCount"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + totalCount = property.Value.GetInt64(); + continue; + } + if (property.NameEquals("processedCount"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + processedCount = property.Value.GetInt64(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new CassandraRUToCassandraRUCopyJobTask(totalCount, processedCount, serializedAdditionalRawData, source, destination); + } + + private BinaryData SerializeBicep(ModelReaderWriterOptions options) + { + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Source), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" source: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Source)) + { + builder.Append(" source: "); + BicepSerializationHelpers.AppendChildObject(builder, Source, options, 2, false, " source: "); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Destination), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" destination: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Destination)) + { + builder.Append(" destination: "); + BicepSerializationHelpers.AppendChildObject(builder, Destination, options, 2, false, " destination: "); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(TotalCount), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" totalCount: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(TotalCount)) + { + builder.Append(" totalCount: "); + builder.AppendLine($"'{TotalCount.Value.ToString()}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(ProcessedCount), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" processedCount: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(ProcessedCount)) + { + builder.Append(" processedCount: "); + builder.AppendLine($"'{ProcessedCount.Value.ToString()}'"); + } + } + + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + case "bicep": + return SerializeBicep(options); + default: + throw new FormatException($"The model {nameof(CassandraRUToCassandraRUCopyJobTask)} does not support writing '{options.Format}' format."); + } + } + + CassandraRUToCassandraRUCopyJobTask 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 DeserializeCassandraRUToCassandraRUCopyJobTask(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(CassandraRUToCassandraRUCopyJobTask)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraRUToCassandraRUCopyJobTask.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraRUToCassandraRUCopyJobTask.cs new file mode 100644 index 000000000000..27c54c6682ea --- /dev/null +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraRUToCassandraRUCopyJobTask.cs @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.CosmosDB.Models +{ + /// The CassandraRUToCassandraRUCopyJobTask. + public partial class CassandraRUToCassandraRUCopyJobTask : BaseCopyJobTask + { + /// Initializes a new instance of . + /// Source Cassandra table. + /// Destination Cassandra table. + /// or is null. + public CassandraRUToCassandraRUCopyJobTask(CosmosDBCassandraTable source, CosmosDBCassandraTable destination) + { + Argument.AssertNotNull(source, nameof(source)); + Argument.AssertNotNull(destination, nameof(destination)); + + Source = source; + Destination = destination; + } + + /// Initializes a new instance of . + /// Task level Total Count. + /// Task level Processed Count. + /// Keeps track of any properties unknown to the library. + /// Source Cassandra table. + /// Destination Cassandra table. + internal CassandraRUToCassandraRUCopyJobTask(long? totalCount, long? processedCount, IDictionary serializedAdditionalRawData, CosmosDBCassandraTable source, CosmosDBCassandraTable destination) : base(totalCount, processedCount, serializedAdditionalRawData) + { + Source = source; + Destination = destination; + } + + /// Initializes a new instance of for deserialization. + internal CassandraRUToCassandraRUCopyJobTask() + { + } + + /// Source Cassandra table. + [WirePath("source")] + public CosmosDBCassandraTable Source { get; set; } + /// Destination Cassandra table. + [WirePath("destination")] + public CosmosDBCassandraTable Destination { get; set; } + } +} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraRoleAssignmentListResult.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraRoleAssignmentListResult.Serialization.cs new file mode 100644 index 000000000000..ad47c95011d7 --- /dev/null +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraRoleAssignmentListResult.Serialization.cs @@ -0,0 +1,219 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.CosmosDB.Models +{ + internal partial class CassandraRoleAssignmentListResult : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(CassandraRoleAssignmentListResult)} does not support writing '{format}' format."); + } + + if (options.Format != "W" && Optional.IsCollectionDefined(Value)) + { + writer.WritePropertyName("value"u8); + writer.WriteStartArray(); + foreach (var item in Value) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && Optional.IsDefined(NextLink)) + { + writer.WritePropertyName("nextLink"u8); + writer.WriteStringValue(NextLink); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + CassandraRoleAssignmentListResult 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(CassandraRoleAssignmentListResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeCassandraRoleAssignmentListResult(document.RootElement, options); + } + + internal static CassandraRoleAssignmentListResult DeserializeCassandraRoleAssignmentListResult(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IReadOnlyList value = default; + string nextLink = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(CassandraRoleAssignmentResourceData.DeserializeCassandraRoleAssignmentResourceData(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 CassandraRoleAssignmentListResult(value ?? new ChangeTrackingList(), nextLink, serializedAdditionalRawData); + } + + private BinaryData SerializeBicep(ModelReaderWriterOptions options) + { + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Value), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" value: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsCollectionDefined(Value)) + { + if (Value.Any()) + { + builder.Append(" value: "); + builder.AppendLine("["); + foreach (var item in Value) + { + BicepSerializationHelpers.AppendChildObject(builder, item, options, 4, true, " value: "); + } + builder.AppendLine(" ]"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(NextLink), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" nextLink: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(NextLink)) + { + builder.Append(" nextLink: "); + if (NextLink.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{NextLink}'''"); + } + else + { + builder.AppendLine($"'{NextLink}'"); + } + } + } + + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + case "bicep": + return SerializeBicep(options); + default: + throw new FormatException($"The model {nameof(CassandraRoleAssignmentListResult)} does not support writing '{options.Format}' format."); + } + } + + CassandraRoleAssignmentListResult 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 DeserializeCassandraRoleAssignmentListResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(CassandraRoleAssignmentListResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraRoleAssignmentListResult.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraRoleAssignmentListResult.cs new file mode 100644 index 000000000000..83917166e254 --- /dev/null +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraRoleAssignmentListResult.cs @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.CosmosDB.Models +{ + /// The relevant Role Assignments. + internal partial class CassandraRoleAssignmentListResult + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + internal CassandraRoleAssignmentListResult() + { + Value = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// List of Role Assignments and their properties. + /// The link used to get the next page of results. + /// Keeps track of any properties unknown to the library. + internal CassandraRoleAssignmentListResult(IReadOnlyList value, string nextLink, IDictionary serializedAdditionalRawData) + { + Value = value; + NextLink = nextLink; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// List of Role Assignments and their properties. + public IReadOnlyList Value { get; } + /// The link used to get the next page of results. + public string NextLink { get; } + } +} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraRoleDefinitionListResult.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraRoleDefinitionListResult.Serialization.cs new file mode 100644 index 000000000000..6a8be98c502f --- /dev/null +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraRoleDefinitionListResult.Serialization.cs @@ -0,0 +1,219 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.CosmosDB.Models +{ + internal partial class CassandraRoleDefinitionListResult : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(CassandraRoleDefinitionListResult)} does not support writing '{format}' format."); + } + + if (options.Format != "W" && Optional.IsCollectionDefined(Value)) + { + writer.WritePropertyName("value"u8); + writer.WriteStartArray(); + foreach (var item in Value) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && Optional.IsDefined(NextLink)) + { + writer.WritePropertyName("nextLink"u8); + writer.WriteStringValue(NextLink); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + CassandraRoleDefinitionListResult 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(CassandraRoleDefinitionListResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeCassandraRoleDefinitionListResult(document.RootElement, options); + } + + internal static CassandraRoleDefinitionListResult DeserializeCassandraRoleDefinitionListResult(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IReadOnlyList value = default; + string nextLink = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(CassandraRoleDefinitionResourceData.DeserializeCassandraRoleDefinitionResourceData(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 CassandraRoleDefinitionListResult(value ?? new ChangeTrackingList(), nextLink, serializedAdditionalRawData); + } + + private BinaryData SerializeBicep(ModelReaderWriterOptions options) + { + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Value), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" value: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsCollectionDefined(Value)) + { + if (Value.Any()) + { + builder.Append(" value: "); + builder.AppendLine("["); + foreach (var item in Value) + { + BicepSerializationHelpers.AppendChildObject(builder, item, options, 4, true, " value: "); + } + builder.AppendLine(" ]"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(NextLink), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" nextLink: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(NextLink)) + { + builder.Append(" nextLink: "); + if (NextLink.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{NextLink}'''"); + } + else + { + builder.AppendLine($"'{NextLink}'"); + } + } + } + + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + case "bicep": + return SerializeBicep(options); + default: + throw new FormatException($"The model {nameof(CassandraRoleDefinitionListResult)} does not support writing '{options.Format}' format."); + } + } + + CassandraRoleDefinitionListResult 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 DeserializeCassandraRoleDefinitionListResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(CassandraRoleDefinitionListResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraRoleDefinitionListResult.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraRoleDefinitionListResult.cs new file mode 100644 index 000000000000..ad5b195de7f3 --- /dev/null +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraRoleDefinitionListResult.cs @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.CosmosDB.Models +{ + /// The relevant Role Definitions. + internal partial class CassandraRoleDefinitionListResult + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + internal CassandraRoleDefinitionListResult() + { + Value = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// List of Role Definitions and their properties. + /// The link used to get the next page of results. + /// Keeps track of any properties unknown to the library. + internal CassandraRoleDefinitionListResult(IReadOnlyList value, string nextLink, IDictionary serializedAdditionalRawData) + { + Value = value; + NextLink = nextLink; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// List of Role Definitions and their properties. + public IReadOnlyList Value { get; } + /// The link used to get the next page of results. + public string NextLink { get; } + } +} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CopyJobFeedResults.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CopyJobFeedResults.Serialization.cs new file mode 100644 index 000000000000..c62db0b69a12 --- /dev/null +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CopyJobFeedResults.Serialization.cs @@ -0,0 +1,219 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.CosmosDB.Models +{ + internal partial class CopyJobFeedResults : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(CopyJobFeedResults)} does not support writing '{format}' format."); + } + + if (options.Format != "W" && Optional.IsCollectionDefined(Value)) + { + writer.WritePropertyName("value"u8); + writer.WriteStartArray(); + foreach (var item in Value) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && Optional.IsDefined(NextLink)) + { + writer.WritePropertyName("nextLink"u8); + writer.WriteStringValue(NextLink); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + CopyJobFeedResults 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(CopyJobFeedResults)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeCopyJobFeedResults(document.RootElement, options); + } + + internal static CopyJobFeedResults DeserializeCopyJobFeedResults(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IReadOnlyList value = default; + string nextLink = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(CopyJobGetResultData.DeserializeCopyJobGetResultData(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 CopyJobFeedResults(value ?? new ChangeTrackingList(), nextLink, serializedAdditionalRawData); + } + + private BinaryData SerializeBicep(ModelReaderWriterOptions options) + { + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Value), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" value: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsCollectionDefined(Value)) + { + if (Value.Any()) + { + builder.Append(" value: "); + builder.AppendLine("["); + foreach (var item in Value) + { + BicepSerializationHelpers.AppendChildObject(builder, item, options, 4, true, " value: "); + } + builder.AppendLine(" ]"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(NextLink), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" nextLink: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(NextLink)) + { + builder.Append(" nextLink: "); + if (NextLink.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{NextLink}'''"); + } + else + { + builder.AppendLine($"'{NextLink}'"); + } + } + } + + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + case "bicep": + return SerializeBicep(options); + default: + throw new FormatException($"The model {nameof(CopyJobFeedResults)} does not support writing '{options.Format}' format."); + } + } + + CopyJobFeedResults 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 DeserializeCopyJobFeedResults(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(CopyJobFeedResults)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CopyJobFeedResults.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CopyJobFeedResults.cs new file mode 100644 index 000000000000..21927c5647df --- /dev/null +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CopyJobFeedResults.cs @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.CosmosDB.Models +{ + /// The List operation response, that contains the Copy Jobs and their properties. + internal partial class CopyJobFeedResults + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + internal CopyJobFeedResults() + { + Value = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// List of Copy Jobs and their properties. + /// URL to get the next set of Copy Job list results if there are any. + /// Keeps track of any properties unknown to the library. + internal CopyJobFeedResults(IReadOnlyList value, string nextLink, IDictionary serializedAdditionalRawData) + { + Value = value; + NextLink = nextLink; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// List of Copy Jobs and their properties. + public IReadOnlyList Value { get; } + /// URL to get the next set of Copy Job list results if there are any. + public string NextLink { get; } + } +} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CopyJobMode.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CopyJobMode.cs new file mode 100644 index 000000000000..e37af7cd2008 --- /dev/null +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CopyJobMode.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.CosmosDB.Models +{ + /// Mode of job execution. + public readonly partial struct CopyJobMode : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public CopyJobMode(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string OfflineValue = "Offline"; + private const string OnlineValue = "Online"; + + /// Offline. + public static CopyJobMode Offline { get; } = new CopyJobMode(OfflineValue); + /// Online. + public static CopyJobMode Online { get; } = new CopyJobMode(OnlineValue); + /// Determines if two values are the same. + public static bool operator ==(CopyJobMode left, CopyJobMode right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(CopyJobMode left, CopyJobMode right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator CopyJobMode(string value) => new CopyJobMode(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is CopyJobMode other && Equals(other); + /// + public bool Equals(CopyJobMode other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CopyJobProperties.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CopyJobProperties.Serialization.cs new file mode 100644 index 000000000000..1506984b23b8 --- /dev/null +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CopyJobProperties.Serialization.cs @@ -0,0 +1,411 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.CosmosDB.Models +{ + public partial class CopyJobProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(CopyJobProperties)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("jobProperties"u8); + writer.WriteObjectValue(JobProperties, options); + if (options.Format != "W" && Optional.IsDefined(Status)) + { + writer.WritePropertyName("status"u8); + writer.WriteStringValue(Status.Value.ToString()); + } + if (options.Format != "W" && Optional.IsDefined(ProcessedCount)) + { + writer.WritePropertyName("processedCount"u8); + writer.WriteNumberValue(ProcessedCount.Value); + } + if (options.Format != "W" && Optional.IsDefined(TotalCount)) + { + writer.WritePropertyName("totalCount"u8); + writer.WriteNumberValue(TotalCount.Value); + } + if (options.Format != "W" && Optional.IsDefined(LastUpdatedUtcOn)) + { + writer.WritePropertyName("lastUpdatedUtcTime"u8); + writer.WriteStringValue(LastUpdatedUtcOn.Value, "O"); + } + if (Optional.IsDefined(WorkerCount)) + { + writer.WritePropertyName("workerCount"u8); + writer.WriteNumberValue(WorkerCount.Value); + } + if (options.Format != "W" && Optional.IsDefined(Error)) + { + writer.WritePropertyName("error"u8); + writer.WriteObjectValue(Error, options); + } + if (options.Format != "W" && Optional.IsDefined(Duration)) + { + writer.WritePropertyName("duration"u8); + writer.WriteStringValue(Duration.Value, "c"); + } + if (Optional.IsDefined(Mode)) + { + writer.WritePropertyName("mode"u8); + writer.WriteStringValue(Mode.Value.ToString()); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + CopyJobProperties 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(CopyJobProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeCopyJobProperties(document.RootElement, options); + } + + internal static CopyJobProperties DeserializeCopyJobProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + BaseCopyJobProperties jobProperties = default; + CopyJobStatus? status = default; + long? processedCount = default; + long? totalCount = default; + DateTimeOffset? lastUpdatedUtcTime = default; + int? workerCount = default; + CosmosDBErrorResult error = default; + TimeSpan? duration = default; + CopyJobMode? mode = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("jobProperties"u8)) + { + jobProperties = BaseCopyJobProperties.DeserializeBaseCopyJobProperties(property.Value, options); + continue; + } + if (property.NameEquals("status"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + status = new CopyJobStatus(property.Value.GetString()); + continue; + } + if (property.NameEquals("processedCount"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + processedCount = property.Value.GetInt64(); + continue; + } + if (property.NameEquals("totalCount"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + totalCount = property.Value.GetInt64(); + continue; + } + if (property.NameEquals("lastUpdatedUtcTime"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + lastUpdatedUtcTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("workerCount"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + workerCount = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("error"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + error = CosmosDBErrorResult.DeserializeCosmosDBErrorResult(property.Value, options); + continue; + } + if (property.NameEquals("duration"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + duration = property.Value.GetTimeSpan("c"); + continue; + } + if (property.NameEquals("mode"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + mode = new CopyJobMode(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new CopyJobProperties( + jobProperties, + status, + processedCount, + totalCount, + lastUpdatedUtcTime, + workerCount, + error, + duration, + mode, + serializedAdditionalRawData); + } + + private BinaryData SerializeBicep(ModelReaderWriterOptions options) + { + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(JobProperties), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" jobProperties: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(JobProperties)) + { + builder.Append(" jobProperties: "); + BicepSerializationHelpers.AppendChildObject(builder, JobProperties, options, 2, false, " jobProperties: "); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Status), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" status: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Status)) + { + builder.Append(" status: "); + builder.AppendLine($"'{Status.Value.ToString()}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(ProcessedCount), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" processedCount: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(ProcessedCount)) + { + builder.Append(" processedCount: "); + builder.AppendLine($"'{ProcessedCount.Value.ToString()}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(TotalCount), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" totalCount: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(TotalCount)) + { + builder.Append(" totalCount: "); + builder.AppendLine($"'{TotalCount.Value.ToString()}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(LastUpdatedUtcOn), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" lastUpdatedUtcTime: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(LastUpdatedUtcOn)) + { + builder.Append(" lastUpdatedUtcTime: "); + var formattedDateTimeString = TypeFormatters.ToString(LastUpdatedUtcOn.Value, "o"); + builder.AppendLine($"'{formattedDateTimeString}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(WorkerCount), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" workerCount: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(WorkerCount)) + { + builder.Append(" workerCount: "); + builder.AppendLine($"{WorkerCount.Value}"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Error), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" error: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Error)) + { + builder.Append(" error: "); + BicepSerializationHelpers.AppendChildObject(builder, Error, options, 2, false, " error: "); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Duration), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" duration: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Duration)) + { + builder.Append(" duration: "); + var formattedTimeSpan = TypeFormatters.ToString(Duration.Value, "P"); + builder.AppendLine($"'{formattedTimeSpan}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Mode), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" mode: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Mode)) + { + builder.Append(" mode: "); + builder.AppendLine($"'{Mode.Value.ToString()}'"); + } + } + + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + case "bicep": + return SerializeBicep(options); + default: + throw new FormatException($"The model {nameof(CopyJobProperties)} does not support writing '{options.Format}' format."); + } + } + + CopyJobProperties 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 DeserializeCopyJobProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(CopyJobProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CopyJobProperties.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CopyJobProperties.cs new file mode 100644 index 000000000000..e17d509b18d0 --- /dev/null +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CopyJobProperties.cs @@ -0,0 +1,128 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.CosmosDB.Models +{ + /// The properties of a Copy Job. + public partial class CopyJobProperties + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// + /// Job Properties + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include , , , , and . + /// + /// is null. + public CopyJobProperties(BaseCopyJobProperties jobProperties) + { + Argument.AssertNotNull(jobProperties, nameof(jobProperties)); + + JobProperties = jobProperties; + } + + /// Initializes a new instance of . + /// + /// Job Properties + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include , , , , and . + /// + /// Job Status. + /// Processed Count. + /// Total Count. + /// Last Updated Time (ISO-8601 format). + /// Worker count. + /// Error response for Faulted job. + /// Total Duration of Job. + /// Mode of job execution. + /// Keeps track of any properties unknown to the library. + internal CopyJobProperties(BaseCopyJobProperties jobProperties, CopyJobStatus? status, long? processedCount, long? totalCount, DateTimeOffset? lastUpdatedUtcOn, int? workerCount, CosmosDBErrorResult error, TimeSpan? duration, CopyJobMode? mode, IDictionary serializedAdditionalRawData) + { + JobProperties = jobProperties; + Status = status; + ProcessedCount = processedCount; + TotalCount = totalCount; + LastUpdatedUtcOn = lastUpdatedUtcOn; + WorkerCount = workerCount; + Error = error; + Duration = duration; + Mode = mode; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal CopyJobProperties() + { + } + + /// + /// Job Properties + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include , , , , and . + /// + [WirePath("jobProperties")] + public BaseCopyJobProperties JobProperties { get; set; } + /// Job Status. + [WirePath("status")] + public CopyJobStatus? Status { get; } + /// Processed Count. + [WirePath("processedCount")] + public long? ProcessedCount { get; } + /// Total Count. + [WirePath("totalCount")] + public long? TotalCount { get; } + /// Last Updated Time (ISO-8601 format). + [WirePath("lastUpdatedUtcTime")] + public DateTimeOffset? LastUpdatedUtcOn { get; } + /// Worker count. + [WirePath("workerCount")] + public int? WorkerCount { get; set; } + /// Error response for Faulted job. + [WirePath("error")] + public CosmosDBErrorResult Error { get; } + /// Total Duration of Job. + [WirePath("duration")] + public TimeSpan? Duration { get; } + /// Mode of job execution. + [WirePath("mode")] + public CopyJobMode? Mode { get; set; } + } +} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CopyJobStatus.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CopyJobStatus.cs new file mode 100644 index 000000000000..41f6de55e069 --- /dev/null +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CopyJobStatus.cs @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.CosmosDB.Models +{ + /// Job Status. + public readonly partial struct CopyJobStatus : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public CopyJobStatus(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string PendingValue = "Pending"; + private const string PartitioningValue = "Partitioning"; + private const string RunningValue = "Running"; + private const string PausedValue = "Paused"; + private const string CompletedValue = "Completed"; + private const string FaultedValue = "Faulted"; + private const string CancelledValue = "Cancelled"; + + /// Pending. + public static CopyJobStatus Pending { get; } = new CopyJobStatus(PendingValue); + /// Partitioning. + public static CopyJobStatus Partitioning { get; } = new CopyJobStatus(PartitioningValue); + /// Running. + public static CopyJobStatus Running { get; } = new CopyJobStatus(RunningValue); + /// Paused. + public static CopyJobStatus Paused { get; } = new CopyJobStatus(PausedValue); + /// Completed. + public static CopyJobStatus Completed { get; } = new CopyJobStatus(CompletedValue); + /// Faulted. + public static CopyJobStatus Faulted { get; } = new CopyJobStatus(FaultedValue); + /// Cancelled. + public static CopyJobStatus Cancelled { get; } = new CopyJobStatus(CancelledValue); + /// Determines if two values are the same. + public static bool operator ==(CopyJobStatus left, CopyJobStatus right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(CopyJobStatus left, CopyJobStatus right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator CopyJobStatus(string value) => new CopyJobStatus(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is CopyJobStatus other && Equals(other); + /// + public bool Equals(CopyJobStatus other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CopyJobType.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CopyJobType.cs new file mode 100644 index 000000000000..e0cefcec1df8 --- /dev/null +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CopyJobType.cs @@ -0,0 +1,63 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.CosmosDB.Models +{ + /// Copy Job Type. + internal readonly partial struct CopyJobType : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public CopyJobType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string CassandraRUToCassandraRUValue = "CassandraRUToCassandraRU"; + private const string CassandraRUToAzureBlobStorageValue = "CassandraRUToAzureBlobStorage"; + private const string AzureBlobStorageToCassandraRUValue = "AzureBlobStorageToCassandraRU"; + private const string MongoRUToMongoRUValue = "MongoRUToMongoRU"; + private const string MongoRUToMongoVCoreValue = "MongoRUToMongoVCore"; + private const string NoSqlRUToNoSqlRUValue = "NoSqlRUToNoSqlRU"; + + /// CassandraRUToCassandraRU. + public static CopyJobType CassandraRUToCassandraRU { get; } = new CopyJobType(CassandraRUToCassandraRUValue); + /// CassandraRUToAzureBlobStorage. + public static CopyJobType CassandraRUToAzureBlobStorage { get; } = new CopyJobType(CassandraRUToAzureBlobStorageValue); + /// AzureBlobStorageToCassandraRU. + public static CopyJobType AzureBlobStorageToCassandraRU { get; } = new CopyJobType(AzureBlobStorageToCassandraRUValue); + /// MongoRUToMongoRU. + public static CopyJobType MongoRUToMongoRU { get; } = new CopyJobType(MongoRUToMongoRUValue); + /// MongoRUToMongoVCore. + public static CopyJobType MongoRUToMongoVCore { get; } = new CopyJobType(MongoRUToMongoVCoreValue); + /// NoSqlRUToNoSqlRU. + public static CopyJobType NoSqlRUToNoSqlRU { get; } = new CopyJobType(NoSqlRUToNoSqlRUValue); + /// Determines if two values are the same. + public static bool operator ==(CopyJobType left, CopyJobType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(CopyJobType left, CopyJobType right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator CopyJobType(string value) => new CopyJobType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is CopyJobType other && Equals(other); + /// + public bool Equals(CopyJobType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBAccountCreateOrUpdateContent.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBAccountCreateOrUpdateContent.Serialization.cs index 470fe58a1128..5a004d270d0a 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBAccountCreateOrUpdateContent.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBAccountCreateOrUpdateContent.Serialization.cs @@ -270,6 +270,11 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri writer.WritePropertyName("enablePerRegionPerPartitionAutoscale"u8); writer.WriteBooleanValue(EnablePerRegionPerPartitionAutoscale.Value); } + if (Optional.IsDefined(EnableAllVersionsAndDeletesChangeFeed)) + { + writer.WritePropertyName("enableAllVersionsAndDeletesChangeFeed"u8); + writer.WriteBooleanValue(EnableAllVersionsAndDeletesChangeFeed.Value); + } writer.WriteEndObject(); } @@ -339,6 +344,7 @@ internal static CosmosDBAccountCreateOrUpdateContent DeserializeCosmosDBAccountC bool? enablePriorityBasedExecution = default; DefaultPriorityLevel? defaultPriorityLevel = default; bool? enablePerRegionPerPartitionAutoscale = default; + bool? enableAllVersionsAndDeletesChangeFeed = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -777,6 +783,15 @@ internal static CosmosDBAccountCreateOrUpdateContent DeserializeCosmosDBAccountC enablePerRegionPerPartitionAutoscale = property0.Value.GetBoolean(); continue; } + if (property0.NameEquals("enableAllVersionsAndDeletesChangeFeed"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + enableAllVersionsAndDeletesChangeFeed = property0.Value.GetBoolean(); + continue; + } } continue; } @@ -832,6 +847,7 @@ internal static CosmosDBAccountCreateOrUpdateContent DeserializeCosmosDBAccountC enablePriorityBasedExecution, defaultPriorityLevel, enablePerRegionPerPartitionAutoscale, + enableAllVersionsAndDeletesChangeFeed, identity, serializedAdditionalRawData); } @@ -1650,6 +1666,22 @@ private BinaryData SerializeBicep(ModelReaderWriterOptions options) } } + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(EnableAllVersionsAndDeletesChangeFeed), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" enableAllVersionsAndDeletesChangeFeed: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(EnableAllVersionsAndDeletesChangeFeed)) + { + builder.Append(" enableAllVersionsAndDeletesChangeFeed: "); + var boolValue = EnableAllVersionsAndDeletesChangeFeed.Value == true ? "true" : "false"; + builder.AppendLine($"{boolValue}"); + } + } + builder.AppendLine(" }"); builder.AppendLine("}"); return BinaryData.FromString(builder.ToString()); diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBAccountCreateOrUpdateContent.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBAccountCreateOrUpdateContent.cs index a7ba9d36a3bb..ae4ed847d1e3 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBAccountCreateOrUpdateContent.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBAccountCreateOrUpdateContent.cs @@ -115,9 +115,10 @@ public CosmosDBAccountCreateOrUpdateContent(AzureLocation location, IEnumerable< /// Flag to indicate enabling/disabling of Priority Based Execution Preview feature on the account. /// Enum to indicate default Priority Level of request for Priority Based Execution. /// Flag to indicate enabling/disabling of Per-Region Per-partition autoscale Preview feature on the account. + /// Flag to indicate if All Versions and Deletes Change feed feature is enabled on the account. /// Identity for the resource. /// Keeps track of any properties unknown to the library. - internal CosmosDBAccountCreateOrUpdateContent(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, CosmosDBAccountKind? kind, ConsistencyPolicy consistencyPolicy, IList locations, CosmosDBAccountOfferType databaseAccountOfferType, IList ipRules, bool? isVirtualNetworkFilterEnabled, bool? enableAutomaticFailover, IList capabilities, IList virtualNetworkRules, bool? enableMultipleWriteLocations, bool? enableCassandraConnector, ConnectorOffer? connectorOffer, bool? disableKeyBasedMetadataWriteAccess, Uri keyVaultKeyUri, string defaultIdentity, CosmosDBPublicNetworkAccess? publicNetworkAccess, bool? isFreeTierEnabled, ApiProperties apiProperties, bool? isAnalyticalStorageEnabled, AnalyticalStorageConfiguration analyticalStorageConfiguration, CosmosDBAccountCreateMode? createMode, CosmosDBAccountBackupPolicy backupPolicy, IList cors, NetworkAclBypass? networkAclBypass, IList networkAclBypassResourceIds, DiagnosticLogSettings diagnosticLogSettings, bool? disableLocalAuth, CosmosDBAccountRestoreParameters restoreParameters, CosmosDBAccountCapacity capacity, CapacityMode? capacityMode, bool? enableMaterializedViews, DatabaseAccountKeysMetadata keysMetadata, bool? enablePartitionMerge, bool? enableBurstCapacity, CosmosDBMinimalTlsVersion? minimalTlsVersion, string customerManagedKeyStatus, bool? enablePriorityBasedExecution, DefaultPriorityLevel? defaultPriorityLevel, bool? enablePerRegionPerPartitionAutoscale, ManagedServiceIdentity identity, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) + internal CosmosDBAccountCreateOrUpdateContent(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, CosmosDBAccountKind? kind, ConsistencyPolicy consistencyPolicy, IList locations, CosmosDBAccountOfferType databaseAccountOfferType, IList ipRules, bool? isVirtualNetworkFilterEnabled, bool? enableAutomaticFailover, IList capabilities, IList virtualNetworkRules, bool? enableMultipleWriteLocations, bool? enableCassandraConnector, ConnectorOffer? connectorOffer, bool? disableKeyBasedMetadataWriteAccess, Uri keyVaultKeyUri, string defaultIdentity, CosmosDBPublicNetworkAccess? publicNetworkAccess, bool? isFreeTierEnabled, ApiProperties apiProperties, bool? isAnalyticalStorageEnabled, AnalyticalStorageConfiguration analyticalStorageConfiguration, CosmosDBAccountCreateMode? createMode, CosmosDBAccountBackupPolicy backupPolicy, IList cors, NetworkAclBypass? networkAclBypass, IList networkAclBypassResourceIds, DiagnosticLogSettings diagnosticLogSettings, bool? disableLocalAuth, CosmosDBAccountRestoreParameters restoreParameters, CosmosDBAccountCapacity capacity, CapacityMode? capacityMode, bool? enableMaterializedViews, DatabaseAccountKeysMetadata keysMetadata, bool? enablePartitionMerge, bool? enableBurstCapacity, CosmosDBMinimalTlsVersion? minimalTlsVersion, string customerManagedKeyStatus, bool? enablePriorityBasedExecution, DefaultPriorityLevel? defaultPriorityLevel, bool? enablePerRegionPerPartitionAutoscale, bool? enableAllVersionsAndDeletesChangeFeed, ManagedServiceIdentity identity, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) { Kind = kind; ConsistencyPolicy = consistencyPolicy; @@ -158,6 +159,7 @@ internal CosmosDBAccountCreateOrUpdateContent(ResourceIdentifier id, string name EnablePriorityBasedExecution = enablePriorityBasedExecution; DefaultPriorityLevel = defaultPriorityLevel; EnablePerRegionPerPartitionAutoscale = enablePerRegionPerPartitionAutoscale; + EnableAllVersionsAndDeletesChangeFeed = enableAllVersionsAndDeletesChangeFeed; Identity = identity; _serializedAdditionalRawData = serializedAdditionalRawData; } @@ -333,6 +335,9 @@ public int? CapacityTotalThroughputLimit /// Flag to indicate enabling/disabling of Per-Region Per-partition autoscale Preview feature on the account. [WirePath("properties.enablePerRegionPerPartitionAutoscale")] public bool? EnablePerRegionPerPartitionAutoscale { get; set; } + /// Flag to indicate if All Versions and Deletes Change feed feature is enabled on the account. + [WirePath("properties.enableAllVersionsAndDeletesChangeFeed")] + public bool? EnableAllVersionsAndDeletesChangeFeed { get; set; } /// Identity for the resource. [WirePath("identity")] public ManagedServiceIdentity Identity { get; set; } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBAccountPatch.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBAccountPatch.Serialization.cs index 9f6c5b996eb5..1c0ea3259163 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBAccountPatch.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBAccountPatch.Serialization.cs @@ -269,6 +269,11 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WritePropertyName("enablePerRegionPerPartitionAutoscale"u8); writer.WriteBooleanValue(EnablePerRegionPerPartitionAutoscale.Value); } + if (Optional.IsDefined(EnableAllVersionsAndDeletesChangeFeed)) + { + writer.WritePropertyName("enableAllVersionsAndDeletesChangeFeed"u8); + writer.WriteBooleanValue(EnableAllVersionsAndDeletesChangeFeed.Value); + } writer.WriteEndObject(); if (options.Format != "W" && _serializedAdditionalRawData != null) { @@ -345,6 +350,7 @@ internal static CosmosDBAccountPatch DeserializeCosmosDBAccountPatch(JsonElement bool? enablePriorityBasedExecution = default; DefaultPriorityLevel? defaultPriorityLevel = default; bool? enablePerRegionPerPartitionAutoscale = default; + bool? enableAllVersionsAndDeletesChangeFeed = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -735,6 +741,15 @@ internal static CosmosDBAccountPatch DeserializeCosmosDBAccountPatch(JsonElement enablePerRegionPerPartitionAutoscale = property0.Value.GetBoolean(); continue; } + if (property0.NameEquals("enableAllVersionsAndDeletesChangeFeed"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + enableAllVersionsAndDeletesChangeFeed = property0.Value.GetBoolean(); + continue; + } } continue; } @@ -783,6 +798,7 @@ internal static CosmosDBAccountPatch DeserializeCosmosDBAccountPatch(JsonElement enablePriorityBasedExecution, defaultPriorityLevel, enablePerRegionPerPartitionAutoscale, + enableAllVersionsAndDeletesChangeFeed, serializedAdditionalRawData); } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBAccountPatch.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBAccountPatch.cs index 41c2c81ce816..b64811f98c7f 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBAccountPatch.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBAccountPatch.cs @@ -102,8 +102,9 @@ public CosmosDBAccountPatch() /// Flag to indicate enabling/disabling of Priority Based Execution Preview feature on the account. /// Enum to indicate default Priority Level of request for Priority Based Execution. /// Flag to indicate enabling/disabling of Per-Region Per-partition autoscale Preview feature on the account. + /// Flag to indicate if All Versions and Deletes Change feed feature is enabled on the account. /// Keeps track of any properties unknown to the library. - internal CosmosDBAccountPatch(IDictionary tags, AzureLocation? location, ManagedServiceIdentity identity, ConsistencyPolicy consistencyPolicy, IList locations, IList ipRules, bool? isVirtualNetworkFilterEnabled, bool? enableAutomaticFailover, IList capabilities, IList virtualNetworkRules, bool? enableMultipleWriteLocations, bool? enableCassandraConnector, ConnectorOffer? connectorOffer, bool? disableKeyBasedMetadataWriteAccess, Uri keyVaultKeyUri, string defaultIdentity, CosmosDBPublicNetworkAccess? publicNetworkAccess, bool? isFreeTierEnabled, ApiProperties apiProperties, bool? isAnalyticalStorageEnabled, AnalyticalStorageConfiguration analyticalStorageConfiguration, CosmosDBAccountBackupPolicy backupPolicy, IList cors, NetworkAclBypass? networkAclBypass, IList networkAclBypassResourceIds, DiagnosticLogSettings diagnosticLogSettings, bool? disableLocalAuth, CosmosDBAccountCapacity capacity, CapacityMode? capacityMode, bool? enableMaterializedViews, DatabaseAccountKeysMetadata keysMetadata, bool? enablePartitionMerge, bool? enableBurstCapacity, CosmosDBMinimalTlsVersion? minimalTlsVersion, string customerManagedKeyStatus, bool? enablePriorityBasedExecution, DefaultPriorityLevel? defaultPriorityLevel, bool? enablePerRegionPerPartitionAutoscale, IDictionary serializedAdditionalRawData) + internal CosmosDBAccountPatch(IDictionary tags, AzureLocation? location, ManagedServiceIdentity identity, ConsistencyPolicy consistencyPolicy, IList locations, IList ipRules, bool? isVirtualNetworkFilterEnabled, bool? enableAutomaticFailover, IList capabilities, IList virtualNetworkRules, bool? enableMultipleWriteLocations, bool? enableCassandraConnector, ConnectorOffer? connectorOffer, bool? disableKeyBasedMetadataWriteAccess, Uri keyVaultKeyUri, string defaultIdentity, CosmosDBPublicNetworkAccess? publicNetworkAccess, bool? isFreeTierEnabled, ApiProperties apiProperties, bool? isAnalyticalStorageEnabled, AnalyticalStorageConfiguration analyticalStorageConfiguration, CosmosDBAccountBackupPolicy backupPolicy, IList cors, NetworkAclBypass? networkAclBypass, IList networkAclBypassResourceIds, DiagnosticLogSettings diagnosticLogSettings, bool? disableLocalAuth, CosmosDBAccountCapacity capacity, CapacityMode? capacityMode, bool? enableMaterializedViews, DatabaseAccountKeysMetadata keysMetadata, bool? enablePartitionMerge, bool? enableBurstCapacity, CosmosDBMinimalTlsVersion? minimalTlsVersion, string customerManagedKeyStatus, bool? enablePriorityBasedExecution, DefaultPriorityLevel? defaultPriorityLevel, bool? enablePerRegionPerPartitionAutoscale, bool? enableAllVersionsAndDeletesChangeFeed, IDictionary serializedAdditionalRawData) { Tags = tags; Location = location; @@ -143,6 +144,7 @@ internal CosmosDBAccountPatch(IDictionary tags, AzureLocation? l EnablePriorityBasedExecution = enablePriorityBasedExecution; DefaultPriorityLevel = defaultPriorityLevel; EnablePerRegionPerPartitionAutoscale = enablePerRegionPerPartitionAutoscale; + EnableAllVersionsAndDeletesChangeFeed = enableAllVersionsAndDeletesChangeFeed; _serializedAdditionalRawData = serializedAdditionalRawData; } @@ -312,5 +314,8 @@ public int? CapacityTotalThroughputLimit /// Flag to indicate enabling/disabling of Per-Region Per-partition autoscale Preview feature on the account. [WirePath("properties.enablePerRegionPerPartitionAutoscale")] public bool? EnablePerRegionPerPartitionAutoscale { get; set; } + /// Flag to indicate if All Versions and Deletes Change feed feature is enabled on the account. + [WirePath("properties.enableAllVersionsAndDeletesChangeFeed")] + public bool? EnableAllVersionsAndDeletesChangeFeed { get; set; } } } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBCassandraTable.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBCassandraTable.Serialization.cs new file mode 100644 index 000000000000..8cc0679944ec --- /dev/null +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBCassandraTable.Serialization.cs @@ -0,0 +1,198 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.CosmosDB.Models +{ + public partial class CosmosDBCassandraTable : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(CosmosDBCassandraTable)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("keyspaceName"u8); + writer.WriteStringValue(KeyspaceName); + writer.WritePropertyName("tableName"u8); + writer.WriteStringValue(TableName); + 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 + } + } + } + + CosmosDBCassandraTable 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(CosmosDBCassandraTable)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeCosmosDBCassandraTable(document.RootElement, options); + } + + internal static CosmosDBCassandraTable DeserializeCosmosDBCassandraTable(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string keyspaceName = default; + string tableName = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("keyspaceName"u8)) + { + keyspaceName = property.Value.GetString(); + continue; + } + if (property.NameEquals("tableName"u8)) + { + tableName = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new CosmosDBCassandraTable(keyspaceName, tableName, serializedAdditionalRawData); + } + + private BinaryData SerializeBicep(ModelReaderWriterOptions options) + { + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(KeyspaceName), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" keyspaceName: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(KeyspaceName)) + { + builder.Append(" keyspaceName: "); + if (KeyspaceName.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{KeyspaceName}'''"); + } + else + { + builder.AppendLine($"'{KeyspaceName}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(TableName), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" tableName: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(TableName)) + { + builder.Append(" tableName: "); + if (TableName.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{TableName}'''"); + } + else + { + builder.AppendLine($"'{TableName}'"); + } + } + } + + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + case "bicep": + return SerializeBicep(options); + default: + throw new FormatException($"The model {nameof(CosmosDBCassandraTable)} does not support writing '{options.Format}' format."); + } + } + + CosmosDBCassandraTable 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 DeserializeCosmosDBCassandraTable(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(CosmosDBCassandraTable)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBCassandraTable.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBCassandraTable.cs new file mode 100644 index 000000000000..5cd7156badbc --- /dev/null +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBCassandraTable.cs @@ -0,0 +1,84 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.CosmosDB.Models +{ + /// A CosmosDB Cassandra table. + public partial class CosmosDBCassandraTable + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// Azure Cosmos DB for Apache Cassandra keyspace. + /// Azure Cosmos DB for Apache Cassandra table. + /// or is null. + public CosmosDBCassandraTable(string keyspaceName, string tableName) + { + Argument.AssertNotNull(keyspaceName, nameof(keyspaceName)); + Argument.AssertNotNull(tableName, nameof(tableName)); + + KeyspaceName = keyspaceName; + TableName = tableName; + } + + /// Initializes a new instance of . + /// Azure Cosmos DB for Apache Cassandra keyspace. + /// Azure Cosmos DB for Apache Cassandra table. + /// Keeps track of any properties unknown to the library. + internal CosmosDBCassandraTable(string keyspaceName, string tableName, IDictionary serializedAdditionalRawData) + { + KeyspaceName = keyspaceName; + TableName = tableName; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal CosmosDBCassandraTable() + { + } + + /// Azure Cosmos DB for Apache Cassandra keyspace. + [WirePath("keyspaceName")] + public string KeyspaceName { get; set; } + /// Azure Cosmos DB for Apache Cassandra table. + [WirePath("tableName")] + public string TableName { get; set; } + } +} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBMongoCollection.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBMongoCollection.Serialization.cs new file mode 100644 index 000000000000..44f9ba5d689e --- /dev/null +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBMongoCollection.Serialization.cs @@ -0,0 +1,198 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.CosmosDB.Models +{ + public partial class CosmosDBMongoCollection : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(CosmosDBMongoCollection)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("databaseName"u8); + writer.WriteStringValue(DatabaseName); + writer.WritePropertyName("collectionName"u8); + writer.WriteStringValue(CollectionName); + 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 + } + } + } + + CosmosDBMongoCollection 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(CosmosDBMongoCollection)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeCosmosDBMongoCollection(document.RootElement, options); + } + + internal static CosmosDBMongoCollection DeserializeCosmosDBMongoCollection(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string databaseName = default; + string collectionName = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("databaseName"u8)) + { + databaseName = property.Value.GetString(); + continue; + } + if (property.NameEquals("collectionName"u8)) + { + collectionName = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new CosmosDBMongoCollection(databaseName, collectionName, serializedAdditionalRawData); + } + + private BinaryData SerializeBicep(ModelReaderWriterOptions options) + { + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(DatabaseName), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" databaseName: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(DatabaseName)) + { + builder.Append(" databaseName: "); + if (DatabaseName.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{DatabaseName}'''"); + } + else + { + builder.AppendLine($"'{DatabaseName}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(CollectionName), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" collectionName: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(CollectionName)) + { + builder.Append(" collectionName: "); + if (CollectionName.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{CollectionName}'''"); + } + else + { + builder.AppendLine($"'{CollectionName}'"); + } + } + } + + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + case "bicep": + return SerializeBicep(options); + default: + throw new FormatException($"The model {nameof(CosmosDBMongoCollection)} does not support writing '{options.Format}' format."); + } + } + + CosmosDBMongoCollection 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 DeserializeCosmosDBMongoCollection(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(CosmosDBMongoCollection)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBMongoCollection.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBMongoCollection.cs new file mode 100644 index 000000000000..15d0a64e574c --- /dev/null +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBMongoCollection.cs @@ -0,0 +1,84 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.CosmosDB.Models +{ + /// A CosmosDB Mongo collection. + public partial class CosmosDBMongoCollection + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// Azure Cosmos DB for MongoDB (RU) database. + /// Azure Cosmos DB for MongoDB (RU) collection. + /// or is null. + public CosmosDBMongoCollection(string databaseName, string collectionName) + { + Argument.AssertNotNull(databaseName, nameof(databaseName)); + Argument.AssertNotNull(collectionName, nameof(collectionName)); + + DatabaseName = databaseName; + CollectionName = collectionName; + } + + /// Initializes a new instance of . + /// Azure Cosmos DB for MongoDB (RU) database. + /// Azure Cosmos DB for MongoDB (RU) collection. + /// Keeps track of any properties unknown to the library. + internal CosmosDBMongoCollection(string databaseName, string collectionName, IDictionary serializedAdditionalRawData) + { + DatabaseName = databaseName; + CollectionName = collectionName; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal CosmosDBMongoCollection() + { + } + + /// Azure Cosmos DB for MongoDB (RU) database. + [WirePath("databaseName")] + public string DatabaseName { get; set; } + /// Azure Cosmos DB for MongoDB (RU) collection. + [WirePath("collectionName")] + public string CollectionName { get; set; } + } +} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBMongoVCoreCollection.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBMongoVCoreCollection.Serialization.cs new file mode 100644 index 000000000000..d7ffe3599b4d --- /dev/null +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBMongoVCoreCollection.Serialization.cs @@ -0,0 +1,198 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.CosmosDB.Models +{ + public partial class CosmosDBMongoVCoreCollection : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(CosmosDBMongoVCoreCollection)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("databaseName"u8); + writer.WriteStringValue(DatabaseName); + writer.WritePropertyName("collectionName"u8); + writer.WriteStringValue(CollectionName); + 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 + } + } + } + + CosmosDBMongoVCoreCollection 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(CosmosDBMongoVCoreCollection)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeCosmosDBMongoVCoreCollection(document.RootElement, options); + } + + internal static CosmosDBMongoVCoreCollection DeserializeCosmosDBMongoVCoreCollection(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string databaseName = default; + string collectionName = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("databaseName"u8)) + { + databaseName = property.Value.GetString(); + continue; + } + if (property.NameEquals("collectionName"u8)) + { + collectionName = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new CosmosDBMongoVCoreCollection(databaseName, collectionName, serializedAdditionalRawData); + } + + private BinaryData SerializeBicep(ModelReaderWriterOptions options) + { + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(DatabaseName), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" databaseName: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(DatabaseName)) + { + builder.Append(" databaseName: "); + if (DatabaseName.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{DatabaseName}'''"); + } + else + { + builder.AppendLine($"'{DatabaseName}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(CollectionName), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" collectionName: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(CollectionName)) + { + builder.Append(" collectionName: "); + if (CollectionName.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{CollectionName}'''"); + } + else + { + builder.AppendLine($"'{CollectionName}'"); + } + } + } + + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + case "bicep": + return SerializeBicep(options); + default: + throw new FormatException($"The model {nameof(CosmosDBMongoVCoreCollection)} does not support writing '{options.Format}' format."); + } + } + + CosmosDBMongoVCoreCollection 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 DeserializeCosmosDBMongoVCoreCollection(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(CosmosDBMongoVCoreCollection)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBMongoVCoreCollection.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBMongoVCoreCollection.cs new file mode 100644 index 000000000000..d1ef13d647ac --- /dev/null +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBMongoVCoreCollection.cs @@ -0,0 +1,84 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.CosmosDB.Models +{ + /// A CosmosDB Mongo vCore collection. + public partial class CosmosDBMongoVCoreCollection + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// Azure Cosmos DB for MongoDB (vCore) database. + /// Azure Cosmos DB for MongoDB (vCore) collection. + /// or is null. + public CosmosDBMongoVCoreCollection(string databaseName, string collectionName) + { + Argument.AssertNotNull(databaseName, nameof(databaseName)); + Argument.AssertNotNull(collectionName, nameof(collectionName)); + + DatabaseName = databaseName; + CollectionName = collectionName; + } + + /// Initializes a new instance of . + /// Azure Cosmos DB for MongoDB (vCore) database. + /// Azure Cosmos DB for MongoDB (vCore) collection. + /// Keeps track of any properties unknown to the library. + internal CosmosDBMongoVCoreCollection(string databaseName, string collectionName, IDictionary serializedAdditionalRawData) + { + DatabaseName = databaseName; + CollectionName = collectionName; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal CosmosDBMongoVCoreCollection() + { + } + + /// Azure Cosmos DB for MongoDB (vCore) database. + [WirePath("databaseName")] + public string DatabaseName { get; set; } + /// Azure Cosmos DB for MongoDB (vCore) collection. + [WirePath("collectionName")] + public string CollectionName { get; set; } + } +} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBNoSqlContainer.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBNoSqlContainer.Serialization.cs new file mode 100644 index 000000000000..bf788d09400a --- /dev/null +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBNoSqlContainer.Serialization.cs @@ -0,0 +1,198 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.CosmosDB.Models +{ + public partial class CosmosDBNoSqlContainer : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(CosmosDBNoSqlContainer)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("databaseName"u8); + writer.WriteStringValue(DatabaseName); + writer.WritePropertyName("containerName"u8); + writer.WriteStringValue(ContainerName); + 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 + } + } + } + + CosmosDBNoSqlContainer 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(CosmosDBNoSqlContainer)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeCosmosDBNoSqlContainer(document.RootElement, options); + } + + internal static CosmosDBNoSqlContainer DeserializeCosmosDBNoSqlContainer(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string databaseName = default; + string containerName = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("databaseName"u8)) + { + databaseName = property.Value.GetString(); + continue; + } + if (property.NameEquals("containerName"u8)) + { + containerName = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new CosmosDBNoSqlContainer(databaseName, containerName, serializedAdditionalRawData); + } + + private BinaryData SerializeBicep(ModelReaderWriterOptions options) + { + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(DatabaseName), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" databaseName: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(DatabaseName)) + { + builder.Append(" databaseName: "); + if (DatabaseName.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{DatabaseName}'''"); + } + else + { + builder.AppendLine($"'{DatabaseName}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(ContainerName), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" containerName: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(ContainerName)) + { + builder.Append(" containerName: "); + if (ContainerName.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{ContainerName}'''"); + } + else + { + builder.AppendLine($"'{ContainerName}'"); + } + } + } + + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + case "bicep": + return SerializeBicep(options); + default: + throw new FormatException($"The model {nameof(CosmosDBNoSqlContainer)} does not support writing '{options.Format}' format."); + } + } + + CosmosDBNoSqlContainer 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 DeserializeCosmosDBNoSqlContainer(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(CosmosDBNoSqlContainer)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBNoSqlContainer.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBNoSqlContainer.cs new file mode 100644 index 000000000000..9703cd5e2c93 --- /dev/null +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBNoSqlContainer.cs @@ -0,0 +1,84 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.CosmosDB.Models +{ + /// A CosmosDB NoSQL container. + public partial class CosmosDBNoSqlContainer + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// Azure Cosmos DB for NoSQL database. + /// Azure Cosmos DB for NoSQL container. + /// or is null. + public CosmosDBNoSqlContainer(string databaseName, string containerName) + { + Argument.AssertNotNull(databaseName, nameof(databaseName)); + Argument.AssertNotNull(containerName, nameof(containerName)); + + DatabaseName = databaseName; + ContainerName = containerName; + } + + /// Initializes a new instance of . + /// Azure Cosmos DB for NoSQL database. + /// Azure Cosmos DB for NoSQL container. + /// Keeps track of any properties unknown to the library. + internal CosmosDBNoSqlContainer(string databaseName, string containerName, IDictionary serializedAdditionalRawData) + { + DatabaseName = databaseName; + ContainerName = containerName; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal CosmosDBNoSqlContainer() + { + } + + /// Azure Cosmos DB for NoSQL database. + [WirePath("databaseName")] + public string DatabaseName { get; set; } + /// Azure Cosmos DB for NoSQL container. + [WirePath("containerName")] + public string ContainerName { get; set; } + } +} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBSourceSinkDetails.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBSourceSinkDetails.Serialization.cs new file mode 100644 index 000000000000..2f4bbe138568 --- /dev/null +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBSourceSinkDetails.Serialization.cs @@ -0,0 +1,170 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.CosmosDB.Models +{ + internal partial class CosmosDBSourceSinkDetails : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(CosmosDBSourceSinkDetails)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(RemoteAccountName)) + { + writer.WritePropertyName("remoteAccountName"u8); + writer.WriteStringValue(RemoteAccountName); + } + 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 + } + } + } + + CosmosDBSourceSinkDetails 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(CosmosDBSourceSinkDetails)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeCosmosDBSourceSinkDetails(document.RootElement, options); + } + + internal static CosmosDBSourceSinkDetails DeserializeCosmosDBSourceSinkDetails(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string remoteAccountName = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("remoteAccountName"u8)) + { + remoteAccountName = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new CosmosDBSourceSinkDetails(remoteAccountName, serializedAdditionalRawData); + } + + private BinaryData SerializeBicep(ModelReaderWriterOptions options) + { + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(RemoteAccountName), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" remoteAccountName: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(RemoteAccountName)) + { + builder.Append(" remoteAccountName: "); + if (RemoteAccountName.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{RemoteAccountName}'''"); + } + else + { + builder.AppendLine($"'{RemoteAccountName}'"); + } + } + } + + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + case "bicep": + return SerializeBicep(options); + default: + throw new FormatException($"The model {nameof(CosmosDBSourceSinkDetails)} does not support writing '{options.Format}' format."); + } + } + + CosmosDBSourceSinkDetails 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 DeserializeCosmosDBSourceSinkDetails(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(CosmosDBSourceSinkDetails)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBSourceSinkDetails.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBSourceSinkDetails.cs new file mode 100644 index 000000000000..bec85e7a3991 --- /dev/null +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBSourceSinkDetails.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.CosmosDB.Models +{ + /// A CosmosDB data source/sink details. + internal partial class CosmosDBSourceSinkDetails + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public CosmosDBSourceSinkDetails() + { + } + + /// Initializes a new instance of . + /// Name of remote account in case of cross-account data transfer. + /// Keeps track of any properties unknown to the library. + internal CosmosDBSourceSinkDetails(string remoteAccountName, IDictionary serializedAdditionalRawData) + { + RemoteAccountName = remoteAccountName; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Name of remote account in case of cross-account data transfer. + [WirePath("remoteAccountName")] + public string RemoteAccountName { get; set; } + } +} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBSqlContainerResourceInfo.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBSqlContainerResourceInfo.Serialization.cs index 6b5af4b2b70f..4279d69ba4df 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBSqlContainerResourceInfo.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBSqlContainerResourceInfo.Serialization.cs @@ -88,6 +88,16 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WritePropertyName("materializedViewDefinition"u8); writer.WriteObjectValue(MaterializedViewDefinition, options); } + if (Optional.IsCollectionDefined(MaterializedViews)) + { + writer.WritePropertyName("materializedViews"u8); + writer.WriteStartArray(); + foreach (var item in MaterializedViews) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } if (Optional.IsCollectionDefined(ComputedProperties)) { writer.WritePropertyName("computedProperties"u8); @@ -103,6 +113,11 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WritePropertyName("vectorEmbeddingPolicy"u8); writer.WriteObjectValue(VectorEmbeddingPolicy, options); } + if (Optional.IsDefined(FullTextPolicy)) + { + writer.WritePropertyName("fullTextPolicy"u8); + writer.WriteObjectValue(FullTextPolicy, options); + } if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) @@ -151,8 +166,10 @@ internal static CosmosDBSqlContainerResourceInfo DeserializeCosmosDBSqlContainer ResourceRestoreParameters restoreParameters = default; CosmosDBAccountCreateMode? createMode = default; MaterializedViewDefinition materializedViewDefinition = default; + IList materializedViews = default; IList computedProperties = default; VectorEmbeddingPolicy vectorEmbeddingPolicy = default; + FullTextPolicy fullTextPolicy = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -252,6 +269,20 @@ internal static CosmosDBSqlContainerResourceInfo DeserializeCosmosDBSqlContainer materializedViewDefinition = MaterializedViewDefinition.DeserializeMaterializedViewDefinition(property.Value, options); continue; } + if (property.NameEquals("materializedViews"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(MaterializedViewDetails.DeserializeMaterializedViewDetails(item, options)); + } + materializedViews = array; + continue; + } if (property.NameEquals("computedProperties"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -275,6 +306,15 @@ internal static CosmosDBSqlContainerResourceInfo DeserializeCosmosDBSqlContainer vectorEmbeddingPolicy = VectorEmbeddingPolicy.DeserializeVectorEmbeddingPolicy(property.Value, options); continue; } + if (property.NameEquals("fullTextPolicy"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + fullTextPolicy = FullTextPolicy.DeserializeFullTextPolicy(property.Value, options); + continue; + } if (options.Format != "W") { rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); @@ -293,8 +333,10 @@ internal static CosmosDBSqlContainerResourceInfo DeserializeCosmosDBSqlContainer restoreParameters, createMode, materializedViewDefinition, + materializedViews ?? new ChangeTrackingList(), computedProperties ?? new ChangeTrackingList(), vectorEmbeddingPolicy, + fullTextPolicy, serializedAdditionalRawData); } @@ -485,6 +527,29 @@ private BinaryData SerializeBicep(ModelReaderWriterOptions options) } } + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(MaterializedViews), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" materializedViews: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsCollectionDefined(MaterializedViews)) + { + if (MaterializedViews.Any()) + { + builder.Append(" materializedViews: "); + builder.AppendLine("["); + foreach (var item in MaterializedViews) + { + BicepSerializationHelpers.AppendChildObject(builder, item, options, 4, true, " materializedViews: "); + } + builder.AppendLine(" ]"); + } + } + } + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(ComputedProperties), out propertyOverride); if (hasPropertyOverride) { @@ -526,6 +591,21 @@ private BinaryData SerializeBicep(ModelReaderWriterOptions options) } } + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(FullTextPolicy), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" fullTextPolicy: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(FullTextPolicy)) + { + builder.Append(" fullTextPolicy: "); + BicepSerializationHelpers.AppendChildObject(builder, FullTextPolicy, options, 2, false, " fullTextPolicy: "); + } + } + builder.AppendLine("}"); return BinaryData.FromString(builder.ToString()); } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBSqlContainerResourceInfo.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBSqlContainerResourceInfo.cs index 600ba7b32ccd..9fa8a1ab6cda 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBSqlContainerResourceInfo.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBSqlContainerResourceInfo.cs @@ -53,6 +53,7 @@ public CosmosDBSqlContainerResourceInfo(string containerName) Argument.AssertNotNull(containerName, nameof(containerName)); ContainerName = containerName; + MaterializedViews = new ChangeTrackingList(); ComputedProperties = new ChangeTrackingList(); } @@ -68,10 +69,12 @@ public CosmosDBSqlContainerResourceInfo(string containerName) /// Parameters to indicate the information about the restore. /// Enum to indicate the mode of resource creation. /// The configuration for defining Materialized Views. This must be specified only for creating a Materialized View container. + /// Materialized Views defined on the container. /// List of computed properties. /// The vector embedding policy for the container. + /// The FullText policy for the container. /// Keeps track of any properties unknown to the library. - internal CosmosDBSqlContainerResourceInfo(string containerName, CosmosDBIndexingPolicy indexingPolicy, CosmosDBContainerPartitionKey partitionKey, int? defaultTtl, CosmosDBUniqueKeyPolicy uniqueKeyPolicy, ConflictResolutionPolicy conflictResolutionPolicy, CosmosDBClientEncryptionPolicy clientEncryptionPolicy, long? analyticalStorageTtl, ResourceRestoreParameters restoreParameters, CosmosDBAccountCreateMode? createMode, MaterializedViewDefinition materializedViewDefinition, IList computedProperties, VectorEmbeddingPolicy vectorEmbeddingPolicy, IDictionary serializedAdditionalRawData) + internal CosmosDBSqlContainerResourceInfo(string containerName, CosmosDBIndexingPolicy indexingPolicy, CosmosDBContainerPartitionKey partitionKey, int? defaultTtl, CosmosDBUniqueKeyPolicy uniqueKeyPolicy, ConflictResolutionPolicy conflictResolutionPolicy, CosmosDBClientEncryptionPolicy clientEncryptionPolicy, long? analyticalStorageTtl, ResourceRestoreParameters restoreParameters, CosmosDBAccountCreateMode? createMode, MaterializedViewDefinition materializedViewDefinition, IList materializedViews, IList computedProperties, VectorEmbeddingPolicy vectorEmbeddingPolicy, FullTextPolicy fullTextPolicy, IDictionary serializedAdditionalRawData) { ContainerName = containerName; IndexingPolicy = indexingPolicy; @@ -84,8 +87,10 @@ internal CosmosDBSqlContainerResourceInfo(string containerName, CosmosDBIndexing RestoreParameters = restoreParameters; CreateMode = createMode; MaterializedViewDefinition = materializedViewDefinition; + MaterializedViews = materializedViews; ComputedProperties = computedProperties; VectorEmbeddingPolicy = vectorEmbeddingPolicy; + FullTextPolicy = fullTextPolicy; _serializedAdditionalRawData = serializedAdditionalRawData; } @@ -138,6 +143,9 @@ public IList UniqueKeys /// The configuration for defining Materialized Views. This must be specified only for creating a Materialized View container. [WirePath("materializedViewDefinition")] public MaterializedViewDefinition MaterializedViewDefinition { get; set; } + /// Materialized Views defined on the container. + [WirePath("materializedViews")] + public IList MaterializedViews { get; } /// List of computed properties. [WirePath("computedProperties")] public IList ComputedProperties { get; } @@ -154,5 +162,9 @@ public IList VectorEmbeddings return VectorEmbeddingPolicy.VectorEmbeddings; } } + + /// The FullText policy for the container. + [WirePath("fullTextPolicy")] + public FullTextPolicy FullTextPolicy { get; set; } } } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBStatus.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBStatus.cs index c76d86492910..855a0c0b0058 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBStatus.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBStatus.cs @@ -31,6 +31,7 @@ public CosmosDBStatus(string value) private const string FailedValue = "Failed"; private const string CanceledValue = "Canceled"; private const string UpdatingValue = "Updating"; + private const string CreatingValue = "Creating"; /// Uninitialized. public static CosmosDBStatus Uninitialized { get; } = new CosmosDBStatus(UninitializedValue); @@ -50,6 +51,8 @@ public CosmosDBStatus(string value) public static CosmosDBStatus Canceled { get; } = new CosmosDBStatus(CanceledValue); /// Updating. public static CosmosDBStatus Updating { get; } = new CosmosDBStatus(UpdatingValue); + /// Creating. + public static CosmosDBStatus Creating { get; } = new CosmosDBStatus(CreatingValue); /// Determines if two values are the same. public static bool operator ==(CosmosDBStatus left, CosmosDBStatus right) => left.Equals(right); /// Determines if two values are not the same. diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ExtendedCosmosDBSqlContainerResourceInfo.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ExtendedCosmosDBSqlContainerResourceInfo.Serialization.cs index 6a5afd63a592..b1eba7df1024 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ExtendedCosmosDBSqlContainerResourceInfo.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ExtendedCosmosDBSqlContainerResourceInfo.Serialization.cs @@ -88,8 +88,10 @@ internal static ExtendedCosmosDBSqlContainerResourceInfo DeserializeExtendedCosm ResourceRestoreParameters restoreParameters = default; CosmosDBAccountCreateMode? createMode = default; MaterializedViewDefinition materializedViewDefinition = default; + IList materializedViews = default; IList computedProperties = default; VectorEmbeddingPolicy vectorEmbeddingPolicy = default; + FullTextPolicy fullTextPolicy = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -212,6 +214,20 @@ internal static ExtendedCosmosDBSqlContainerResourceInfo DeserializeExtendedCosm materializedViewDefinition = MaterializedViewDefinition.DeserializeMaterializedViewDefinition(property.Value, options); continue; } + if (property.NameEquals("materializedViews"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(MaterializedViewDetails.DeserializeMaterializedViewDetails(item, options)); + } + materializedViews = array; + continue; + } if (property.NameEquals("computedProperties"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -235,6 +251,15 @@ internal static ExtendedCosmosDBSqlContainerResourceInfo DeserializeExtendedCosm vectorEmbeddingPolicy = VectorEmbeddingPolicy.DeserializeVectorEmbeddingPolicy(property.Value, options); continue; } + if (property.NameEquals("fullTextPolicy"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + fullTextPolicy = FullTextPolicy.DeserializeFullTextPolicy(property.Value, options); + continue; + } if (options.Format != "W") { rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); @@ -253,8 +278,10 @@ internal static ExtendedCosmosDBSqlContainerResourceInfo DeserializeExtendedCosm restoreParameters, createMode, materializedViewDefinition, + materializedViews ?? new ChangeTrackingList(), computedProperties ?? new ChangeTrackingList(), vectorEmbeddingPolicy, + fullTextPolicy, serializedAdditionalRawData, rid, ts, @@ -501,6 +528,29 @@ private BinaryData SerializeBicep(ModelReaderWriterOptions options) } } + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(MaterializedViews), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" materializedViews: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsCollectionDefined(MaterializedViews)) + { + if (MaterializedViews.Any()) + { + builder.Append(" materializedViews: "); + builder.AppendLine("["); + foreach (var item in MaterializedViews) + { + BicepSerializationHelpers.AppendChildObject(builder, item, options, 4, true, " materializedViews: "); + } + builder.AppendLine(" ]"); + } + } + } + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(ComputedProperties), out propertyOverride); if (hasPropertyOverride) { @@ -542,6 +592,21 @@ private BinaryData SerializeBicep(ModelReaderWriterOptions options) } } + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(FullTextPolicy), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" fullTextPolicy: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(FullTextPolicy)) + { + builder.Append(" fullTextPolicy: "); + BicepSerializationHelpers.AppendChildObject(builder, FullTextPolicy, options, 2, false, " fullTextPolicy: "); + } + } + builder.AppendLine("}"); return BinaryData.FromString(builder.ToString()); } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ExtendedCosmosDBSqlContainerResourceInfo.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ExtendedCosmosDBSqlContainerResourceInfo.cs index 9ab7b3339c3e..750e2e75d0df 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ExtendedCosmosDBSqlContainerResourceInfo.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ExtendedCosmosDBSqlContainerResourceInfo.cs @@ -33,13 +33,15 @@ public ExtendedCosmosDBSqlContainerResourceInfo(string containerName) : base(con /// Parameters to indicate the information about the restore. /// Enum to indicate the mode of resource creation. /// The configuration for defining Materialized Views. This must be specified only for creating a Materialized View container. + /// Materialized Views defined on the container. /// List of computed properties. /// The vector embedding policy for the container. + /// The FullText policy for the container. /// Keeps track of any properties unknown to the library. /// A system generated property. A unique identifier. /// A system generated property that denotes the last updated timestamp of the resource. /// A system generated property representing the resource etag required for optimistic concurrency control. - internal ExtendedCosmosDBSqlContainerResourceInfo(string containerName, CosmosDBIndexingPolicy indexingPolicy, CosmosDBContainerPartitionKey partitionKey, int? defaultTtl, CosmosDBUniqueKeyPolicy uniqueKeyPolicy, ConflictResolutionPolicy conflictResolutionPolicy, CosmosDBClientEncryptionPolicy clientEncryptionPolicy, long? analyticalStorageTtl, ResourceRestoreParameters restoreParameters, CosmosDBAccountCreateMode? createMode, MaterializedViewDefinition materializedViewDefinition, IList computedProperties, VectorEmbeddingPolicy vectorEmbeddingPolicy, IDictionary serializedAdditionalRawData, string rid, float? timestamp, ETag? etag) : base(containerName, indexingPolicy, partitionKey, defaultTtl, uniqueKeyPolicy, conflictResolutionPolicy, clientEncryptionPolicy, analyticalStorageTtl, restoreParameters, createMode, materializedViewDefinition, computedProperties, vectorEmbeddingPolicy, serializedAdditionalRawData) + internal ExtendedCosmosDBSqlContainerResourceInfo(string containerName, CosmosDBIndexingPolicy indexingPolicy, CosmosDBContainerPartitionKey partitionKey, int? defaultTtl, CosmosDBUniqueKeyPolicy uniqueKeyPolicy, ConflictResolutionPolicy conflictResolutionPolicy, CosmosDBClientEncryptionPolicy clientEncryptionPolicy, long? analyticalStorageTtl, ResourceRestoreParameters restoreParameters, CosmosDBAccountCreateMode? createMode, MaterializedViewDefinition materializedViewDefinition, IList materializedViews, IList computedProperties, VectorEmbeddingPolicy vectorEmbeddingPolicy, FullTextPolicy fullTextPolicy, IDictionary serializedAdditionalRawData, string rid, float? timestamp, ETag? etag) : base(containerName, indexingPolicy, partitionKey, defaultTtl, uniqueKeyPolicy, conflictResolutionPolicy, clientEncryptionPolicy, analyticalStorageTtl, restoreParameters, createMode, materializedViewDefinition, materializedViews, computedProperties, vectorEmbeddingPolicy, fullTextPolicy, serializedAdditionalRawData) { Rid = rid; Timestamp = timestamp; diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/FleetAnalyticsListResult.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/FleetAnalyticsListResult.Serialization.cs new file mode 100644 index 000000000000..8b6d53a1b059 --- /dev/null +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/FleetAnalyticsListResult.Serialization.cs @@ -0,0 +1,219 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.CosmosDB.Models +{ + internal partial class FleetAnalyticsListResult : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(FleetAnalyticsListResult)} does not support writing '{format}' format."); + } + + if (options.Format != "W" && Optional.IsCollectionDefined(Value)) + { + writer.WritePropertyName("value"u8); + writer.WriteStartArray(); + foreach (var item in Value) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && Optional.IsDefined(NextLink)) + { + writer.WritePropertyName("nextLink"u8); + writer.WriteStringValue(NextLink); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + FleetAnalyticsListResult 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(FleetAnalyticsListResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeFleetAnalyticsListResult(document.RootElement, options); + } + + internal static FleetAnalyticsListResult DeserializeFleetAnalyticsListResult(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IReadOnlyList value = default; + string nextLink = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(FleetAnalyticsResourceData.DeserializeFleetAnalyticsResourceData(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 FleetAnalyticsListResult(value ?? new ChangeTrackingList(), nextLink, serializedAdditionalRawData); + } + + private BinaryData SerializeBicep(ModelReaderWriterOptions options) + { + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Value), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" value: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsCollectionDefined(Value)) + { + if (Value.Any()) + { + builder.Append(" value: "); + builder.AppendLine("["); + foreach (var item in Value) + { + BicepSerializationHelpers.AppendChildObject(builder, item, options, 4, true, " value: "); + } + builder.AppendLine(" ]"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(NextLink), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" nextLink: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(NextLink)) + { + builder.Append(" nextLink: "); + if (NextLink.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{NextLink}'''"); + } + else + { + builder.AppendLine($"'{NextLink}'"); + } + } + } + + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + case "bicep": + return SerializeBicep(options); + default: + throw new FormatException($"The model {nameof(FleetAnalyticsListResult)} does not support writing '{options.Format}' format."); + } + } + + FleetAnalyticsListResult 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 DeserializeFleetAnalyticsListResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(FleetAnalyticsListResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/FleetAnalyticsListResult.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/FleetAnalyticsListResult.cs new file mode 100644 index 000000000000..dd07dfacdadb --- /dev/null +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/FleetAnalyticsListResult.cs @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.CosmosDB.Models +{ + /// The response of the List operation that contains the FleetAnalytics and their properties. + internal partial class FleetAnalyticsListResult + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + internal FleetAnalyticsListResult() + { + Value = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// List of FleetAnalytics and their properties. + /// The link used to get the next page of results. + /// Keeps track of any properties unknown to the library. + internal FleetAnalyticsListResult(IReadOnlyList value, string nextLink, IDictionary serializedAdditionalRawData) + { + Value = value; + NextLink = nextLink; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// List of FleetAnalytics and their properties. + public IReadOnlyList Value { get; } + /// The link used to get the next page of results. + public string NextLink { get; } + } +} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/FleetAnalyticsPropertiesStorageLocationType.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/FleetAnalyticsPropertiesStorageLocationType.cs new file mode 100644 index 000000000000..04c0b93dc0b5 --- /dev/null +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/FleetAnalyticsPropertiesStorageLocationType.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.CosmosDB.Models +{ + /// The type of the fleet analytics resource. + public readonly partial struct FleetAnalyticsPropertiesStorageLocationType : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public FleetAnalyticsPropertiesStorageLocationType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string StorageAccountValue = "StorageAccount"; + private const string FabricLakehouseValue = "FabricLakehouse"; + + /// StorageAccount. + public static FleetAnalyticsPropertiesStorageLocationType StorageAccount { get; } = new FleetAnalyticsPropertiesStorageLocationType(StorageAccountValue); + /// FabricLakehouse. + public static FleetAnalyticsPropertiesStorageLocationType FabricLakehouse { get; } = new FleetAnalyticsPropertiesStorageLocationType(FabricLakehouseValue); + /// Determines if two values are the same. + public static bool operator ==(FleetAnalyticsPropertiesStorageLocationType left, FleetAnalyticsPropertiesStorageLocationType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(FleetAnalyticsPropertiesStorageLocationType left, FleetAnalyticsPropertiesStorageLocationType right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator FleetAnalyticsPropertiesStorageLocationType(string value) => new FleetAnalyticsPropertiesStorageLocationType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is FleetAnalyticsPropertiesStorageLocationType other && Equals(other); + /// + public bool Equals(FleetAnalyticsPropertiesStorageLocationType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/FleetListResult.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/FleetListResult.Serialization.cs new file mode 100644 index 000000000000..44963b792e3f --- /dev/null +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/FleetListResult.Serialization.cs @@ -0,0 +1,219 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.CosmosDB.Models +{ + internal partial class FleetListResult : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(FleetListResult)} does not support writing '{format}' format."); + } + + if (options.Format != "W" && Optional.IsCollectionDefined(Value)) + { + writer.WritePropertyName("value"u8); + writer.WriteStartArray(); + foreach (var item in Value) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && Optional.IsDefined(NextLink)) + { + writer.WritePropertyName("nextLink"u8); + writer.WriteStringValue(NextLink); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + FleetListResult 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(FleetListResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeFleetListResult(document.RootElement, options); + } + + internal static FleetListResult DeserializeFleetListResult(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IReadOnlyList value = default; + string nextLink = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(FleetResourceData.DeserializeFleetResourceData(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 FleetListResult(value ?? new ChangeTrackingList(), nextLink, serializedAdditionalRawData); + } + + private BinaryData SerializeBicep(ModelReaderWriterOptions options) + { + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Value), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" value: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsCollectionDefined(Value)) + { + if (Value.Any()) + { + builder.Append(" value: "); + builder.AppendLine("["); + foreach (var item in Value) + { + BicepSerializationHelpers.AppendChildObject(builder, item, options, 4, true, " value: "); + } + builder.AppendLine(" ]"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(NextLink), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" nextLink: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(NextLink)) + { + builder.Append(" nextLink: "); + if (NextLink.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{NextLink}'''"); + } + else + { + builder.AppendLine($"'{NextLink}'"); + } + } + } + + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + case "bicep": + return SerializeBicep(options); + default: + throw new FormatException($"The model {nameof(FleetListResult)} does not support writing '{options.Format}' format."); + } + } + + FleetListResult 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 DeserializeFleetListResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(FleetListResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/FleetListResult.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/FleetListResult.cs new file mode 100644 index 000000000000..1372bbad5fdd --- /dev/null +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/FleetListResult.cs @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.CosmosDB.Models +{ + /// The response of the List operation that contains the fleets and their properties. + internal partial class FleetListResult + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + internal FleetListResult() + { + Value = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// List of fleets and their properties. + /// The link used to get the next page of results. + /// Keeps track of any properties unknown to the library. + internal FleetListResult(IReadOnlyList value, string nextLink, IDictionary serializedAdditionalRawData) + { + Value = value; + NextLink = nextLink; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// List of fleets and their properties. + public IReadOnlyList Value { get; } + /// The link used to get the next page of results. + public string NextLink { get; } + } +} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/FleetResourcePatch.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/FleetResourcePatch.Serialization.cs new file mode 100644 index 000000000000..45931d8121f9 --- /dev/null +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/FleetResourcePatch.Serialization.cs @@ -0,0 +1,148 @@ +// 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.CosmosDB.Models +{ + public partial class FleetResourcePatch : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(FleetResourcePatch)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("properties"u8); + writer.WriteStartObject(); + if (Optional.IsDefined(ProvisioningState)) + { + writer.WritePropertyName("provisioningState"u8); + writer.WriteStringValue(ProvisioningState.Value.ToString()); + } + writer.WriteEndObject(); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + FleetResourcePatch 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(FleetResourcePatch)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeFleetResourcePatch(document.RootElement, options); + } + + internal static FleetResourcePatch DeserializeFleetResourcePatch(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + CosmosDBStatus? provisioningState = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("properties"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + foreach (var property0 in property.Value.EnumerateObject()) + { + if (property0.NameEquals("provisioningState"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + provisioningState = new CosmosDBStatus(property0.Value.GetString()); + continue; + } + } + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new FleetResourcePatch(provisioningState, 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); + default: + throw new FormatException($"The model {nameof(FleetResourcePatch)} does not support writing '{options.Format}' format."); + } + } + + FleetResourcePatch 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 DeserializeFleetResourcePatch(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(FleetResourcePatch)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/FleetResourcePatch.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/FleetResourcePatch.cs new file mode 100644 index 000000000000..141c32a300cc --- /dev/null +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/FleetResourcePatch.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.CosmosDB.Models +{ + /// Represents a fleet resource for updates. + public partial class FleetResourcePatch + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public FleetResourcePatch() + { + } + + /// Initializes a new instance of . + /// A provisioning state of the Fleet. + /// Keeps track of any properties unknown to the library. + internal FleetResourcePatch(CosmosDBStatus? provisioningState, IDictionary serializedAdditionalRawData) + { + ProvisioningState = provisioningState; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// A provisioning state of the Fleet. + [WirePath("properties.provisioningState")] + public CosmosDBStatus? ProvisioningState { get; set; } + } +} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/FleetspaceAccountListResult.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/FleetspaceAccountListResult.Serialization.cs new file mode 100644 index 000000000000..78c06683fe92 --- /dev/null +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/FleetspaceAccountListResult.Serialization.cs @@ -0,0 +1,219 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.CosmosDB.Models +{ + internal partial class FleetspaceAccountListResult : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(FleetspaceAccountListResult)} does not support writing '{format}' format."); + } + + if (options.Format != "W" && Optional.IsCollectionDefined(Value)) + { + writer.WritePropertyName("value"u8); + writer.WriteStartArray(); + foreach (var item in Value) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && Optional.IsDefined(NextLink)) + { + writer.WritePropertyName("nextLink"u8); + writer.WriteStringValue(NextLink); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + FleetspaceAccountListResult 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(FleetspaceAccountListResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeFleetspaceAccountListResult(document.RootElement, options); + } + + internal static FleetspaceAccountListResult DeserializeFleetspaceAccountListResult(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IReadOnlyList value = default; + string nextLink = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(FleetspaceAccountResourceData.DeserializeFleetspaceAccountResourceData(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 FleetspaceAccountListResult(value ?? new ChangeTrackingList(), nextLink, serializedAdditionalRawData); + } + + private BinaryData SerializeBicep(ModelReaderWriterOptions options) + { + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Value), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" value: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsCollectionDefined(Value)) + { + if (Value.Any()) + { + builder.Append(" value: "); + builder.AppendLine("["); + foreach (var item in Value) + { + BicepSerializationHelpers.AppendChildObject(builder, item, options, 4, true, " value: "); + } + builder.AppendLine(" ]"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(NextLink), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" nextLink: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(NextLink)) + { + builder.Append(" nextLink: "); + if (NextLink.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{NextLink}'''"); + } + else + { + builder.AppendLine($"'{NextLink}'"); + } + } + } + + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + case "bicep": + return SerializeBicep(options); + default: + throw new FormatException($"The model {nameof(FleetspaceAccountListResult)} does not support writing '{options.Format}' format."); + } + } + + FleetspaceAccountListResult 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 DeserializeFleetspaceAccountListResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(FleetspaceAccountListResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/FleetspaceAccountListResult.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/FleetspaceAccountListResult.cs new file mode 100644 index 000000000000..a755ac0ecdc7 --- /dev/null +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/FleetspaceAccountListResult.cs @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.CosmosDB.Models +{ + /// The List operation response, that contains the global database accounts and their properties. + internal partial class FleetspaceAccountListResult + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + internal FleetspaceAccountListResult() + { + Value = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// List of global database accounts in a fleetspace and their properties. + /// The link used to get the next page of results. + /// Keeps track of any properties unknown to the library. + internal FleetspaceAccountListResult(IReadOnlyList value, string nextLink, IDictionary serializedAdditionalRawData) + { + Value = value; + NextLink = nextLink; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// List of global database accounts in a fleetspace and their properties. + public IReadOnlyList Value { get; } + /// The link used to get the next page of results. + public string NextLink { get; } + } +} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/FleetspaceListResult.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/FleetspaceListResult.Serialization.cs new file mode 100644 index 000000000000..2c4e8e08fd5c --- /dev/null +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/FleetspaceListResult.Serialization.cs @@ -0,0 +1,219 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.CosmosDB.Models +{ + internal partial class FleetspaceListResult : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(FleetspaceListResult)} does not support writing '{format}' format."); + } + + if (options.Format != "W" && Optional.IsCollectionDefined(Value)) + { + writer.WritePropertyName("value"u8); + writer.WriteStartArray(); + foreach (var item in Value) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && Optional.IsDefined(NextLink)) + { + writer.WritePropertyName("nextLink"u8); + writer.WriteStringValue(NextLink); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + FleetspaceListResult 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(FleetspaceListResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeFleetspaceListResult(document.RootElement, options); + } + + internal static FleetspaceListResult DeserializeFleetspaceListResult(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IReadOnlyList value = default; + string nextLink = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(FleetspaceResourceData.DeserializeFleetspaceResourceData(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 FleetspaceListResult(value ?? new ChangeTrackingList(), nextLink, serializedAdditionalRawData); + } + + private BinaryData SerializeBicep(ModelReaderWriterOptions options) + { + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Value), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" value: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsCollectionDefined(Value)) + { + if (Value.Any()) + { + builder.Append(" value: "); + builder.AppendLine("["); + foreach (var item in Value) + { + BicepSerializationHelpers.AppendChildObject(builder, item, options, 4, true, " value: "); + } + builder.AppendLine(" ]"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(NextLink), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" nextLink: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(NextLink)) + { + builder.Append(" nextLink: "); + if (NextLink.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{NextLink}'''"); + } + else + { + builder.AppendLine($"'{NextLink}'"); + } + } + } + + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + case "bicep": + return SerializeBicep(options); + default: + throw new FormatException($"The model {nameof(FleetspaceListResult)} does not support writing '{options.Format}' format."); + } + } + + FleetspaceListResult 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 DeserializeFleetspaceListResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(FleetspaceListResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/FleetspaceListResult.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/FleetspaceListResult.cs new file mode 100644 index 000000000000..4177a8df3f0b --- /dev/null +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/FleetspaceListResult.cs @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.CosmosDB.Models +{ + /// The response of the List operation that contains the fleetspaces and their properties. + internal partial class FleetspaceListResult + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + internal FleetspaceListResult() + { + Value = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// List of fleetspaces and their properties. + /// The link used to get the next page of results. + /// Keeps track of any properties unknown to the library. + internal FleetspaceListResult(IReadOnlyList value, string nextLink, IDictionary serializedAdditionalRawData) + { + Value = value; + NextLink = nextLink; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// List of fleetspaces and their properties. + public IReadOnlyList Value { get; } + /// The link used to get the next page of results. + public string NextLink { get; } + } +} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/FleetspacePropertiesFleetspaceApiKind.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/FleetspacePropertiesFleetspaceApiKind.cs new file mode 100644 index 000000000000..8b55e981c1b6 --- /dev/null +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/FleetspacePropertiesFleetspaceApiKind.cs @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.CosmosDB.Models +{ + /// The kind of API this fleetspace belongs to. Acceptable values: 'NoSQL'. + public readonly partial struct FleetspacePropertiesFleetspaceApiKind : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public FleetspacePropertiesFleetspaceApiKind(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string NoSQLValue = "NoSQL"; + + /// NoSQL. + public static FleetspacePropertiesFleetspaceApiKind NoSQL { get; } = new FleetspacePropertiesFleetspaceApiKind(NoSQLValue); + /// Determines if two values are the same. + public static bool operator ==(FleetspacePropertiesFleetspaceApiKind left, FleetspacePropertiesFleetspaceApiKind right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(FleetspacePropertiesFleetspaceApiKind left, FleetspacePropertiesFleetspaceApiKind right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator FleetspacePropertiesFleetspaceApiKind(string value) => new FleetspacePropertiesFleetspaceApiKind(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is FleetspacePropertiesFleetspaceApiKind other && Equals(other); + /// + public bool Equals(FleetspacePropertiesFleetspaceApiKind other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/FleetspacePropertiesThroughputPoolConfiguration.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/FleetspacePropertiesThroughputPoolConfiguration.Serialization.cs new file mode 100644 index 000000000000..99c3423bb42b --- /dev/null +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/FleetspacePropertiesThroughputPoolConfiguration.Serialization.cs @@ -0,0 +1,288 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.CosmosDB.Models +{ + public partial class FleetspacePropertiesThroughputPoolConfiguration : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(FleetspacePropertiesThroughputPoolConfiguration)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(MinThroughput)) + { + writer.WritePropertyName("minThroughput"u8); + writer.WriteNumberValue(MinThroughput.Value); + } + if (Optional.IsDefined(MaxThroughput)) + { + writer.WritePropertyName("maxThroughput"u8); + writer.WriteNumberValue(MaxThroughput.Value); + } + if (Optional.IsDefined(ServiceTier)) + { + writer.WritePropertyName("serviceTier"u8); + writer.WriteStringValue(ServiceTier.Value.ToString()); + } + if (Optional.IsCollectionDefined(DataRegions)) + { + writer.WritePropertyName("dataRegions"u8); + writer.WriteStartArray(); + foreach (var item in DataRegions) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + FleetspacePropertiesThroughputPoolConfiguration 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(FleetspacePropertiesThroughputPoolConfiguration)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeFleetspacePropertiesThroughputPoolConfiguration(document.RootElement, options); + } + + internal static FleetspacePropertiesThroughputPoolConfiguration DeserializeFleetspacePropertiesThroughputPoolConfiguration(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + int? minThroughput = default; + int? maxThroughput = default; + FleetspacePropertiesThroughputPoolConfigurationServiceTier? serviceTier = default; + IList dataRegions = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("minThroughput"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + minThroughput = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("maxThroughput"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + maxThroughput = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("serviceTier"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + serviceTier = new FleetspacePropertiesThroughputPoolConfigurationServiceTier(property.Value.GetString()); + continue; + } + if (property.NameEquals("dataRegions"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + dataRegions = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new FleetspacePropertiesThroughputPoolConfiguration(minThroughput, maxThroughput, serviceTier, dataRegions ?? new ChangeTrackingList(), serializedAdditionalRawData); + } + + private BinaryData SerializeBicep(ModelReaderWriterOptions options) + { + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(MinThroughput), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" minThroughput: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(MinThroughput)) + { + builder.Append(" minThroughput: "); + builder.AppendLine($"{MinThroughput.Value}"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(MaxThroughput), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" maxThroughput: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(MaxThroughput)) + { + builder.Append(" maxThroughput: "); + builder.AppendLine($"{MaxThroughput.Value}"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(ServiceTier), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" serviceTier: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(ServiceTier)) + { + builder.Append(" serviceTier: "); + builder.AppendLine($"'{ServiceTier.Value.ToString()}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(DataRegions), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" dataRegions: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsCollectionDefined(DataRegions)) + { + if (DataRegions.Any()) + { + builder.Append(" dataRegions: "); + builder.AppendLine("["); + foreach (var item in DataRegions) + { + if (item == null) + { + builder.Append("null"); + continue; + } + if (item.Contains(Environment.NewLine)) + { + builder.AppendLine(" '''"); + builder.AppendLine($"{item}'''"); + } + else + { + builder.AppendLine($" '{item}'"); + } + } + builder.AppendLine(" ]"); + } + } + } + + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + case "bicep": + return SerializeBicep(options); + default: + throw new FormatException($"The model {nameof(FleetspacePropertiesThroughputPoolConfiguration)} does not support writing '{options.Format}' format."); + } + } + + FleetspacePropertiesThroughputPoolConfiguration 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 DeserializeFleetspacePropertiesThroughputPoolConfiguration(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(FleetspacePropertiesThroughputPoolConfiguration)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/FleetspacePropertiesThroughputPoolConfiguration.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/FleetspacePropertiesThroughputPoolConfiguration.cs new file mode 100644 index 000000000000..4efe83e906a0 --- /dev/null +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/FleetspacePropertiesThroughputPoolConfiguration.cs @@ -0,0 +1,82 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.CosmosDB.Models +{ + /// Configuration for throughput pool in the fleetspace. + public partial class FleetspacePropertiesThroughputPoolConfiguration + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public FleetspacePropertiesThroughputPoolConfiguration() + { + DataRegions = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// Minimum throughput for the pool. + /// Maximum throughput for the pool. + /// Service Tier for the fleetspace. GeneralPurpose types refers to single write region accounts that can be added to this fleetspace, whereas BusinessCritical refers to multi write region. + /// List of data regions assigned to the fleetspace. Eg [westus2]. + /// Keeps track of any properties unknown to the library. + internal FleetspacePropertiesThroughputPoolConfiguration(int? minThroughput, int? maxThroughput, FleetspacePropertiesThroughputPoolConfigurationServiceTier? serviceTier, IList dataRegions, IDictionary serializedAdditionalRawData) + { + MinThroughput = minThroughput; + MaxThroughput = maxThroughput; + ServiceTier = serviceTier; + DataRegions = dataRegions; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Minimum throughput for the pool. + [WirePath("minThroughput")] + public int? MinThroughput { get; set; } + /// Maximum throughput for the pool. + [WirePath("maxThroughput")] + public int? MaxThroughput { get; set; } + /// Service Tier for the fleetspace. GeneralPurpose types refers to single write region accounts that can be added to this fleetspace, whereas BusinessCritical refers to multi write region. + [WirePath("serviceTier")] + public FleetspacePropertiesThroughputPoolConfigurationServiceTier? ServiceTier { get; set; } + /// List of data regions assigned to the fleetspace. Eg [westus2]. + [WirePath("dataRegions")] + public IList DataRegions { get; } + } +} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/FleetspacePropertiesThroughputPoolConfigurationServiceTier.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/FleetspacePropertiesThroughputPoolConfigurationServiceTier.cs new file mode 100644 index 000000000000..6d89c265ab24 --- /dev/null +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/FleetspacePropertiesThroughputPoolConfigurationServiceTier.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.CosmosDB.Models +{ + /// Service Tier for the fleetspace. GeneralPurpose types refers to single write region accounts that can be added to this fleetspace, whereas BusinessCritical refers to multi write region. + public readonly partial struct FleetspacePropertiesThroughputPoolConfigurationServiceTier : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public FleetspacePropertiesThroughputPoolConfigurationServiceTier(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string GeneralPurposeValue = "GeneralPurpose"; + private const string BusinessCriticalValue = "BusinessCritical"; + + /// GeneralPurpose. + public static FleetspacePropertiesThroughputPoolConfigurationServiceTier GeneralPurpose { get; } = new FleetspacePropertiesThroughputPoolConfigurationServiceTier(GeneralPurposeValue); + /// BusinessCritical. + public static FleetspacePropertiesThroughputPoolConfigurationServiceTier BusinessCritical { get; } = new FleetspacePropertiesThroughputPoolConfigurationServiceTier(BusinessCriticalValue); + /// Determines if two values are the same. + public static bool operator ==(FleetspacePropertiesThroughputPoolConfigurationServiceTier left, FleetspacePropertiesThroughputPoolConfigurationServiceTier right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(FleetspacePropertiesThroughputPoolConfigurationServiceTier left, FleetspacePropertiesThroughputPoolConfigurationServiceTier right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator FleetspacePropertiesThroughputPoolConfigurationServiceTier(string value) => new FleetspacePropertiesThroughputPoolConfigurationServiceTier(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is FleetspacePropertiesThroughputPoolConfigurationServiceTier other && Equals(other); + /// + public bool Equals(FleetspacePropertiesThroughputPoolConfigurationServiceTier other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/FleetspaceResourcePatch.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/FleetspaceResourcePatch.Serialization.cs new file mode 100644 index 000000000000..84e7ee3f6b3b --- /dev/null +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/FleetspaceResourcePatch.Serialization.cs @@ -0,0 +1,178 @@ +// 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.CosmosDB.Models +{ + public partial class FleetspaceResourcePatch : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(FleetspaceResourcePatch)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("properties"u8); + writer.WriteStartObject(); + if (Optional.IsDefined(ProvisioningState)) + { + writer.WritePropertyName("provisioningState"u8); + writer.WriteStringValue(ProvisioningState.Value.ToString()); + } + if (Optional.IsDefined(FleetspaceApiKind)) + { + writer.WritePropertyName("fleetspaceApiKind"u8); + writer.WriteStringValue(FleetspaceApiKind.Value.ToString()); + } + if (Optional.IsDefined(ThroughputPoolConfiguration)) + { + writer.WritePropertyName("throughputPoolConfiguration"u8); + writer.WriteObjectValue(ThroughputPoolConfiguration, options); + } + writer.WriteEndObject(); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + FleetspaceResourcePatch 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(FleetspaceResourcePatch)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeFleetspaceResourcePatch(document.RootElement, options); + } + + internal static FleetspaceResourcePatch DeserializeFleetspaceResourcePatch(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + CosmosDBStatus? provisioningState = default; + FleetspacePropertiesFleetspaceApiKind? fleetspaceApiKind = default; + FleetspacePropertiesThroughputPoolConfiguration throughputPoolConfiguration = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("properties"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + foreach (var property0 in property.Value.EnumerateObject()) + { + if (property0.NameEquals("provisioningState"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + provisioningState = new CosmosDBStatus(property0.Value.GetString()); + continue; + } + if (property0.NameEquals("fleetspaceApiKind"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + fleetspaceApiKind = new FleetspacePropertiesFleetspaceApiKind(property0.Value.GetString()); + continue; + } + if (property0.NameEquals("throughputPoolConfiguration"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + throughputPoolConfiguration = FleetspacePropertiesThroughputPoolConfiguration.DeserializeFleetspacePropertiesThroughputPoolConfiguration(property0.Value, options); + continue; + } + } + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new FleetspaceResourcePatch(provisioningState, fleetspaceApiKind, throughputPoolConfiguration, 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); + default: + throw new FormatException($"The model {nameof(FleetspaceResourcePatch)} does not support writing '{options.Format}' format."); + } + } + + FleetspaceResourcePatch 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 DeserializeFleetspaceResourcePatch(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(FleetspaceResourcePatch)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/FleetspaceResourcePatch.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/FleetspaceResourcePatch.cs new file mode 100644 index 000000000000..a1070cd80990 --- /dev/null +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/FleetspaceResourcePatch.cs @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.CosmosDB.Models +{ + /// Represents a fleetspace resource for updates. + public partial class FleetspaceResourcePatch + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public FleetspaceResourcePatch() + { + } + + /// Initializes a new instance of . + /// A provisioning state of the Fleetspace. + /// The kind of API this fleetspace belongs to. Acceptable values: 'NoSQL'. + /// Configuration for throughput pool in the fleetspace. + /// Keeps track of any properties unknown to the library. + internal FleetspaceResourcePatch(CosmosDBStatus? provisioningState, FleetspacePropertiesFleetspaceApiKind? fleetspaceApiKind, FleetspacePropertiesThroughputPoolConfiguration throughputPoolConfiguration, IDictionary serializedAdditionalRawData) + { + ProvisioningState = provisioningState; + FleetspaceApiKind = fleetspaceApiKind; + ThroughputPoolConfiguration = throughputPoolConfiguration; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// A provisioning state of the Fleetspace. + [WirePath("properties.provisioningState")] + public CosmosDBStatus? ProvisioningState { get; set; } + /// The kind of API this fleetspace belongs to. Acceptable values: 'NoSQL'. + [WirePath("properties.fleetspaceApiKind")] + public FleetspacePropertiesFleetspaceApiKind? FleetspaceApiKind { get; set; } + /// Configuration for throughput pool in the fleetspace. + [WirePath("properties.throughputPoolConfiguration")] + public FleetspacePropertiesThroughputPoolConfiguration ThroughputPoolConfiguration { get; set; } + } +} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/FullTextPath.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/FullTextPath.Serialization.cs new file mode 100644 index 000000000000..19c10fccd11a --- /dev/null +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/FullTextPath.Serialization.cs @@ -0,0 +1,201 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.CosmosDB.Models +{ + public partial class FullTextPath : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(FullTextPath)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("path"u8); + writer.WriteStringValue(Path); + if (Optional.IsDefined(Language)) + { + writer.WritePropertyName("language"u8); + writer.WriteStringValue(Language); + } + 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 + } + } + } + + FullTextPath 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(FullTextPath)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeFullTextPath(document.RootElement, options); + } + + internal static FullTextPath DeserializeFullTextPath(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string path = default; + string language = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("path"u8)) + { + path = property.Value.GetString(); + continue; + } + if (property.NameEquals("language"u8)) + { + language = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new FullTextPath(path, language, serializedAdditionalRawData); + } + + private BinaryData SerializeBicep(ModelReaderWriterOptions options) + { + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Path), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" path: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Path)) + { + builder.Append(" path: "); + if (Path.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{Path}'''"); + } + else + { + builder.AppendLine($"'{Path}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Language), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" language: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Language)) + { + builder.Append(" language: "); + if (Language.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{Language}'''"); + } + else + { + builder.AppendLine($"'{Language}'"); + } + } + } + + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + case "bicep": + return SerializeBicep(options); + default: + throw new FormatException($"The model {nameof(FullTextPath)} does not support writing '{options.Format}' format."); + } + } + + FullTextPath 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 DeserializeFullTextPath(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(FullTextPath)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/FullTextPath.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/FullTextPath.cs new file mode 100644 index 000000000000..d58343551865 --- /dev/null +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/FullTextPath.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.CosmosDB.Models +{ + /// Represents the full text path specification. + public partial class FullTextPath + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The path to the full text field in the document. + /// is null. + public FullTextPath(string path) + { + Argument.AssertNotNull(path, nameof(path)); + + Path = path; + } + + /// Initializes a new instance of . + /// The path to the full text field in the document. + /// The language of the full text field in the document. + /// Keeps track of any properties unknown to the library. + internal FullTextPath(string path, string language, IDictionary serializedAdditionalRawData) + { + Path = path; + Language = language; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal FullTextPath() + { + } + + /// The path to the full text field in the document. + [WirePath("path")] + public string Path { get; set; } + /// The language of the full text field in the document. + [WirePath("language")] + public string Language { get; set; } + } +} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/FullTextPolicy.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/FullTextPolicy.Serialization.cs new file mode 100644 index 000000000000..03cb919d60d3 --- /dev/null +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/FullTextPolicy.Serialization.cs @@ -0,0 +1,219 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.CosmosDB.Models +{ + public partial class FullTextPolicy : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(FullTextPolicy)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(DefaultLanguage)) + { + writer.WritePropertyName("defaultLanguage"u8); + writer.WriteStringValue(DefaultLanguage); + } + if (Optional.IsCollectionDefined(FullTextPaths)) + { + writer.WritePropertyName("fullTextPaths"u8); + writer.WriteStartArray(); + foreach (var item in FullTextPaths) + { + 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 + } + } + } + + FullTextPolicy 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(FullTextPolicy)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeFullTextPolicy(document.RootElement, options); + } + + internal static FullTextPolicy DeserializeFullTextPolicy(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string defaultLanguage = default; + IList fullTextPaths = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("defaultLanguage"u8)) + { + defaultLanguage = property.Value.GetString(); + continue; + } + if (property.NameEquals("fullTextPaths"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(FullTextPath.DeserializeFullTextPath(item, options)); + } + fullTextPaths = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new FullTextPolicy(defaultLanguage, fullTextPaths ?? new ChangeTrackingList(), serializedAdditionalRawData); + } + + private BinaryData SerializeBicep(ModelReaderWriterOptions options) + { + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(DefaultLanguage), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" defaultLanguage: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(DefaultLanguage)) + { + builder.Append(" defaultLanguage: "); + if (DefaultLanguage.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{DefaultLanguage}'''"); + } + else + { + builder.AppendLine($"'{DefaultLanguage}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(FullTextPaths), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" fullTextPaths: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsCollectionDefined(FullTextPaths)) + { + if (FullTextPaths.Any()) + { + builder.Append(" fullTextPaths: "); + builder.AppendLine("["); + foreach (var item in FullTextPaths) + { + BicepSerializationHelpers.AppendChildObject(builder, item, options, 4, true, " fullTextPaths: "); + } + builder.AppendLine(" ]"); + } + } + } + + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + case "bicep": + return SerializeBicep(options); + default: + throw new FormatException($"The model {nameof(FullTextPolicy)} does not support writing '{options.Format}' format."); + } + } + + FullTextPolicy 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 DeserializeFullTextPolicy(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(FullTextPolicy)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/FullTextPolicy.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/FullTextPolicy.cs new file mode 100644 index 000000000000..0dec4264e4c1 --- /dev/null +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/FullTextPolicy.cs @@ -0,0 +1,72 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.CosmosDB.Models +{ + /// Cosmos DB FullText Policy. + public partial class FullTextPolicy + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public FullTextPolicy() + { + FullTextPaths = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// The default language for a full text paths. + /// List of FullText Paths. + /// Keeps track of any properties unknown to the library. + internal FullTextPolicy(string defaultLanguage, IList fullTextPaths, IDictionary serializedAdditionalRawData) + { + DefaultLanguage = defaultLanguage; + FullTextPaths = fullTextPaths; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The default language for a full text paths. + [WirePath("defaultLanguage")] + public string DefaultLanguage { get; set; } + /// List of FullText Paths. + [WirePath("fullTextPaths")] + public IList FullTextPaths { get; } + } +} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/GremlinRoleAssignmentListResult.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/GremlinRoleAssignmentListResult.Serialization.cs new file mode 100644 index 000000000000..954cf080b0d9 --- /dev/null +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/GremlinRoleAssignmentListResult.Serialization.cs @@ -0,0 +1,219 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.CosmosDB.Models +{ + internal partial class GremlinRoleAssignmentListResult : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(GremlinRoleAssignmentListResult)} does not support writing '{format}' format."); + } + + if (options.Format != "W" && Optional.IsCollectionDefined(Value)) + { + writer.WritePropertyName("value"u8); + writer.WriteStartArray(); + foreach (var item in Value) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && Optional.IsDefined(NextLink)) + { + writer.WritePropertyName("nextLink"u8); + writer.WriteStringValue(NextLink); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + GremlinRoleAssignmentListResult 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(GremlinRoleAssignmentListResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeGremlinRoleAssignmentListResult(document.RootElement, options); + } + + internal static GremlinRoleAssignmentListResult DeserializeGremlinRoleAssignmentListResult(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IReadOnlyList value = default; + string nextLink = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(GremlinRoleAssignmentResourceData.DeserializeGremlinRoleAssignmentResourceData(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 GremlinRoleAssignmentListResult(value ?? new ChangeTrackingList(), nextLink, serializedAdditionalRawData); + } + + private BinaryData SerializeBicep(ModelReaderWriterOptions options) + { + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Value), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" value: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsCollectionDefined(Value)) + { + if (Value.Any()) + { + builder.Append(" value: "); + builder.AppendLine("["); + foreach (var item in Value) + { + BicepSerializationHelpers.AppendChildObject(builder, item, options, 4, true, " value: "); + } + builder.AppendLine(" ]"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(NextLink), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" nextLink: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(NextLink)) + { + builder.Append(" nextLink: "); + if (NextLink.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{NextLink}'''"); + } + else + { + builder.AppendLine($"'{NextLink}'"); + } + } + } + + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + case "bicep": + return SerializeBicep(options); + default: + throw new FormatException($"The model {nameof(GremlinRoleAssignmentListResult)} does not support writing '{options.Format}' format."); + } + } + + GremlinRoleAssignmentListResult 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 DeserializeGremlinRoleAssignmentListResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(GremlinRoleAssignmentListResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/GremlinRoleAssignmentListResult.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/GremlinRoleAssignmentListResult.cs new file mode 100644 index 000000000000..cc959a218fb3 --- /dev/null +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/GremlinRoleAssignmentListResult.cs @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.CosmosDB.Models +{ + /// The relevant Role Assignments. + internal partial class GremlinRoleAssignmentListResult + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + internal GremlinRoleAssignmentListResult() + { + Value = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// List of Role Assignments and their properties. + /// The link used to get the next page of results. + /// Keeps track of any properties unknown to the library. + internal GremlinRoleAssignmentListResult(IReadOnlyList value, string nextLink, IDictionary serializedAdditionalRawData) + { + Value = value; + NextLink = nextLink; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// List of Role Assignments and their properties. + public IReadOnlyList Value { get; } + /// The link used to get the next page of results. + public string NextLink { get; } + } +} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/GremlinRoleDefinitionListResult.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/GremlinRoleDefinitionListResult.Serialization.cs new file mode 100644 index 000000000000..988eb1f715c7 --- /dev/null +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/GremlinRoleDefinitionListResult.Serialization.cs @@ -0,0 +1,219 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.CosmosDB.Models +{ + internal partial class GremlinRoleDefinitionListResult : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(GremlinRoleDefinitionListResult)} does not support writing '{format}' format."); + } + + if (options.Format != "W" && Optional.IsCollectionDefined(Value)) + { + writer.WritePropertyName("value"u8); + writer.WriteStartArray(); + foreach (var item in Value) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && Optional.IsDefined(NextLink)) + { + writer.WritePropertyName("nextLink"u8); + writer.WriteStringValue(NextLink); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + GremlinRoleDefinitionListResult 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(GremlinRoleDefinitionListResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeGremlinRoleDefinitionListResult(document.RootElement, options); + } + + internal static GremlinRoleDefinitionListResult DeserializeGremlinRoleDefinitionListResult(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IReadOnlyList value = default; + string nextLink = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(GremlinRoleDefinitionResourceData.DeserializeGremlinRoleDefinitionResourceData(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 GremlinRoleDefinitionListResult(value ?? new ChangeTrackingList(), nextLink, serializedAdditionalRawData); + } + + private BinaryData SerializeBicep(ModelReaderWriterOptions options) + { + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Value), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" value: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsCollectionDefined(Value)) + { + if (Value.Any()) + { + builder.Append(" value: "); + builder.AppendLine("["); + foreach (var item in Value) + { + BicepSerializationHelpers.AppendChildObject(builder, item, options, 4, true, " value: "); + } + builder.AppendLine(" ]"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(NextLink), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" nextLink: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(NextLink)) + { + builder.Append(" nextLink: "); + if (NextLink.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{NextLink}'''"); + } + else + { + builder.AppendLine($"'{NextLink}'"); + } + } + } + + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + case "bicep": + return SerializeBicep(options); + default: + throw new FormatException($"The model {nameof(GremlinRoleDefinitionListResult)} does not support writing '{options.Format}' format."); + } + } + + GremlinRoleDefinitionListResult 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 DeserializeGremlinRoleDefinitionListResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(GremlinRoleDefinitionListResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/GremlinRoleDefinitionListResult.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/GremlinRoleDefinitionListResult.cs new file mode 100644 index 000000000000..16f4a228970c --- /dev/null +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/GremlinRoleDefinitionListResult.cs @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.CosmosDB.Models +{ + /// The relevant Role Definitions. + internal partial class GremlinRoleDefinitionListResult + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + internal GremlinRoleDefinitionListResult() + { + Value = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// List of Role Definitions and their properties. + /// The link used to get the next page of results. + /// Keeps track of any properties unknown to the library. + internal GremlinRoleDefinitionListResult(IReadOnlyList value, string nextLink, IDictionary serializedAdditionalRawData) + { + Value = value; + NextLink = nextLink; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// List of Role Definitions and their properties. + public IReadOnlyList Value { get; } + /// The link used to get the next page of results. + public string NextLink { get; } + } +} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/MaterializedViewDetails.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/MaterializedViewDetails.Serialization.cs new file mode 100644 index 000000000000..48b50428c1da --- /dev/null +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/MaterializedViewDetails.Serialization.cs @@ -0,0 +1,204 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.CosmosDB.Models +{ + public partial class MaterializedViewDetails : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(MaterializedViewDetails)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(Id)) + { + writer.WritePropertyName("id"u8); + writer.WriteStringValue(Id); + } + if (Optional.IsDefined(Rid)) + { + writer.WritePropertyName("_rid"u8); + writer.WriteStringValue(Rid); + } + 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 + } + } + } + + MaterializedViewDetails 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(MaterializedViewDetails)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeMaterializedViewDetails(document.RootElement, options); + } + + internal static MaterializedViewDetails DeserializeMaterializedViewDetails(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string id = default; + string rid = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("id"u8)) + { + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("_rid"u8)) + { + rid = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new MaterializedViewDetails(id, rid, serializedAdditionalRawData); + } + + private BinaryData SerializeBicep(ModelReaderWriterOptions options) + { + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Id), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" id: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Id)) + { + builder.Append(" id: "); + if (Id.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{Id}'''"); + } + else + { + builder.AppendLine($"'{Id}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Rid), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" _rid: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Rid)) + { + builder.Append(" _rid: "); + if (Rid.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{Rid}'''"); + } + else + { + builder.AppendLine($"'{Rid}'"); + } + } + } + + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + case "bicep": + return SerializeBicep(options); + default: + throw new FormatException($"The model {nameof(MaterializedViewDetails)} does not support writing '{options.Format}' format."); + } + } + + MaterializedViewDetails 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 DeserializeMaterializedViewDetails(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(MaterializedViewDetails)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/MaterializedViewDetails.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/MaterializedViewDetails.cs new file mode 100644 index 000000000000..33063525d36e --- /dev/null +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/MaterializedViewDetails.cs @@ -0,0 +1,71 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.CosmosDB.Models +{ + /// MaterializedViewDetails, contains Id & _rid fields of materialized view. + public partial class MaterializedViewDetails + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public MaterializedViewDetails() + { + } + + /// Initializes a new instance of . + /// Id field of Materialized container. + /// _rid field of Materialized container. + /// Keeps track of any properties unknown to the library. + internal MaterializedViewDetails(string id, string rid, IDictionary serializedAdditionalRawData) + { + Id = id; + Rid = rid; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Id field of Materialized container. + [WirePath("id")] + public string Id { get; set; } + /// _rid field of Materialized container. + [WirePath("_rid")] + public string Rid { get; set; } + } +} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/MongoMIRoleAssignmentListResult.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/MongoMIRoleAssignmentListResult.Serialization.cs new file mode 100644 index 000000000000..d63cc4bf4962 --- /dev/null +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/MongoMIRoleAssignmentListResult.Serialization.cs @@ -0,0 +1,219 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.CosmosDB.Models +{ + internal partial class MongoMIRoleAssignmentListResult : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(MongoMIRoleAssignmentListResult)} does not support writing '{format}' format."); + } + + if (options.Format != "W" && Optional.IsCollectionDefined(Value)) + { + writer.WritePropertyName("value"u8); + writer.WriteStartArray(); + foreach (var item in Value) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && Optional.IsDefined(NextLink)) + { + writer.WritePropertyName("nextLink"u8); + writer.WriteStringValue(NextLink); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + MongoMIRoleAssignmentListResult 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(MongoMIRoleAssignmentListResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeMongoMIRoleAssignmentListResult(document.RootElement, options); + } + + internal static MongoMIRoleAssignmentListResult DeserializeMongoMIRoleAssignmentListResult(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IReadOnlyList value = default; + string nextLink = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(MongoMIRoleAssignmentResourceData.DeserializeMongoMIRoleAssignmentResourceData(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 MongoMIRoleAssignmentListResult(value ?? new ChangeTrackingList(), nextLink, serializedAdditionalRawData); + } + + private BinaryData SerializeBicep(ModelReaderWriterOptions options) + { + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Value), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" value: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsCollectionDefined(Value)) + { + if (Value.Any()) + { + builder.Append(" value: "); + builder.AppendLine("["); + foreach (var item in Value) + { + BicepSerializationHelpers.AppendChildObject(builder, item, options, 4, true, " value: "); + } + builder.AppendLine(" ]"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(NextLink), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" nextLink: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(NextLink)) + { + builder.Append(" nextLink: "); + if (NextLink.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{NextLink}'''"); + } + else + { + builder.AppendLine($"'{NextLink}'"); + } + } + } + + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + case "bicep": + return SerializeBicep(options); + default: + throw new FormatException($"The model {nameof(MongoMIRoleAssignmentListResult)} does not support writing '{options.Format}' format."); + } + } + + MongoMIRoleAssignmentListResult 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 DeserializeMongoMIRoleAssignmentListResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(MongoMIRoleAssignmentListResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/MongoMIRoleAssignmentListResult.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/MongoMIRoleAssignmentListResult.cs new file mode 100644 index 000000000000..4962f61b6972 --- /dev/null +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/MongoMIRoleAssignmentListResult.cs @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.CosmosDB.Models +{ + /// The relevant Role Assignments. + internal partial class MongoMIRoleAssignmentListResult + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + internal MongoMIRoleAssignmentListResult() + { + Value = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// List of Role Assignments and their properties. + /// The link used to get the next page of results. + /// Keeps track of any properties unknown to the library. + internal MongoMIRoleAssignmentListResult(IReadOnlyList value, string nextLink, IDictionary serializedAdditionalRawData) + { + Value = value; + NextLink = nextLink; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// List of Role Assignments and their properties. + public IReadOnlyList Value { get; } + /// The link used to get the next page of results. + public string NextLink { get; } + } +} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/MongoMIRoleDefinitionListResult.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/MongoMIRoleDefinitionListResult.Serialization.cs new file mode 100644 index 000000000000..d225bbed5fb3 --- /dev/null +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/MongoMIRoleDefinitionListResult.Serialization.cs @@ -0,0 +1,219 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.CosmosDB.Models +{ + internal partial class MongoMIRoleDefinitionListResult : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(MongoMIRoleDefinitionListResult)} does not support writing '{format}' format."); + } + + if (options.Format != "W" && Optional.IsCollectionDefined(Value)) + { + writer.WritePropertyName("value"u8); + writer.WriteStartArray(); + foreach (var item in Value) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && Optional.IsDefined(NextLink)) + { + writer.WritePropertyName("nextLink"u8); + writer.WriteStringValue(NextLink); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + MongoMIRoleDefinitionListResult 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(MongoMIRoleDefinitionListResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeMongoMIRoleDefinitionListResult(document.RootElement, options); + } + + internal static MongoMIRoleDefinitionListResult DeserializeMongoMIRoleDefinitionListResult(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IReadOnlyList value = default; + string nextLink = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(MongoMIRoleDefinitionResourceData.DeserializeMongoMIRoleDefinitionResourceData(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 MongoMIRoleDefinitionListResult(value ?? new ChangeTrackingList(), nextLink, serializedAdditionalRawData); + } + + private BinaryData SerializeBicep(ModelReaderWriterOptions options) + { + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Value), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" value: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsCollectionDefined(Value)) + { + if (Value.Any()) + { + builder.Append(" value: "); + builder.AppendLine("["); + foreach (var item in Value) + { + BicepSerializationHelpers.AppendChildObject(builder, item, options, 4, true, " value: "); + } + builder.AppendLine(" ]"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(NextLink), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" nextLink: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(NextLink)) + { + builder.Append(" nextLink: "); + if (NextLink.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{NextLink}'''"); + } + else + { + builder.AppendLine($"'{NextLink}'"); + } + } + } + + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + case "bicep": + return SerializeBicep(options); + default: + throw new FormatException($"The model {nameof(MongoMIRoleDefinitionListResult)} does not support writing '{options.Format}' format."); + } + } + + MongoMIRoleDefinitionListResult 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 DeserializeMongoMIRoleDefinitionListResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(MongoMIRoleDefinitionListResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/MongoMIRoleDefinitionListResult.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/MongoMIRoleDefinitionListResult.cs new file mode 100644 index 000000000000..913882395f83 --- /dev/null +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/MongoMIRoleDefinitionListResult.cs @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.CosmosDB.Models +{ + /// The relevant Role Definitions. + internal partial class MongoMIRoleDefinitionListResult + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + internal MongoMIRoleDefinitionListResult() + { + Value = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// List of Role Definitions and their properties. + /// The link used to get the next page of results. + /// Keeps track of any properties unknown to the library. + internal MongoMIRoleDefinitionListResult(IReadOnlyList value, string nextLink, IDictionary serializedAdditionalRawData) + { + Value = value; + NextLink = nextLink; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// List of Role Definitions and their properties. + public IReadOnlyList Value { get; } + /// The link used to get the next page of results. + public string NextLink { get; } + } +} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/MongoRUToMongoRUCopyJobProperties.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/MongoRUToMongoRUCopyJobProperties.Serialization.cs new file mode 100644 index 000000000000..736264353993 --- /dev/null +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/MongoRUToMongoRUCopyJobProperties.Serialization.cs @@ -0,0 +1,248 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.CosmosDB.Models +{ + public partial class MongoRUToMongoRUCopyJobProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(MongoRUToMongoRUCopyJobProperties)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + if (Optional.IsDefined(SourceDetails)) + { + writer.WritePropertyName("sourceDetails"u8); + writer.WriteObjectValue(SourceDetails, options); + } + if (Optional.IsDefined(DestinationDetails)) + { + writer.WritePropertyName("destinationDetails"u8); + writer.WriteObjectValue(DestinationDetails, options); + } + writer.WritePropertyName("tasks"u8); + writer.WriteStartArray(); + foreach (var item in Tasks) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + + MongoRUToMongoRUCopyJobProperties 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(MongoRUToMongoRUCopyJobProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeMongoRUToMongoRUCopyJobProperties(document.RootElement, options); + } + + internal static MongoRUToMongoRUCopyJobProperties DeserializeMongoRUToMongoRUCopyJobProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + CosmosDBSourceSinkDetails sourceDetails = default; + CosmosDBSourceSinkDetails destinationDetails = default; + IList tasks = default; + CopyJobType jobType = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("sourceDetails"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + sourceDetails = CosmosDBSourceSinkDetails.DeserializeCosmosDBSourceSinkDetails(property.Value, options); + continue; + } + if (property.NameEquals("destinationDetails"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + destinationDetails = CosmosDBSourceSinkDetails.DeserializeCosmosDBSourceSinkDetails(property.Value, options); + continue; + } + if (property.NameEquals("tasks"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(MongoRUToMongoRUCopyJobTask.DeserializeMongoRUToMongoRUCopyJobTask(item, options)); + } + tasks = array; + continue; + } + if (property.NameEquals("jobType"u8)) + { + jobType = new CopyJobType(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new MongoRUToMongoRUCopyJobProperties(jobType, serializedAdditionalRawData, sourceDetails, destinationDetails, tasks); + } + + private BinaryData SerializeBicep(ModelReaderWriterOptions options) + { + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue("SourceDetailsRemoteAccountName", out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" sourceDetails: "); + builder.AppendLine("{"); + builder.Append(" remoteAccountName: "); + builder.AppendLine(propertyOverride); + builder.AppendLine(" }"); + } + else + { + if (Optional.IsDefined(SourceDetails)) + { + builder.Append(" sourceDetails: "); + BicepSerializationHelpers.AppendChildObject(builder, SourceDetails, options, 2, false, " sourceDetails: "); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue("DestinationDetailsRemoteAccountName", out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" destinationDetails: "); + builder.AppendLine("{"); + builder.Append(" remoteAccountName: "); + builder.AppendLine(propertyOverride); + builder.AppendLine(" }"); + } + else + { + if (Optional.IsDefined(DestinationDetails)) + { + builder.Append(" destinationDetails: "); + BicepSerializationHelpers.AppendChildObject(builder, DestinationDetails, options, 2, false, " destinationDetails: "); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Tasks), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" tasks: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsCollectionDefined(Tasks)) + { + if (Tasks.Any()) + { + builder.Append(" tasks: "); + builder.AppendLine("["); + foreach (var item in Tasks) + { + BicepSerializationHelpers.AppendChildObject(builder, item, options, 4, true, " tasks: "); + } + builder.AppendLine(" ]"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(JobType), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" jobType: "); + builder.AppendLine(propertyOverride); + } + else + { + builder.Append(" jobType: "); + builder.AppendLine($"'{JobType.ToString()}'"); + } + + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + case "bicep": + return SerializeBicep(options); + default: + throw new FormatException($"The model {nameof(MongoRUToMongoRUCopyJobProperties)} does not support writing '{options.Format}' format."); + } + } + + MongoRUToMongoRUCopyJobProperties 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 DeserializeMongoRUToMongoRUCopyJobProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(MongoRUToMongoRUCopyJobProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/MongoRUToMongoRUCopyJobProperties.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/MongoRUToMongoRUCopyJobProperties.cs new file mode 100644 index 000000000000..018db471a8ca --- /dev/null +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/MongoRUToMongoRUCopyJobProperties.cs @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.ResourceManager.CosmosDB.Models +{ + /// Source Mongo to Destination Mongo copy job properties. + public partial class MongoRUToMongoRUCopyJobProperties : BaseCopyJobProperties + { + /// Initializes a new instance of . + /// Copy Job tasks. + /// is null. + public MongoRUToMongoRUCopyJobProperties(IEnumerable tasks) + { + Argument.AssertNotNull(tasks, nameof(tasks)); + + Tasks = tasks.ToList(); + JobType = CopyJobType.MongoRUToMongoRU; + } + + /// Initializes a new instance of . + /// Copy Job Type. + /// Keeps track of any properties unknown to the library. + /// Source Mongo DataStore details. + /// Destination Mongo DataStore details. + /// Copy Job tasks. + internal MongoRUToMongoRUCopyJobProperties(CopyJobType jobType, IDictionary serializedAdditionalRawData, CosmosDBSourceSinkDetails sourceDetails, CosmosDBSourceSinkDetails destinationDetails, IList tasks) : base(jobType, serializedAdditionalRawData) + { + SourceDetails = sourceDetails; + DestinationDetails = destinationDetails; + Tasks = tasks; + JobType = jobType; + } + + /// Initializes a new instance of for deserialization. + internal MongoRUToMongoRUCopyJobProperties() + { + } + + /// Source Mongo DataStore details. + internal CosmosDBSourceSinkDetails SourceDetails { get; set; } + /// Name of remote account in case of cross-account data transfer. + [WirePath("sourceDetails.remoteAccountName")] + public string SourceDetailsRemoteAccountName + { + get => SourceDetails is null ? default : SourceDetails.RemoteAccountName; + set + { + if (SourceDetails is null) + SourceDetails = new CosmosDBSourceSinkDetails(); + SourceDetails.RemoteAccountName = value; + } + } + + /// Destination Mongo DataStore details. + internal CosmosDBSourceSinkDetails DestinationDetails { get; set; } + /// Name of remote account in case of cross-account data transfer. + [WirePath("destinationDetails.remoteAccountName")] + public string DestinationDetailsRemoteAccountName + { + get => DestinationDetails is null ? default : DestinationDetails.RemoteAccountName; + set + { + if (DestinationDetails is null) + DestinationDetails = new CosmosDBSourceSinkDetails(); + DestinationDetails.RemoteAccountName = value; + } + } + + /// Copy Job tasks. + [WirePath("tasks")] + public IList Tasks { get; } + } +} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/MongoRUToMongoRUCopyJobTask.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/MongoRUToMongoRUCopyJobTask.Serialization.cs new file mode 100644 index 000000000000..4a75702944ae --- /dev/null +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/MongoRUToMongoRUCopyJobTask.Serialization.cs @@ -0,0 +1,218 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.CosmosDB.Models +{ + public partial class MongoRUToMongoRUCopyJobTask : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(MongoRUToMongoRUCopyJobTask)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + writer.WritePropertyName("source"u8); + writer.WriteObjectValue(Source, options); + writer.WritePropertyName("destination"u8); + writer.WriteObjectValue(Destination, options); + } + + MongoRUToMongoRUCopyJobTask 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(MongoRUToMongoRUCopyJobTask)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeMongoRUToMongoRUCopyJobTask(document.RootElement, options); + } + + internal static MongoRUToMongoRUCopyJobTask DeserializeMongoRUToMongoRUCopyJobTask(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + CosmosDBMongoCollection source = default; + CosmosDBMongoCollection destination = default; + long? totalCount = default; + long? processedCount = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("source"u8)) + { + source = CosmosDBMongoCollection.DeserializeCosmosDBMongoCollection(property.Value, options); + continue; + } + if (property.NameEquals("destination"u8)) + { + destination = CosmosDBMongoCollection.DeserializeCosmosDBMongoCollection(property.Value, options); + continue; + } + if (property.NameEquals("totalCount"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + totalCount = property.Value.GetInt64(); + continue; + } + if (property.NameEquals("processedCount"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + processedCount = property.Value.GetInt64(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new MongoRUToMongoRUCopyJobTask(totalCount, processedCount, serializedAdditionalRawData, source, destination); + } + + private BinaryData SerializeBicep(ModelReaderWriterOptions options) + { + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Source), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" source: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Source)) + { + builder.Append(" source: "); + BicepSerializationHelpers.AppendChildObject(builder, Source, options, 2, false, " source: "); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Destination), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" destination: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Destination)) + { + builder.Append(" destination: "); + BicepSerializationHelpers.AppendChildObject(builder, Destination, options, 2, false, " destination: "); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(TotalCount), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" totalCount: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(TotalCount)) + { + builder.Append(" totalCount: "); + builder.AppendLine($"'{TotalCount.Value.ToString()}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(ProcessedCount), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" processedCount: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(ProcessedCount)) + { + builder.Append(" processedCount: "); + builder.AppendLine($"'{ProcessedCount.Value.ToString()}'"); + } + } + + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + case "bicep": + return SerializeBicep(options); + default: + throw new FormatException($"The model {nameof(MongoRUToMongoRUCopyJobTask)} does not support writing '{options.Format}' format."); + } + } + + MongoRUToMongoRUCopyJobTask 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 DeserializeMongoRUToMongoRUCopyJobTask(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(MongoRUToMongoRUCopyJobTask)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/MongoRUToMongoRUCopyJobTask.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/MongoRUToMongoRUCopyJobTask.cs new file mode 100644 index 000000000000..b88c8e6f112b --- /dev/null +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/MongoRUToMongoRUCopyJobTask.cs @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.CosmosDB.Models +{ + /// The MongoRUToMongoRUCopyJobTask. + public partial class MongoRUToMongoRUCopyJobTask : BaseCopyJobTask + { + /// Initializes a new instance of . + /// Source Mongo (RU) collection. + /// Destination Mongo (RU) collection. + /// or is null. + public MongoRUToMongoRUCopyJobTask(CosmosDBMongoCollection source, CosmosDBMongoCollection destination) + { + Argument.AssertNotNull(source, nameof(source)); + Argument.AssertNotNull(destination, nameof(destination)); + + Source = source; + Destination = destination; + } + + /// Initializes a new instance of . + /// Task level Total Count. + /// Task level Processed Count. + /// Keeps track of any properties unknown to the library. + /// Source Mongo (RU) collection. + /// Destination Mongo (RU) collection. + internal MongoRUToMongoRUCopyJobTask(long? totalCount, long? processedCount, IDictionary serializedAdditionalRawData, CosmosDBMongoCollection source, CosmosDBMongoCollection destination) : base(totalCount, processedCount, serializedAdditionalRawData) + { + Source = source; + Destination = destination; + } + + /// Initializes a new instance of for deserialization. + internal MongoRUToMongoRUCopyJobTask() + { + } + + /// Source Mongo (RU) collection. + [WirePath("source")] + public CosmosDBMongoCollection Source { get; set; } + /// Destination Mongo (RU) collection. + [WirePath("destination")] + public CosmosDBMongoCollection Destination { get; set; } + } +} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/MongoRUToMongoVCoreCopyJobProperties.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/MongoRUToMongoVCoreCopyJobProperties.Serialization.cs new file mode 100644 index 000000000000..eb0b0b81dae2 --- /dev/null +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/MongoRUToMongoVCoreCopyJobProperties.Serialization.cs @@ -0,0 +1,238 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.CosmosDB.Models +{ + public partial class MongoRUToMongoVCoreCopyJobProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(MongoRUToMongoVCoreCopyJobProperties)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + if (Optional.IsDefined(SourceDetails)) + { + writer.WritePropertyName("sourceDetails"u8); + writer.WriteObjectValue(SourceDetails, options); + } + writer.WritePropertyName("destinationDetails"u8); + writer.WriteObjectValue(DestinationDetails, options); + writer.WritePropertyName("tasks"u8); + writer.WriteStartArray(); + foreach (var item in Tasks) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + + MongoRUToMongoVCoreCopyJobProperties 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(MongoRUToMongoVCoreCopyJobProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeMongoRUToMongoVCoreCopyJobProperties(document.RootElement, options); + } + + internal static MongoRUToMongoVCoreCopyJobProperties DeserializeMongoRUToMongoVCoreCopyJobProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + CosmosDBSourceSinkDetails sourceDetails = default; + MongoVCoreSourceSinkDetails destinationDetails = default; + IList tasks = default; + CopyJobType jobType = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("sourceDetails"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + sourceDetails = CosmosDBSourceSinkDetails.DeserializeCosmosDBSourceSinkDetails(property.Value, options); + continue; + } + if (property.NameEquals("destinationDetails"u8)) + { + destinationDetails = MongoVCoreSourceSinkDetails.DeserializeMongoVCoreSourceSinkDetails(property.Value, options); + continue; + } + if (property.NameEquals("tasks"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(MongoRUToMongoVCoreCopyJobTask.DeserializeMongoRUToMongoVCoreCopyJobTask(item, options)); + } + tasks = array; + continue; + } + if (property.NameEquals("jobType"u8)) + { + jobType = new CopyJobType(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new MongoRUToMongoVCoreCopyJobProperties(jobType, serializedAdditionalRawData, sourceDetails, destinationDetails, tasks); + } + + private BinaryData SerializeBicep(ModelReaderWriterOptions options) + { + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue("SourceDetailsRemoteAccountName", out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" sourceDetails: "); + builder.AppendLine("{"); + builder.Append(" remoteAccountName: "); + builder.AppendLine(propertyOverride); + builder.AppendLine(" }"); + } + else + { + if (Optional.IsDefined(SourceDetails)) + { + builder.Append(" sourceDetails: "); + BicepSerializationHelpers.AppendChildObject(builder, SourceDetails, options, 2, false, " sourceDetails: "); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(DestinationDetails), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" destinationDetails: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(DestinationDetails)) + { + builder.Append(" destinationDetails: "); + BicepSerializationHelpers.AppendChildObject(builder, DestinationDetails, options, 2, false, " destinationDetails: "); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Tasks), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" tasks: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsCollectionDefined(Tasks)) + { + if (Tasks.Any()) + { + builder.Append(" tasks: "); + builder.AppendLine("["); + foreach (var item in Tasks) + { + BicepSerializationHelpers.AppendChildObject(builder, item, options, 4, true, " tasks: "); + } + builder.AppendLine(" ]"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(JobType), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" jobType: "); + builder.AppendLine(propertyOverride); + } + else + { + builder.Append(" jobType: "); + builder.AppendLine($"'{JobType.ToString()}'"); + } + + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + case "bicep": + return SerializeBicep(options); + default: + throw new FormatException($"The model {nameof(MongoRUToMongoVCoreCopyJobProperties)} does not support writing '{options.Format}' format."); + } + } + + MongoRUToMongoVCoreCopyJobProperties 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 DeserializeMongoRUToMongoVCoreCopyJobProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(MongoRUToMongoVCoreCopyJobProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/MongoRUToMongoVCoreCopyJobProperties.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/MongoRUToMongoVCoreCopyJobProperties.cs new file mode 100644 index 000000000000..13047415e665 --- /dev/null +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/MongoRUToMongoVCoreCopyJobProperties.cs @@ -0,0 +1,72 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.ResourceManager.CosmosDB.Models +{ + /// Source Mongo to Destination Mongo vCore copy job properties. + public partial class MongoRUToMongoVCoreCopyJobProperties : BaseCopyJobProperties + { + /// Initializes a new instance of . + /// Destination Mongo (vCore) DataStore details. + /// Copy Job tasks. + /// or is null. + public MongoRUToMongoVCoreCopyJobProperties(MongoVCoreSourceSinkDetails destinationDetails, IEnumerable tasks) + { + Argument.AssertNotNull(destinationDetails, nameof(destinationDetails)); + Argument.AssertNotNull(tasks, nameof(tasks)); + + DestinationDetails = destinationDetails; + Tasks = tasks.ToList(); + JobType = CopyJobType.MongoRUToMongoVCore; + } + + /// Initializes a new instance of . + /// Copy Job Type. + /// Keeps track of any properties unknown to the library. + /// Source Mongo (RU) DataStore details. + /// Destination Mongo (vCore) DataStore details. + /// Copy Job tasks. + internal MongoRUToMongoVCoreCopyJobProperties(CopyJobType jobType, IDictionary serializedAdditionalRawData, CosmosDBSourceSinkDetails sourceDetails, MongoVCoreSourceSinkDetails destinationDetails, IList tasks) : base(jobType, serializedAdditionalRawData) + { + SourceDetails = sourceDetails; + DestinationDetails = destinationDetails; + Tasks = tasks; + JobType = jobType; + } + + /// Initializes a new instance of for deserialization. + internal MongoRUToMongoVCoreCopyJobProperties() + { + } + + /// Source Mongo (RU) DataStore details. + internal CosmosDBSourceSinkDetails SourceDetails { get; set; } + /// Name of remote account in case of cross-account data transfer. + [WirePath("sourceDetails.remoteAccountName")] + public string SourceDetailsRemoteAccountName + { + get => SourceDetails is null ? default : SourceDetails.RemoteAccountName; + set + { + if (SourceDetails is null) + SourceDetails = new CosmosDBSourceSinkDetails(); + SourceDetails.RemoteAccountName = value; + } + } + + /// Destination Mongo (vCore) DataStore details. + [WirePath("destinationDetails")] + public MongoVCoreSourceSinkDetails DestinationDetails { get; set; } + /// Copy Job tasks. + [WirePath("tasks")] + public IList Tasks { get; } + } +} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/MongoRUToMongoVCoreCopyJobTask.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/MongoRUToMongoVCoreCopyJobTask.Serialization.cs new file mode 100644 index 000000000000..fdbf7b1142a1 --- /dev/null +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/MongoRUToMongoVCoreCopyJobTask.Serialization.cs @@ -0,0 +1,218 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.CosmosDB.Models +{ + public partial class MongoRUToMongoVCoreCopyJobTask : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(MongoRUToMongoVCoreCopyJobTask)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + writer.WritePropertyName("source"u8); + writer.WriteObjectValue(Source, options); + writer.WritePropertyName("destination"u8); + writer.WriteObjectValue(Destination, options); + } + + MongoRUToMongoVCoreCopyJobTask 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(MongoRUToMongoVCoreCopyJobTask)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeMongoRUToMongoVCoreCopyJobTask(document.RootElement, options); + } + + internal static MongoRUToMongoVCoreCopyJobTask DeserializeMongoRUToMongoVCoreCopyJobTask(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + CosmosDBMongoCollection source = default; + CosmosDBMongoVCoreCollection destination = default; + long? totalCount = default; + long? processedCount = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("source"u8)) + { + source = CosmosDBMongoCollection.DeserializeCosmosDBMongoCollection(property.Value, options); + continue; + } + if (property.NameEquals("destination"u8)) + { + destination = CosmosDBMongoVCoreCollection.DeserializeCosmosDBMongoVCoreCollection(property.Value, options); + continue; + } + if (property.NameEquals("totalCount"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + totalCount = property.Value.GetInt64(); + continue; + } + if (property.NameEquals("processedCount"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + processedCount = property.Value.GetInt64(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new MongoRUToMongoVCoreCopyJobTask(totalCount, processedCount, serializedAdditionalRawData, source, destination); + } + + private BinaryData SerializeBicep(ModelReaderWriterOptions options) + { + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Source), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" source: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Source)) + { + builder.Append(" source: "); + BicepSerializationHelpers.AppendChildObject(builder, Source, options, 2, false, " source: "); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Destination), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" destination: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Destination)) + { + builder.Append(" destination: "); + BicepSerializationHelpers.AppendChildObject(builder, Destination, options, 2, false, " destination: "); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(TotalCount), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" totalCount: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(TotalCount)) + { + builder.Append(" totalCount: "); + builder.AppendLine($"'{TotalCount.Value.ToString()}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(ProcessedCount), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" processedCount: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(ProcessedCount)) + { + builder.Append(" processedCount: "); + builder.AppendLine($"'{ProcessedCount.Value.ToString()}'"); + } + } + + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + case "bicep": + return SerializeBicep(options); + default: + throw new FormatException($"The model {nameof(MongoRUToMongoVCoreCopyJobTask)} does not support writing '{options.Format}' format."); + } + } + + MongoRUToMongoVCoreCopyJobTask 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 DeserializeMongoRUToMongoVCoreCopyJobTask(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(MongoRUToMongoVCoreCopyJobTask)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/MongoRUToMongoVCoreCopyJobTask.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/MongoRUToMongoVCoreCopyJobTask.cs new file mode 100644 index 000000000000..1709807eea8c --- /dev/null +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/MongoRUToMongoVCoreCopyJobTask.cs @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.CosmosDB.Models +{ + /// The MongoRUToMongoVCoreCopyJobTask. + public partial class MongoRUToMongoVCoreCopyJobTask : BaseCopyJobTask + { + /// Initializes a new instance of . + /// Source Mongo (RU) collection. + /// Destination Mongo (vCore) collection. + /// or is null. + public MongoRUToMongoVCoreCopyJobTask(CosmosDBMongoCollection source, CosmosDBMongoVCoreCollection destination) + { + Argument.AssertNotNull(source, nameof(source)); + Argument.AssertNotNull(destination, nameof(destination)); + + Source = source; + Destination = destination; + } + + /// Initializes a new instance of . + /// Task level Total Count. + /// Task level Processed Count. + /// Keeps track of any properties unknown to the library. + /// Source Mongo (RU) collection. + /// Destination Mongo (vCore) collection. + internal MongoRUToMongoVCoreCopyJobTask(long? totalCount, long? processedCount, IDictionary serializedAdditionalRawData, CosmosDBMongoCollection source, CosmosDBMongoVCoreCollection destination) : base(totalCount, processedCount, serializedAdditionalRawData) + { + Source = source; + Destination = destination; + } + + /// Initializes a new instance of for deserialization. + internal MongoRUToMongoVCoreCopyJobTask() + { + } + + /// Source Mongo (RU) collection. + [WirePath("source")] + public CosmosDBMongoCollection Source { get; set; } + /// Destination Mongo (vCore) collection. + [WirePath("destination")] + public CosmosDBMongoVCoreCollection Destination { get; set; } + } +} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/MongoVCoreSourceSinkDetails.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/MongoVCoreSourceSinkDetails.Serialization.cs new file mode 100644 index 000000000000..d8147490b441 --- /dev/null +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/MongoVCoreSourceSinkDetails.Serialization.cs @@ -0,0 +1,200 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.CosmosDB.Models +{ + public partial class MongoVCoreSourceSinkDetails : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(MongoVCoreSourceSinkDetails)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(HostName)) + { + writer.WritePropertyName("hostName"u8); + writer.WriteStringValue(HostName); + } + if (Optional.IsDefined(ConnectionStringKeyVaultUri)) + { + writer.WritePropertyName("connectionStringKeyVaultUri"u8); + writer.WriteStringValue(ConnectionStringKeyVaultUri.AbsoluteUri); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + MongoVCoreSourceSinkDetails 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(MongoVCoreSourceSinkDetails)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeMongoVCoreSourceSinkDetails(document.RootElement, options); + } + + internal static MongoVCoreSourceSinkDetails DeserializeMongoVCoreSourceSinkDetails(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string hostName = default; + Uri connectionStringKeyVaultUri = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("hostName"u8)) + { + hostName = property.Value.GetString(); + continue; + } + if (property.NameEquals("connectionStringKeyVaultUri"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + connectionStringKeyVaultUri = new Uri(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new MongoVCoreSourceSinkDetails(hostName, connectionStringKeyVaultUri, serializedAdditionalRawData); + } + + private BinaryData SerializeBicep(ModelReaderWriterOptions options) + { + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(HostName), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" hostName: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(HostName)) + { + builder.Append(" hostName: "); + if (HostName.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{HostName}'''"); + } + else + { + builder.AppendLine($"'{HostName}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(ConnectionStringKeyVaultUri), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" connectionStringKeyVaultUri: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(ConnectionStringKeyVaultUri)) + { + builder.Append(" connectionStringKeyVaultUri: "); + builder.AppendLine($"'{ConnectionStringKeyVaultUri.AbsoluteUri}'"); + } + } + + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + case "bicep": + return SerializeBicep(options); + default: + throw new FormatException($"The model {nameof(MongoVCoreSourceSinkDetails)} does not support writing '{options.Format}' format."); + } + } + + MongoVCoreSourceSinkDetails 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 DeserializeMongoVCoreSourceSinkDetails(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(MongoVCoreSourceSinkDetails)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/MongoVCoreSourceSinkDetails.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/MongoVCoreSourceSinkDetails.cs new file mode 100644 index 000000000000..4ef83023245c --- /dev/null +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/MongoVCoreSourceSinkDetails.cs @@ -0,0 +1,71 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.CosmosDB.Models +{ + /// A CosmosDB Mongo vCore data source/sink details. + public partial class MongoVCoreSourceSinkDetails + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public MongoVCoreSourceSinkDetails() + { + } + + /// Initializes a new instance of . + /// + /// URI of Azure KeyVault secret containing connection string. + /// Keeps track of any properties unknown to the library. + internal MongoVCoreSourceSinkDetails(string hostName, Uri connectionStringKeyVaultUri, IDictionary serializedAdditionalRawData) + { + HostName = hostName; + ConnectionStringKeyVaultUri = connectionStringKeyVaultUri; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Gets or sets the host name. + [WirePath("hostName")] + public string HostName { get; set; } + /// URI of Azure KeyVault secret containing connection string. + [WirePath("connectionStringKeyVaultUri")] + public Uri ConnectionStringKeyVaultUri { get; set; } + } +} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/NoSqlRUToNoSqlRUCopyJobProperties.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/NoSqlRUToNoSqlRUCopyJobProperties.Serialization.cs new file mode 100644 index 000000000000..430f422053a3 --- /dev/null +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/NoSqlRUToNoSqlRUCopyJobProperties.Serialization.cs @@ -0,0 +1,248 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.CosmosDB.Models +{ + public partial class NoSqlRUToNoSqlRUCopyJobProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(NoSqlRUToNoSqlRUCopyJobProperties)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + if (Optional.IsDefined(SourceDetails)) + { + writer.WritePropertyName("sourceDetails"u8); + writer.WriteObjectValue(SourceDetails, options); + } + if (Optional.IsDefined(DestinationDetails)) + { + writer.WritePropertyName("destinationDetails"u8); + writer.WriteObjectValue(DestinationDetails, options); + } + writer.WritePropertyName("tasks"u8); + writer.WriteStartArray(); + foreach (var item in Tasks) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + + NoSqlRUToNoSqlRUCopyJobProperties 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(NoSqlRUToNoSqlRUCopyJobProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeNoSqlRUToNoSqlRUCopyJobProperties(document.RootElement, options); + } + + internal static NoSqlRUToNoSqlRUCopyJobProperties DeserializeNoSqlRUToNoSqlRUCopyJobProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + CosmosDBSourceSinkDetails sourceDetails = default; + CosmosDBSourceSinkDetails destinationDetails = default; + IList tasks = default; + CopyJobType jobType = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("sourceDetails"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + sourceDetails = CosmosDBSourceSinkDetails.DeserializeCosmosDBSourceSinkDetails(property.Value, options); + continue; + } + if (property.NameEquals("destinationDetails"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + destinationDetails = CosmosDBSourceSinkDetails.DeserializeCosmosDBSourceSinkDetails(property.Value, options); + continue; + } + if (property.NameEquals("tasks"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(NoSqlRUToNoSqlRUCopyJobTask.DeserializeNoSqlRUToNoSqlRUCopyJobTask(item, options)); + } + tasks = array; + continue; + } + if (property.NameEquals("jobType"u8)) + { + jobType = new CopyJobType(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new NoSqlRUToNoSqlRUCopyJobProperties(jobType, serializedAdditionalRawData, sourceDetails, destinationDetails, tasks); + } + + private BinaryData SerializeBicep(ModelReaderWriterOptions options) + { + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue("SourceDetailsRemoteAccountName", out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" sourceDetails: "); + builder.AppendLine("{"); + builder.Append(" remoteAccountName: "); + builder.AppendLine(propertyOverride); + builder.AppendLine(" }"); + } + else + { + if (Optional.IsDefined(SourceDetails)) + { + builder.Append(" sourceDetails: "); + BicepSerializationHelpers.AppendChildObject(builder, SourceDetails, options, 2, false, " sourceDetails: "); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue("DestinationDetailsRemoteAccountName", out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" destinationDetails: "); + builder.AppendLine("{"); + builder.Append(" remoteAccountName: "); + builder.AppendLine(propertyOverride); + builder.AppendLine(" }"); + } + else + { + if (Optional.IsDefined(DestinationDetails)) + { + builder.Append(" destinationDetails: "); + BicepSerializationHelpers.AppendChildObject(builder, DestinationDetails, options, 2, false, " destinationDetails: "); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Tasks), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" tasks: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsCollectionDefined(Tasks)) + { + if (Tasks.Any()) + { + builder.Append(" tasks: "); + builder.AppendLine("["); + foreach (var item in Tasks) + { + BicepSerializationHelpers.AppendChildObject(builder, item, options, 4, true, " tasks: "); + } + builder.AppendLine(" ]"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(JobType), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" jobType: "); + builder.AppendLine(propertyOverride); + } + else + { + builder.Append(" jobType: "); + builder.AppendLine($"'{JobType.ToString()}'"); + } + + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + case "bicep": + return SerializeBicep(options); + default: + throw new FormatException($"The model {nameof(NoSqlRUToNoSqlRUCopyJobProperties)} does not support writing '{options.Format}' format."); + } + } + + NoSqlRUToNoSqlRUCopyJobProperties 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 DeserializeNoSqlRUToNoSqlRUCopyJobProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(NoSqlRUToNoSqlRUCopyJobProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/NoSqlRUToNoSqlRUCopyJobProperties.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/NoSqlRUToNoSqlRUCopyJobProperties.cs new file mode 100644 index 000000000000..caac1570015d --- /dev/null +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/NoSqlRUToNoSqlRUCopyJobProperties.cs @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.ResourceManager.CosmosDB.Models +{ + /// Source SQL to Destination SQL copy job properties. + public partial class NoSqlRUToNoSqlRUCopyJobProperties : BaseCopyJobProperties + { + /// Initializes a new instance of . + /// Copy Job tasks. + /// is null. + public NoSqlRUToNoSqlRUCopyJobProperties(IEnumerable tasks) + { + Argument.AssertNotNull(tasks, nameof(tasks)); + + Tasks = tasks.ToList(); + JobType = CopyJobType.NoSqlRUToNoSqlRU; + } + + /// Initializes a new instance of . + /// Copy Job Type. + /// Keeps track of any properties unknown to the library. + /// Source SQL DataStore details. + /// Destination SQL DataStore details. + /// Copy Job tasks. + internal NoSqlRUToNoSqlRUCopyJobProperties(CopyJobType jobType, IDictionary serializedAdditionalRawData, CosmosDBSourceSinkDetails sourceDetails, CosmosDBSourceSinkDetails destinationDetails, IList tasks) : base(jobType, serializedAdditionalRawData) + { + SourceDetails = sourceDetails; + DestinationDetails = destinationDetails; + Tasks = tasks; + JobType = jobType; + } + + /// Initializes a new instance of for deserialization. + internal NoSqlRUToNoSqlRUCopyJobProperties() + { + } + + /// Source SQL DataStore details. + internal CosmosDBSourceSinkDetails SourceDetails { get; set; } + /// Name of remote account in case of cross-account data transfer. + [WirePath("sourceDetails.remoteAccountName")] + public string SourceDetailsRemoteAccountName + { + get => SourceDetails is null ? default : SourceDetails.RemoteAccountName; + set + { + if (SourceDetails is null) + SourceDetails = new CosmosDBSourceSinkDetails(); + SourceDetails.RemoteAccountName = value; + } + } + + /// Destination SQL DataStore details. + internal CosmosDBSourceSinkDetails DestinationDetails { get; set; } + /// Name of remote account in case of cross-account data transfer. + [WirePath("destinationDetails.remoteAccountName")] + public string DestinationDetailsRemoteAccountName + { + get => DestinationDetails is null ? default : DestinationDetails.RemoteAccountName; + set + { + if (DestinationDetails is null) + DestinationDetails = new CosmosDBSourceSinkDetails(); + DestinationDetails.RemoteAccountName = value; + } + } + + /// Copy Job tasks. + [WirePath("tasks")] + public IList Tasks { get; } + } +} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/NoSqlRUToNoSqlRUCopyJobTask.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/NoSqlRUToNoSqlRUCopyJobTask.Serialization.cs new file mode 100644 index 000000000000..a2dcd9785af0 --- /dev/null +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/NoSqlRUToNoSqlRUCopyJobTask.Serialization.cs @@ -0,0 +1,218 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.CosmosDB.Models +{ + public partial class NoSqlRUToNoSqlRUCopyJobTask : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(NoSqlRUToNoSqlRUCopyJobTask)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + writer.WritePropertyName("source"u8); + writer.WriteObjectValue(Source, options); + writer.WritePropertyName("destination"u8); + writer.WriteObjectValue(Destination, options); + } + + NoSqlRUToNoSqlRUCopyJobTask 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(NoSqlRUToNoSqlRUCopyJobTask)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeNoSqlRUToNoSqlRUCopyJobTask(document.RootElement, options); + } + + internal static NoSqlRUToNoSqlRUCopyJobTask DeserializeNoSqlRUToNoSqlRUCopyJobTask(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + CosmosDBNoSqlContainer source = default; + CosmosDBNoSqlContainer destination = default; + long? totalCount = default; + long? processedCount = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("source"u8)) + { + source = CosmosDBNoSqlContainer.DeserializeCosmosDBNoSqlContainer(property.Value, options); + continue; + } + if (property.NameEquals("destination"u8)) + { + destination = CosmosDBNoSqlContainer.DeserializeCosmosDBNoSqlContainer(property.Value, options); + continue; + } + if (property.NameEquals("totalCount"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + totalCount = property.Value.GetInt64(); + continue; + } + if (property.NameEquals("processedCount"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + processedCount = property.Value.GetInt64(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new NoSqlRUToNoSqlRUCopyJobTask(totalCount, processedCount, serializedAdditionalRawData, source, destination); + } + + private BinaryData SerializeBicep(ModelReaderWriterOptions options) + { + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Source), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" source: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Source)) + { + builder.Append(" source: "); + BicepSerializationHelpers.AppendChildObject(builder, Source, options, 2, false, " source: "); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Destination), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" destination: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Destination)) + { + builder.Append(" destination: "); + BicepSerializationHelpers.AppendChildObject(builder, Destination, options, 2, false, " destination: "); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(TotalCount), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" totalCount: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(TotalCount)) + { + builder.Append(" totalCount: "); + builder.AppendLine($"'{TotalCount.Value.ToString()}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(ProcessedCount), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" processedCount: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(ProcessedCount)) + { + builder.Append(" processedCount: "); + builder.AppendLine($"'{ProcessedCount.Value.ToString()}'"); + } + } + + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + case "bicep": + return SerializeBicep(options); + default: + throw new FormatException($"The model {nameof(NoSqlRUToNoSqlRUCopyJobTask)} does not support writing '{options.Format}' format."); + } + } + + NoSqlRUToNoSqlRUCopyJobTask 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 DeserializeNoSqlRUToNoSqlRUCopyJobTask(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(NoSqlRUToNoSqlRUCopyJobTask)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/NoSqlRUToNoSqlRUCopyJobTask.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/NoSqlRUToNoSqlRUCopyJobTask.cs new file mode 100644 index 000000000000..0ceefbdb40b9 --- /dev/null +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/NoSqlRUToNoSqlRUCopyJobTask.cs @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.CosmosDB.Models +{ + /// The NoSqlRUToNoSqlRUCopyJobTask. + public partial class NoSqlRUToNoSqlRUCopyJobTask : BaseCopyJobTask + { + /// Initializes a new instance of . + /// Source SQL container. + /// Destination SQL container. + /// or is null. + public NoSqlRUToNoSqlRUCopyJobTask(CosmosDBNoSqlContainer source, CosmosDBNoSqlContainer destination) + { + Argument.AssertNotNull(source, nameof(source)); + Argument.AssertNotNull(destination, nameof(destination)); + + Source = source; + Destination = destination; + } + + /// Initializes a new instance of . + /// Task level Total Count. + /// Task level Processed Count. + /// Keeps track of any properties unknown to the library. + /// Source SQL container. + /// Destination SQL container. + internal NoSqlRUToNoSqlRUCopyJobTask(long? totalCount, long? processedCount, IDictionary serializedAdditionalRawData, CosmosDBNoSqlContainer source, CosmosDBNoSqlContainer destination) : base(totalCount, processedCount, serializedAdditionalRawData) + { + Source = source; + Destination = destination; + } + + /// Initializes a new instance of for deserialization. + internal NoSqlRUToNoSqlRUCopyJobTask() + { + } + + /// Source SQL container. + [WirePath("source")] + public CosmosDBNoSqlContainer Source { get; set; } + /// Destination SQL container. + [WirePath("destination")] + public CosmosDBNoSqlContainer Destination { get; set; } + } +} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/Permission.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/Permission.Serialization.cs new file mode 100644 index 000000000000..24269138cc1f --- /dev/null +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/Permission.Serialization.cs @@ -0,0 +1,293 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.CosmosDB.Models +{ + public partial class Permission : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(Permission)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(Id)) + { + writer.WritePropertyName("id"u8); + writer.WriteStringValue(Id); + } + if (Optional.IsCollectionDefined(DataActions)) + { + writer.WritePropertyName("dataActions"u8); + writer.WriteStartArray(); + foreach (var item in DataActions) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(NotDataActions)) + { + writer.WritePropertyName("notDataActions"u8); + writer.WriteStartArray(); + foreach (var item in NotDataActions) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + Permission 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(Permission)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializePermission(document.RootElement, options); + } + + internal static Permission DeserializePermission(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string id = default; + IList dataActions = default; + IList notDataActions = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("id"u8)) + { + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("dataActions"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + dataActions = array; + continue; + } + if (property.NameEquals("notDataActions"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + notDataActions = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new Permission(id, dataActions ?? new ChangeTrackingList(), notDataActions ?? new ChangeTrackingList(), serializedAdditionalRawData); + } + + private BinaryData SerializeBicep(ModelReaderWriterOptions options) + { + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Id), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" id: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Id)) + { + builder.Append(" id: "); + if (Id.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{Id}'''"); + } + else + { + builder.AppendLine($"'{Id}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(DataActions), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" dataActions: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsCollectionDefined(DataActions)) + { + if (DataActions.Any()) + { + builder.Append(" dataActions: "); + builder.AppendLine("["); + foreach (var item in DataActions) + { + if (item == null) + { + builder.Append("null"); + continue; + } + if (item.Contains(Environment.NewLine)) + { + builder.AppendLine(" '''"); + builder.AppendLine($"{item}'''"); + } + else + { + builder.AppendLine($" '{item}'"); + } + } + builder.AppendLine(" ]"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(NotDataActions), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" notDataActions: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsCollectionDefined(NotDataActions)) + { + if (NotDataActions.Any()) + { + builder.Append(" notDataActions: "); + builder.AppendLine("["); + foreach (var item in NotDataActions) + { + if (item == null) + { + builder.Append("null"); + continue; + } + if (item.Contains(Environment.NewLine)) + { + builder.AppendLine(" '''"); + builder.AppendLine($"{item}'''"); + } + else + { + builder.AppendLine($" '{item}'"); + } + } + builder.AppendLine(" ]"); + } + } + } + + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + case "bicep": + return SerializeBicep(options); + default: + throw new FormatException($"The model {nameof(Permission)} does not support writing '{options.Format}' format."); + } + } + + Permission 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 DeserializePermission(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(Permission)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/Permission.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/Permission.cs new file mode 100644 index 000000000000..f5bd2ff5be76 --- /dev/null +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/Permission.cs @@ -0,0 +1,78 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.CosmosDB.Models +{ + /// The set of data plane operations permitted through this Role Definition. + public partial class Permission + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public Permission() + { + DataActions = new ChangeTrackingList(); + NotDataActions = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// The id for the permission. + /// An array of data actions that are allowed. + /// An array of data actions that are denied. + /// Keeps track of any properties unknown to the library. + internal Permission(string id, IList dataActions, IList notDataActions, IDictionary serializedAdditionalRawData) + { + Id = id; + DataActions = dataActions; + NotDataActions = notDataActions; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The id for the permission. + [WirePath("id")] + public string Id { get; set; } + /// An array of data actions that are allowed. + [WirePath("dataActions")] + public IList DataActions { get; } + /// An array of data actions that are denied. + [WirePath("notDataActions")] + public IList NotDataActions { get; } + } +} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/PhysicalPartitionThroughputInfoResource.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/PhysicalPartitionThroughputInfoResource.Serialization.cs index 9b4e85498019..1dd4c374631a 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/PhysicalPartitionThroughputInfoResource.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/PhysicalPartitionThroughputInfoResource.Serialization.cs @@ -42,6 +42,11 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WritePropertyName("throughput"u8); writer.WriteNumberValue(Throughput.Value); } + if (Optional.IsDefined(TargetThroughput)) + { + writer.WritePropertyName("targetThroughput"u8); + writer.WriteNumberValue(TargetThroughput.Value); + } if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) @@ -81,6 +86,7 @@ internal static PhysicalPartitionThroughputInfoResource DeserializePhysicalParti } string id = default; double? throughput = default; + double? targetThroughput = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -99,13 +105,22 @@ internal static PhysicalPartitionThroughputInfoResource DeserializePhysicalParti throughput = property.Value.GetDouble(); continue; } + if (property.NameEquals("targetThroughput"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + targetThroughput = property.Value.GetDouble(); + continue; + } if (options.Format != "W") { rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); } } serializedAdditionalRawData = rawDataDictionary; - return new PhysicalPartitionThroughputInfoResource(id, throughput, serializedAdditionalRawData); + return new PhysicalPartitionThroughputInfoResource(id, throughput, targetThroughput, serializedAdditionalRawData); } private BinaryData SerializeBicep(ModelReaderWriterOptions options) @@ -157,6 +172,21 @@ private BinaryData SerializeBicep(ModelReaderWriterOptions options) } } + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(TargetThroughput), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" targetThroughput: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(TargetThroughput)) + { + builder.Append(" targetThroughput: "); + builder.AppendLine($"'{TargetThroughput.Value.ToString()}'"); + } + } + builder.AppendLine("}"); return BinaryData.FromString(builder.ToString()); } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/PhysicalPartitionThroughputInfoResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/PhysicalPartitionThroughputInfoResource.cs index 966c4d6682bb..7dd79009a1a4 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/PhysicalPartitionThroughputInfoResource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/PhysicalPartitionThroughputInfoResource.cs @@ -58,11 +58,13 @@ public PhysicalPartitionThroughputInfoResource(string id) /// Initializes a new instance of . /// Id of a physical partition. /// Throughput of a physical partition. + /// Target throughput of a physical partition. /// Keeps track of any properties unknown to the library. - internal PhysicalPartitionThroughputInfoResource(string id, double? throughput, IDictionary serializedAdditionalRawData) + internal PhysicalPartitionThroughputInfoResource(string id, double? throughput, double? targetThroughput, IDictionary serializedAdditionalRawData) { Id = id; Throughput = throughput; + TargetThroughput = targetThroughput; _serializedAdditionalRawData = serializedAdditionalRawData; } @@ -77,5 +79,8 @@ internal PhysicalPartitionThroughputInfoResource() /// Throughput of a physical partition. [WirePath("throughput")] public double? Throughput { get; set; } + /// Target throughput of a physical partition. + [WirePath("targetThroughput")] + public double? TargetThroughput { get; set; } } } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RestorableSqlContainerPropertiesResourceContainer.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RestorableSqlContainerPropertiesResourceContainer.Serialization.cs index f9d26414e0d9..8bd0885dc9ca 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RestorableSqlContainerPropertiesResourceContainer.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RestorableSqlContainerPropertiesResourceContainer.Serialization.cs @@ -94,8 +94,10 @@ internal static RestorableSqlContainerPropertiesResourceContainer DeserializeRes ResourceRestoreParameters restoreParameters = default; CosmosDBAccountCreateMode? createMode = default; MaterializedViewDefinition materializedViewDefinition = default; + IList materializedViews = default; IList computedProperties = default; VectorEmbeddingPolicy vectorEmbeddingPolicy = default; + FullTextPolicy fullTextPolicy = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -223,6 +225,20 @@ internal static RestorableSqlContainerPropertiesResourceContainer DeserializeRes materializedViewDefinition = MaterializedViewDefinition.DeserializeMaterializedViewDefinition(property.Value, options); continue; } + if (property.NameEquals("materializedViews"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(MaterializedViewDetails.DeserializeMaterializedViewDetails(item, options)); + } + materializedViews = array; + continue; + } if (property.NameEquals("computedProperties"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -246,6 +262,15 @@ internal static RestorableSqlContainerPropertiesResourceContainer DeserializeRes vectorEmbeddingPolicy = VectorEmbeddingPolicy.DeserializeVectorEmbeddingPolicy(property.Value, options); continue; } + if (property.NameEquals("fullTextPolicy"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + fullTextPolicy = FullTextPolicy.DeserializeFullTextPolicy(property.Value, options); + continue; + } if (options.Format != "W") { rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); @@ -264,8 +289,10 @@ internal static RestorableSqlContainerPropertiesResourceContainer DeserializeRes restoreParameters, createMode, materializedViewDefinition, + materializedViews ?? new ChangeTrackingList(), computedProperties ?? new ChangeTrackingList(), vectorEmbeddingPolicy, + fullTextPolicy, serializedAdditionalRawData, self, rid, @@ -536,6 +563,29 @@ private BinaryData SerializeBicep(ModelReaderWriterOptions options) } } + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(MaterializedViews), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" materializedViews: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsCollectionDefined(MaterializedViews)) + { + if (MaterializedViews.Any()) + { + builder.Append(" materializedViews: "); + builder.AppendLine("["); + foreach (var item in MaterializedViews) + { + BicepSerializationHelpers.AppendChildObject(builder, item, options, 4, true, " materializedViews: "); + } + builder.AppendLine(" ]"); + } + } + } + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(ComputedProperties), out propertyOverride); if (hasPropertyOverride) { @@ -577,6 +627,21 @@ private BinaryData SerializeBicep(ModelReaderWriterOptions options) } } + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(FullTextPolicy), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" fullTextPolicy: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(FullTextPolicy)) + { + builder.Append(" fullTextPolicy: "); + BicepSerializationHelpers.AppendChildObject(builder, FullTextPolicy, options, 2, false, " fullTextPolicy: "); + } + } + builder.AppendLine("}"); return BinaryData.FromString(builder.ToString()); } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RestorableSqlContainerPropertiesResourceContainer.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RestorableSqlContainerPropertiesResourceContainer.cs index 7671a046d572..41c93cb776dc 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RestorableSqlContainerPropertiesResourceContainer.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RestorableSqlContainerPropertiesResourceContainer.cs @@ -33,14 +33,16 @@ public RestorableSqlContainerPropertiesResourceContainer(string containerName) : /// Parameters to indicate the information about the restore. /// Enum to indicate the mode of resource creation. /// The configuration for defining Materialized Views. This must be specified only for creating a Materialized View container. + /// Materialized Views defined on the container. /// List of computed properties. /// The vector embedding policy for the container. + /// The FullText policy for the container. /// Keeps track of any properties unknown to the library. /// A system generated property that specifies the addressable path of the container resource. /// A system generated property. A unique identifier. /// A system generated property that denotes the last updated timestamp of the resource. /// A system generated property representing the resource etag required for optimistic concurrency control. - internal RestorableSqlContainerPropertiesResourceContainer(string containerName, CosmosDBIndexingPolicy indexingPolicy, CosmosDBContainerPartitionKey partitionKey, int? defaultTtl, CosmosDBUniqueKeyPolicy uniqueKeyPolicy, ConflictResolutionPolicy conflictResolutionPolicy, CosmosDBClientEncryptionPolicy clientEncryptionPolicy, long? analyticalStorageTtl, ResourceRestoreParameters restoreParameters, CosmosDBAccountCreateMode? createMode, MaterializedViewDefinition materializedViewDefinition, IList computedProperties, VectorEmbeddingPolicy vectorEmbeddingPolicy, IDictionary serializedAdditionalRawData, string self, string rid, float? timestamp, ETag? etag) : base(containerName, indexingPolicy, partitionKey, defaultTtl, uniqueKeyPolicy, conflictResolutionPolicy, clientEncryptionPolicy, analyticalStorageTtl, restoreParameters, createMode, materializedViewDefinition, computedProperties, vectorEmbeddingPolicy, serializedAdditionalRawData) + internal RestorableSqlContainerPropertiesResourceContainer(string containerName, CosmosDBIndexingPolicy indexingPolicy, CosmosDBContainerPartitionKey partitionKey, int? defaultTtl, CosmosDBUniqueKeyPolicy uniqueKeyPolicy, ConflictResolutionPolicy conflictResolutionPolicy, CosmosDBClientEncryptionPolicy clientEncryptionPolicy, long? analyticalStorageTtl, ResourceRestoreParameters restoreParameters, CosmosDBAccountCreateMode? createMode, MaterializedViewDefinition materializedViewDefinition, IList materializedViews, IList computedProperties, VectorEmbeddingPolicy vectorEmbeddingPolicy, FullTextPolicy fullTextPolicy, IDictionary serializedAdditionalRawData, string self, string rid, float? timestamp, ETag? etag) : base(containerName, indexingPolicy, partitionKey, defaultTtl, uniqueKeyPolicy, conflictResolutionPolicy, clientEncryptionPolicy, analyticalStorageTtl, restoreParameters, createMode, materializedViewDefinition, materializedViews, computedProperties, vectorEmbeddingPolicy, fullTextPolicy, serializedAdditionalRawData) { Self = self; Rid = rid; diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/UnknownBaseCopyJobProperties.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/UnknownBaseCopyJobProperties.Serialization.cs new file mode 100644 index 000000000000..e288a6ee09b6 --- /dev/null +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/UnknownBaseCopyJobProperties.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; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.CosmosDB.Models +{ + internal partial class UnknownBaseCopyJobProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(BaseCopyJobProperties)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + } + + BaseCopyJobProperties 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(BaseCopyJobProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeBaseCopyJobProperties(document.RootElement, options); + } + + internal static UnknownBaseCopyJobProperties DeserializeUnknownBaseCopyJobProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + CopyJobType jobType = "Unknown"; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("jobType"u8)) + { + jobType = new CopyJobType(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new UnknownBaseCopyJobProperties(jobType, serializedAdditionalRawData); + } + + private BinaryData SerializeBicep(ModelReaderWriterOptions options) + { + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(JobType), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" jobType: "); + builder.AppendLine(propertyOverride); + } + else + { + builder.Append(" jobType: "); + builder.AppendLine($"'{JobType.ToString()}'"); + } + + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + case "bicep": + return SerializeBicep(options); + default: + throw new FormatException($"The model {nameof(BaseCopyJobProperties)} does not support writing '{options.Format}' format."); + } + } + + BaseCopyJobProperties 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 DeserializeBaseCopyJobProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(BaseCopyJobProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/UnknownBaseCopyJobProperties.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/UnknownBaseCopyJobProperties.cs new file mode 100644 index 000000000000..82995502ee1f --- /dev/null +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/UnknownBaseCopyJobProperties.cs @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.CosmosDB.Models +{ + /// Unknown version of BaseCopyJobProperties. + internal partial class UnknownBaseCopyJobProperties : BaseCopyJobProperties + { + /// Initializes a new instance of . + /// Copy Job Type. + /// Keeps track of any properties unknown to the library. + internal UnknownBaseCopyJobProperties(CopyJobType jobType, IDictionary serializedAdditionalRawData) : base(jobType, serializedAdditionalRawData) + { + JobType = jobType; + } + + /// Initializes a new instance of for deserialization. + internal UnknownBaseCopyJobProperties() + { + } + } +} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/MongoDBCollectionCollection.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/MongoDBCollectionCollection.cs index adb1e95fd324..30e286707cb3 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/MongoDBCollectionCollection.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/MongoDBCollectionCollection.cs @@ -65,7 +65,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -114,7 +114,7 @@ public virtual async Task> CreateOrUpdat /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -163,7 +163,7 @@ public virtual ArmOperation CreateOrUpdate(WaitUntil /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -208,7 +208,7 @@ public virtual async Task> GetAsync(string c /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -253,7 +253,7 @@ public virtual Response Get(string collectionName, Ca /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -282,7 +282,7 @@ public virtual AsyncPageable GetAllAsync(Cancellation /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -311,7 +311,7 @@ public virtual Pageable GetAll(CancellationToken canc /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -354,7 +354,7 @@ public virtual async Task> ExistsAsync(string collectionName, Can /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -397,7 +397,7 @@ public virtual Response Exists(string collectionName, CancellationToken ca /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -442,7 +442,7 @@ public virtual async Task> GetIfExis /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/MongoDBCollectionResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/MongoDBCollectionResource.cs index d4bd1a0085b4..4a72ba185b49 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/MongoDBCollectionResource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/MongoDBCollectionResource.cs @@ -111,7 +111,7 @@ public virtual MongoDBCollectionThroughputSettingResource GetMongoDBCollectionTh /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -151,7 +151,7 @@ public virtual async Task> GetAsync(Cancella /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -191,7 +191,7 @@ public virtual Response Get(CancellationToken cancell /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -233,7 +233,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -275,7 +275,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -321,7 +321,7 @@ public virtual async Task> UpdateAsync(W /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -367,7 +367,7 @@ public virtual ArmOperation Update(WaitUntil waitUnti /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -413,7 +413,7 @@ public virtual async Task> /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -459,7 +459,7 @@ public virtual ArmOperation GetMongoDBCo /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -505,7 +505,7 @@ public virtual async Task> RetrieveConti /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -551,7 +551,7 @@ public virtual ArmOperation RetrieveContinuousBackupI /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -613,7 +613,7 @@ public virtual async Task> AddTagAsync(strin /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -675,7 +675,7 @@ public virtual Response AddTag(string key, string val /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -732,7 +732,7 @@ public virtual async Task> SetTagsAsync(IDic /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -789,7 +789,7 @@ public virtual Response SetTags(IDictionary /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -849,7 +849,7 @@ public virtual async Task> RemoveTagAsync(st /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/MongoDBCollectionThroughputSettingResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/MongoDBCollectionThroughputSettingResource.cs index 2b8d05b8eb57..e6e8c5e17801 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/MongoDBCollectionThroughputSettingResource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/MongoDBCollectionThroughputSettingResource.cs @@ -104,7 +104,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -144,7 +144,7 @@ public virtual async Task> /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -184,7 +184,7 @@ public virtual Response Get(Cancella /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -230,7 +230,7 @@ public virtual async Task /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -276,7 +276,7 @@ public virtual ArmOperation CreateOr /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -322,7 +322,7 @@ public virtual async Task> M /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -368,7 +368,7 @@ public virtual ArmOperation MongoDBContai /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -414,7 +414,7 @@ public virtual async Task> M /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -460,7 +460,7 @@ public virtual ArmOperation MongoDBContai /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -502,7 +502,7 @@ public virtual async Task /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -544,7 +544,7 @@ public virtual ArmOperation MigrateM /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -586,7 +586,7 @@ public virtual async Task /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -628,7 +628,7 @@ public virtual ArmOperation MigrateM /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -690,7 +690,7 @@ public virtual async Task> /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -752,7 +752,7 @@ public virtual Response AddTag(strin /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -809,7 +809,7 @@ public virtual async Task> /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -866,7 +866,7 @@ public virtual Response SetTags(IDic /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -926,7 +926,7 @@ public virtual async Task> /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/MongoDBDatabaseCollection.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/MongoDBDatabaseCollection.cs index 6d223c3dc0aa..911e41699b4d 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/MongoDBDatabaseCollection.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/MongoDBDatabaseCollection.cs @@ -65,7 +65,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -114,7 +114,7 @@ public virtual async Task> CreateOrUpdateA /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -163,7 +163,7 @@ public virtual ArmOperation CreateOrUpdate(WaitUntil wa /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -208,7 +208,7 @@ public virtual async Task> GetAsync(string dat /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -253,7 +253,7 @@ public virtual Response Get(string databaseName, Cancel /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -282,7 +282,7 @@ public virtual AsyncPageable GetAllAsync(CancellationTo /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -311,7 +311,7 @@ public virtual Pageable GetAll(CancellationToken cancel /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -354,7 +354,7 @@ public virtual async Task> ExistsAsync(string databaseName, Cance /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -397,7 +397,7 @@ public virtual Response Exists(string databaseName, CancellationToken canc /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -442,7 +442,7 @@ public virtual async Task> GetIfExists /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/MongoDBDatabaseResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/MongoDBDatabaseResource.cs index 704bf735c21b..481a034fefe2 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/MongoDBDatabaseResource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/MongoDBDatabaseResource.cs @@ -117,7 +117,7 @@ public virtual MongoDBCollectionCollection GetMongoDBCollections() /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -148,7 +148,7 @@ public virtual async Task> GetMongoDBCollect /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -179,7 +179,7 @@ public virtual Response GetMongoDBCollection(string c /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -219,7 +219,7 @@ public virtual async Task> GetAsync(Cancellati /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -259,7 +259,7 @@ public virtual Response Get(CancellationToken cancellat /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -301,7 +301,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -343,7 +343,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -389,7 +389,7 @@ public virtual async Task> UpdateAsync(Wai /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -435,7 +435,7 @@ public virtual ArmOperation Update(WaitUntil waitUntil, /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -481,7 +481,7 @@ public virtual async Task> /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -527,7 +527,7 @@ public virtual ArmOperation MongoDBDatab /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -589,7 +589,7 @@ public virtual async Task> AddTagAsync(string /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -651,7 +651,7 @@ public virtual Response AddTag(string key, string value /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -708,7 +708,7 @@ public virtual async Task> SetTagsAsync(IDicti /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -765,7 +765,7 @@ public virtual Response SetTags(IDictionary /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -825,7 +825,7 @@ public virtual async Task> RemoveTagAsync(stri /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/MongoDBDatabaseThroughputSettingResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/MongoDBDatabaseThroughputSettingResource.cs index aede05af362e..974b32514d44 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/MongoDBDatabaseThroughputSettingResource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/MongoDBDatabaseThroughputSettingResource.cs @@ -103,7 +103,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -143,7 +143,7 @@ public virtual async Task> Ge /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -183,7 +183,7 @@ public virtual Response Get(Cancellati /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -229,7 +229,7 @@ public virtual async Task /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -275,7 +275,7 @@ public virtual ArmOperation CreateOrUp /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -317,7 +317,7 @@ public virtual async Task /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -359,7 +359,7 @@ public virtual ArmOperation MigrateMon /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -401,7 +401,7 @@ public virtual async Task /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -443,7 +443,7 @@ public virtual ArmOperation MigrateMon /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -489,7 +489,7 @@ public virtual async Task> M /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -535,7 +535,7 @@ public virtual ArmOperation MongoDBDataba /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -581,7 +581,7 @@ public virtual async Task> M /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -627,7 +627,7 @@ public virtual ArmOperation MongoDBDataba /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -689,7 +689,7 @@ public virtual async Task> Ad /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -751,7 +751,7 @@ public virtual Response AddTag(string /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -808,7 +808,7 @@ public virtual async Task> Se /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -865,7 +865,7 @@ public virtual Response SetTags(IDicti /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -925,7 +925,7 @@ public virtual async Task> Re /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/MongoDBRoleDefinitionCollection.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/MongoDBRoleDefinitionCollection.cs index 2fd4babf1d68..19ec0fe7f367 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/MongoDBRoleDefinitionCollection.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/MongoDBRoleDefinitionCollection.cs @@ -65,7 +65,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -114,7 +114,7 @@ public virtual async Task> CreateOrU /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -163,7 +163,7 @@ public virtual ArmOperation CreateOrUpdate(WaitUn /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -208,7 +208,7 @@ public virtual async Task> GetAsync(stri /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -253,7 +253,7 @@ public virtual Response Get(string mongoRoleDefin /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -282,7 +282,7 @@ public virtual AsyncPageable GetAllAsync(Cancella /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -311,7 +311,7 @@ public virtual Pageable GetAll(CancellationToken /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -354,7 +354,7 @@ public virtual async Task> ExistsAsync(string mongoRoleDefinition /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -397,7 +397,7 @@ public virtual Response Exists(string mongoRoleDefinitionId, CancellationT /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -442,7 +442,7 @@ public virtual async Task> GetIf /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/MongoDBRoleDefinitionResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/MongoDBRoleDefinitionResource.cs index 4d9d9cde587d..ec09feb31df4 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/MongoDBRoleDefinitionResource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/MongoDBRoleDefinitionResource.cs @@ -102,7 +102,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -142,7 +142,7 @@ public virtual async Task> GetAsync(Canc /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -182,7 +182,7 @@ public virtual Response Get(CancellationToken can /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -224,7 +224,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -266,7 +266,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -312,7 +312,7 @@ public virtual async Task> UpdateAsy /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/MongoDBUserDefinitionCollection.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/MongoDBUserDefinitionCollection.cs index 9429a41cf6e8..f7db35133a32 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/MongoDBUserDefinitionCollection.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/MongoDBUserDefinitionCollection.cs @@ -65,7 +65,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -114,7 +114,7 @@ public virtual async Task> CreateOrU /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -163,7 +163,7 @@ public virtual ArmOperation CreateOrUpdate(WaitUn /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -208,7 +208,7 @@ public virtual async Task> GetAsync(stri /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -253,7 +253,7 @@ public virtual Response Get(string mongoUserDefin /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -282,7 +282,7 @@ public virtual AsyncPageable GetAllAsync(Cancella /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -311,7 +311,7 @@ public virtual Pageable GetAll(CancellationToken /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -354,7 +354,7 @@ public virtual async Task> ExistsAsync(string mongoUserDefinition /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -397,7 +397,7 @@ public virtual Response Exists(string mongoUserDefinitionId, CancellationT /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -442,7 +442,7 @@ public virtual async Task> GetIf /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/MongoDBUserDefinitionResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/MongoDBUserDefinitionResource.cs index d9ff020ccc8e..a69af2d5bb60 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/MongoDBUserDefinitionResource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/MongoDBUserDefinitionResource.cs @@ -102,7 +102,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -142,7 +142,7 @@ public virtual async Task> GetAsync(Canc /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -182,7 +182,7 @@ public virtual Response Get(CancellationToken can /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -224,7 +224,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -266,7 +266,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -312,7 +312,7 @@ public virtual async Task> UpdateAsy /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/MongoMIRoleAssignmentResource.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/MongoMIRoleAssignmentResource.Serialization.cs new file mode 100644 index 000000000000..4344526a8ad5 --- /dev/null +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/MongoMIRoleAssignmentResource.Serialization.cs @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; + +namespace Azure.ResourceManager.CosmosDB +{ + public partial class MongoMIRoleAssignmentResource : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); + + MongoMIRoleAssignmentResourceData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options); + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options); + + MongoMIRoleAssignmentResourceData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options); + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)Data).GetFormatFromOptions(options); + } +} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/MongoMIRoleAssignmentResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/MongoMIRoleAssignmentResource.cs new file mode 100644 index 000000000000..50f62d387114 --- /dev/null +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/MongoMIRoleAssignmentResource.cs @@ -0,0 +1,347 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.CosmosDB +{ + /// + /// A Class representing a MongoMIRoleAssignmentResource along with the instance operations that can be performed on it. + /// If you have a you can construct a + /// from an instance of using the GetMongoMIRoleAssignmentResource method. + /// Otherwise you can get one from its parent resource using the GetMongoMIRoleAssignmentResource method. + /// + public partial class MongoMIRoleAssignmentResource : ArmResource + { + /// Generate the resource identifier of a instance. + /// The subscriptionId. + /// The resourceGroupName. + /// The accountName. + /// The roleAssignmentId. + public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string accountName, string roleAssignmentId) + { + var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongoMIRoleAssignments/{roleAssignmentId}"; + return new ResourceIdentifier(resourceId); + } + + private readonly ClientDiagnostics _mongoMIRoleAssignmentResourceMongoMIResourcesClientDiagnostics; + private readonly MongoMIResourcesRestOperations _mongoMIRoleAssignmentResourceMongoMIResourcesRestClient; + private readonly MongoMIRoleAssignmentResourceData _data; + + /// Gets the resource type for the operations. + public static readonly ResourceType ResourceType = "Microsoft.DocumentDB/databaseAccounts/mongoMIRoleAssignments"; + + /// Initializes a new instance of the class for mocking. + protected MongoMIRoleAssignmentResource() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The resource that is the target of operations. + internal MongoMIRoleAssignmentResource(ArmClient client, MongoMIRoleAssignmentResourceData data) : this(client, data.Id) + { + HasData = true; + _data = data; + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The identifier of the resource that is the target of operations. + internal MongoMIRoleAssignmentResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _mongoMIRoleAssignmentResourceMongoMIResourcesClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.CosmosDB", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string mongoMIRoleAssignmentResourceMongoMIResourcesApiVersion); + _mongoMIRoleAssignmentResourceMongoMIResourcesRestClient = new MongoMIResourcesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, mongoMIRoleAssignmentResourceMongoMIResourcesApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + /// Gets whether or not the current instance has data. + public virtual bool HasData { get; } + + /// Gets the data representing this Feature. + /// Throws if there is no data loaded in the current instance. + public virtual MongoMIRoleAssignmentResourceData Data + { + get + { + if (!HasData) + throw new InvalidOperationException("The current instance does not have data, you must call Get first."); + return _data; + } + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceType), nameof(id)); + } + + /// + /// Retrieves the properties of an existing Azure Cosmos DB MongoMI Role Assignment with the given Id. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongoMIRoleAssignments/{roleAssignmentId} + /// + /// + /// Operation Id + /// MongoMIResources_GetMongoMIRoleAssignment + /// + /// + /// Default Api Version + /// 2025-05-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + { + using var scope = _mongoMIRoleAssignmentResourceMongoMIResourcesClientDiagnostics.CreateScope("MongoMIRoleAssignmentResource.Get"); + scope.Start(); + try + { + var response = await _mongoMIRoleAssignmentResourceMongoMIResourcesRestClient.GetMongoMIRoleAssignmentAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new MongoMIRoleAssignmentResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Retrieves the properties of an existing Azure Cosmos DB MongoMI Role Assignment with the given Id. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongoMIRoleAssignments/{roleAssignmentId} + /// + /// + /// Operation Id + /// MongoMIResources_GetMongoMIRoleAssignment + /// + /// + /// Default Api Version + /// 2025-05-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual Response Get(CancellationToken cancellationToken = default) + { + using var scope = _mongoMIRoleAssignmentResourceMongoMIResourcesClientDiagnostics.CreateScope("MongoMIRoleAssignmentResource.Get"); + scope.Start(); + try + { + var response = _mongoMIRoleAssignmentResourceMongoMIResourcesRestClient.GetMongoMIRoleAssignment(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new MongoMIRoleAssignmentResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Deletes an existing Azure Cosmos DB MongoMI Role Assignment. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongoMIRoleAssignments/{roleAssignmentId} + /// + /// + /// Operation Id + /// MongoMIResources_DeleteMongoMIRoleAssignment + /// + /// + /// Default Api Version + /// 2025-05-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The cancellation token to use. + public virtual async Task DeleteAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default) + { + using var scope = _mongoMIRoleAssignmentResourceMongoMIResourcesClientDiagnostics.CreateScope("MongoMIRoleAssignmentResource.Delete"); + scope.Start(); + try + { + var response = await _mongoMIRoleAssignmentResourceMongoMIResourcesRestClient.DeleteMongoMIRoleAssignmentAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + var operation = new CosmosDBArmOperation(_mongoMIRoleAssignmentResourceMongoMIResourcesClientDiagnostics, Pipeline, _mongoMIRoleAssignmentResourceMongoMIResourcesRestClient.CreateDeleteMongoMIRoleAssignmentRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Deletes an existing Azure Cosmos DB MongoMI Role Assignment. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongoMIRoleAssignments/{roleAssignmentId} + /// + /// + /// Operation Id + /// MongoMIResources_DeleteMongoMIRoleAssignment + /// + /// + /// Default Api Version + /// 2025-05-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The cancellation token to use. + public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancellationToken = default) + { + using var scope = _mongoMIRoleAssignmentResourceMongoMIResourcesClientDiagnostics.CreateScope("MongoMIRoleAssignmentResource.Delete"); + scope.Start(); + try + { + var response = _mongoMIRoleAssignmentResourceMongoMIResourcesRestClient.DeleteMongoMIRoleAssignment(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + var operation = new CosmosDBArmOperation(_mongoMIRoleAssignmentResourceMongoMIResourcesClientDiagnostics, Pipeline, _mongoMIRoleAssignmentResourceMongoMIResourcesRestClient.CreateDeleteMongoMIRoleAssignmentRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletionResponse(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Creates or updates an Azure Cosmos DB MongoMI Role Assignment. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongoMIRoleAssignments/{roleAssignmentId} + /// + /// + /// Operation Id + /// MongoMIResources_CreateUpdateMongoMIRoleAssignment + /// + /// + /// Default Api Version + /// 2025-05-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The properties required to create or update a Role Assignment. + /// The cancellation token to use. + /// is null. + public virtual async Task> UpdateAsync(WaitUntil waitUntil, MongoMIRoleAssignmentResourceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _mongoMIRoleAssignmentResourceMongoMIResourcesClientDiagnostics.CreateScope("MongoMIRoleAssignmentResource.Update"); + scope.Start(); + try + { + var response = await _mongoMIRoleAssignmentResourceMongoMIResourcesRestClient.CreateUpdateMongoMIRoleAssignmentAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, cancellationToken).ConfigureAwait(false); + var operation = new CosmosDBArmOperation(new MongoMIRoleAssignmentResourceOperationSource(Client), _mongoMIRoleAssignmentResourceMongoMIResourcesClientDiagnostics, Pipeline, _mongoMIRoleAssignmentResourceMongoMIResourcesRestClient.CreateCreateUpdateMongoMIRoleAssignmentRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Creates or updates an Azure Cosmos DB MongoMI Role Assignment. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongoMIRoleAssignments/{roleAssignmentId} + /// + /// + /// Operation Id + /// MongoMIResources_CreateUpdateMongoMIRoleAssignment + /// + /// + /// Default Api Version + /// 2025-05-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The properties required to create or update a Role Assignment. + /// The cancellation token to use. + /// is null. + public virtual ArmOperation Update(WaitUntil waitUntil, MongoMIRoleAssignmentResourceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _mongoMIRoleAssignmentResourceMongoMIResourcesClientDiagnostics.CreateScope("MongoMIRoleAssignmentResource.Update"); + scope.Start(); + try + { + var response = _mongoMIRoleAssignmentResourceMongoMIResourcesRestClient.CreateUpdateMongoMIRoleAssignment(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, cancellationToken); + var operation = new CosmosDBArmOperation(new MongoMIRoleAssignmentResourceOperationSource(Client), _mongoMIRoleAssignmentResourceMongoMIResourcesClientDiagnostics, Pipeline, _mongoMIRoleAssignmentResourceMongoMIResourcesRestClient.CreateCreateUpdateMongoMIRoleAssignmentRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/MongoMIRoleAssignmentResourceCollection.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/MongoMIRoleAssignmentResourceCollection.cs new file mode 100644 index 000000000000..1e86c806979b --- /dev/null +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/MongoMIRoleAssignmentResourceCollection.cs @@ -0,0 +1,491 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Autorest.CSharp.Core; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.CosmosDB +{ + /// + /// A class representing a collection of and their operations. + /// Each in the collection will belong to the same instance of . + /// To get a instance call the GetMongoMIRoleAssignmentResources method from an instance of . + /// + public partial class MongoMIRoleAssignmentResourceCollection : ArmCollection, IEnumerable, IAsyncEnumerable + { + private readonly ClientDiagnostics _mongoMIRoleAssignmentResourceMongoMIResourcesClientDiagnostics; + private readonly MongoMIResourcesRestOperations _mongoMIRoleAssignmentResourceMongoMIResourcesRestClient; + + /// Initializes a new instance of the class for mocking. + protected MongoMIRoleAssignmentResourceCollection() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The identifier of the parent resource that is the target of operations. + internal MongoMIRoleAssignmentResourceCollection(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _mongoMIRoleAssignmentResourceMongoMIResourcesClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.CosmosDB", MongoMIRoleAssignmentResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(MongoMIRoleAssignmentResource.ResourceType, out string mongoMIRoleAssignmentResourceMongoMIResourcesApiVersion); + _mongoMIRoleAssignmentResourceMongoMIResourcesRestClient = new MongoMIResourcesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, mongoMIRoleAssignmentResourceMongoMIResourcesApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != CosmosDBAccountResource.ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, CosmosDBAccountResource.ResourceType), nameof(id)); + } + + /// + /// Creates or updates an Azure Cosmos DB MongoMI Role Assignment. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongoMIRoleAssignments/{roleAssignmentId} + /// + /// + /// Operation Id + /// MongoMIResources_CreateUpdateMongoMIRoleAssignment + /// + /// + /// Default Api Version + /// 2025-05-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The GUID for the Role Assignment. + /// The properties required to create or update a Role Assignment. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// or is null. + public virtual async Task> CreateOrUpdateAsync(WaitUntil waitUntil, string roleAssignmentId, MongoMIRoleAssignmentResourceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(roleAssignmentId, nameof(roleAssignmentId)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _mongoMIRoleAssignmentResourceMongoMIResourcesClientDiagnostics.CreateScope("MongoMIRoleAssignmentResourceCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = await _mongoMIRoleAssignmentResourceMongoMIResourcesRestClient.CreateUpdateMongoMIRoleAssignmentAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, roleAssignmentId, data, cancellationToken).ConfigureAwait(false); + var operation = new CosmosDBArmOperation(new MongoMIRoleAssignmentResourceOperationSource(Client), _mongoMIRoleAssignmentResourceMongoMIResourcesClientDiagnostics, Pipeline, _mongoMIRoleAssignmentResourceMongoMIResourcesRestClient.CreateCreateUpdateMongoMIRoleAssignmentRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, roleAssignmentId, data).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Creates or updates an Azure Cosmos DB MongoMI Role Assignment. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongoMIRoleAssignments/{roleAssignmentId} + /// + /// + /// Operation Id + /// MongoMIResources_CreateUpdateMongoMIRoleAssignment + /// + /// + /// Default Api Version + /// 2025-05-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The GUID for the Role Assignment. + /// The properties required to create or update a Role Assignment. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// or is null. + public virtual ArmOperation CreateOrUpdate(WaitUntil waitUntil, string roleAssignmentId, MongoMIRoleAssignmentResourceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(roleAssignmentId, nameof(roleAssignmentId)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _mongoMIRoleAssignmentResourceMongoMIResourcesClientDiagnostics.CreateScope("MongoMIRoleAssignmentResourceCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = _mongoMIRoleAssignmentResourceMongoMIResourcesRestClient.CreateUpdateMongoMIRoleAssignment(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, roleAssignmentId, data, cancellationToken); + var operation = new CosmosDBArmOperation(new MongoMIRoleAssignmentResourceOperationSource(Client), _mongoMIRoleAssignmentResourceMongoMIResourcesClientDiagnostics, Pipeline, _mongoMIRoleAssignmentResourceMongoMIResourcesRestClient.CreateCreateUpdateMongoMIRoleAssignmentRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, roleAssignmentId, data).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Retrieves the properties of an existing Azure Cosmos DB MongoMI Role Assignment with the given Id. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongoMIRoleAssignments/{roleAssignmentId} + /// + /// + /// Operation Id + /// MongoMIResources_GetMongoMIRoleAssignment + /// + /// + /// Default Api Version + /// 2025-05-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The GUID for the Role Assignment. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetAsync(string roleAssignmentId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(roleAssignmentId, nameof(roleAssignmentId)); + + using var scope = _mongoMIRoleAssignmentResourceMongoMIResourcesClientDiagnostics.CreateScope("MongoMIRoleAssignmentResourceCollection.Get"); + scope.Start(); + try + { + var response = await _mongoMIRoleAssignmentResourceMongoMIResourcesRestClient.GetMongoMIRoleAssignmentAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, roleAssignmentId, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new MongoMIRoleAssignmentResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Retrieves the properties of an existing Azure Cosmos DB MongoMI Role Assignment with the given Id. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongoMIRoleAssignments/{roleAssignmentId} + /// + /// + /// Operation Id + /// MongoMIResources_GetMongoMIRoleAssignment + /// + /// + /// Default Api Version + /// 2025-05-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The GUID for the Role Assignment. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Get(string roleAssignmentId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(roleAssignmentId, nameof(roleAssignmentId)); + + using var scope = _mongoMIRoleAssignmentResourceMongoMIResourcesClientDiagnostics.CreateScope("MongoMIRoleAssignmentResourceCollection.Get"); + scope.Start(); + try + { + var response = _mongoMIRoleAssignmentResourceMongoMIResourcesRestClient.GetMongoMIRoleAssignment(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, roleAssignmentId, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new MongoMIRoleAssignmentResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Retrieves the list of all Azure Cosmos DB MongoMI Role Assignments. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongoMIRoleAssignments + /// + /// + /// Operation Id + /// MongoMIResources_ListMongoMIRoleAssignments + /// + /// + /// Default Api Version + /// 2025-05-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetAllAsync(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _mongoMIRoleAssignmentResourceMongoMIResourcesRestClient.CreateListMongoMIRoleAssignmentsRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, null, e => new MongoMIRoleAssignmentResource(Client, MongoMIRoleAssignmentResourceData.DeserializeMongoMIRoleAssignmentResourceData(e)), _mongoMIRoleAssignmentResourceMongoMIResourcesClientDiagnostics, Pipeline, "MongoMIRoleAssignmentResourceCollection.GetAll", "value", null, cancellationToken); + } + + /// + /// Retrieves the list of all Azure Cosmos DB MongoMI Role Assignments. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongoMIRoleAssignments + /// + /// + /// Operation Id + /// MongoMIResources_ListMongoMIRoleAssignments + /// + /// + /// Default Api Version + /// 2025-05-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetAll(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _mongoMIRoleAssignmentResourceMongoMIResourcesRestClient.CreateListMongoMIRoleAssignmentsRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, null, e => new MongoMIRoleAssignmentResource(Client, MongoMIRoleAssignmentResourceData.DeserializeMongoMIRoleAssignmentResourceData(e)), _mongoMIRoleAssignmentResourceMongoMIResourcesClientDiagnostics, Pipeline, "MongoMIRoleAssignmentResourceCollection.GetAll", "value", null, cancellationToken); + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongoMIRoleAssignments/{roleAssignmentId} + /// + /// + /// Operation Id + /// MongoMIResources_GetMongoMIRoleAssignment + /// + /// + /// Default Api Version + /// 2025-05-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The GUID for the Role Assignment. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> ExistsAsync(string roleAssignmentId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(roleAssignmentId, nameof(roleAssignmentId)); + + using var scope = _mongoMIRoleAssignmentResourceMongoMIResourcesClientDiagnostics.CreateScope("MongoMIRoleAssignmentResourceCollection.Exists"); + scope.Start(); + try + { + var response = await _mongoMIRoleAssignmentResourceMongoMIResourcesRestClient.GetMongoMIRoleAssignmentAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, roleAssignmentId, cancellationToken: cancellationToken).ConfigureAwait(false); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongoMIRoleAssignments/{roleAssignmentId} + /// + /// + /// Operation Id + /// MongoMIResources_GetMongoMIRoleAssignment + /// + /// + /// Default Api Version + /// 2025-05-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The GUID for the Role Assignment. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Exists(string roleAssignmentId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(roleAssignmentId, nameof(roleAssignmentId)); + + using var scope = _mongoMIRoleAssignmentResourceMongoMIResourcesClientDiagnostics.CreateScope("MongoMIRoleAssignmentResourceCollection.Exists"); + scope.Start(); + try + { + var response = _mongoMIRoleAssignmentResourceMongoMIResourcesRestClient.GetMongoMIRoleAssignment(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, roleAssignmentId, cancellationToken: cancellationToken); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongoMIRoleAssignments/{roleAssignmentId} + /// + /// + /// Operation Id + /// MongoMIResources_GetMongoMIRoleAssignment + /// + /// + /// Default Api Version + /// 2025-05-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The GUID for the Role Assignment. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetIfExistsAsync(string roleAssignmentId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(roleAssignmentId, nameof(roleAssignmentId)); + + using var scope = _mongoMIRoleAssignmentResourceMongoMIResourcesClientDiagnostics.CreateScope("MongoMIRoleAssignmentResourceCollection.GetIfExists"); + scope.Start(); + try + { + var response = await _mongoMIRoleAssignmentResourceMongoMIResourcesRestClient.GetMongoMIRoleAssignmentAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, roleAssignmentId, cancellationToken: cancellationToken).ConfigureAwait(false); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new MongoMIRoleAssignmentResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongoMIRoleAssignments/{roleAssignmentId} + /// + /// + /// Operation Id + /// MongoMIResources_GetMongoMIRoleAssignment + /// + /// + /// Default Api Version + /// 2025-05-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The GUID for the Role Assignment. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual NullableResponse GetIfExists(string roleAssignmentId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(roleAssignmentId, nameof(roleAssignmentId)); + + using var scope = _mongoMIRoleAssignmentResourceMongoMIResourcesClientDiagnostics.CreateScope("MongoMIRoleAssignmentResourceCollection.GetIfExists"); + scope.Start(); + try + { + var response = _mongoMIRoleAssignmentResourceMongoMIResourcesRestClient.GetMongoMIRoleAssignment(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, roleAssignmentId, cancellationToken: cancellationToken); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new MongoMIRoleAssignmentResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetAll().GetEnumerator(); + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetAll().GetEnumerator(); + } + + IAsyncEnumerator IAsyncEnumerable.GetAsyncEnumerator(CancellationToken cancellationToken) + { + return GetAllAsync(cancellationToken: cancellationToken).GetAsyncEnumerator(cancellationToken); + } + } +} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/MongoMIRoleAssignmentResourceData.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/MongoMIRoleAssignmentResourceData.Serialization.cs new file mode 100644 index 000000000000..39acb38f371b --- /dev/null +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/MongoMIRoleAssignmentResourceData.Serialization.cs @@ -0,0 +1,363 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text; +using System.Text.Json; +using Azure.Core; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.CosmosDB +{ + public partial class MongoMIRoleAssignmentResourceData : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(MongoMIRoleAssignmentResourceData)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + writer.WritePropertyName("properties"u8); + writer.WriteStartObject(); + if (Optional.IsDefined(RoleDefinitionId)) + { + writer.WritePropertyName("roleDefinitionId"u8); + writer.WriteStringValue(RoleDefinitionId); + } + if (Optional.IsDefined(Scope)) + { + writer.WritePropertyName("scope"u8); + writer.WriteStringValue(Scope); + } + if (Optional.IsDefined(PrincipalId)) + { + writer.WritePropertyName("principalId"u8); + writer.WriteStringValue(PrincipalId.Value); + } + if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) + { + writer.WritePropertyName("provisioningState"u8); + writer.WriteStringValue(ProvisioningState); + } + writer.WriteEndObject(); + } + + MongoMIRoleAssignmentResourceData 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(MongoMIRoleAssignmentResourceData)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeMongoMIRoleAssignmentResourceData(document.RootElement, options); + } + + internal static MongoMIRoleAssignmentResourceData DeserializeMongoMIRoleAssignmentResourceData(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ResourceIdentifier id = default; + string name = default; + ResourceType type = default; + SystemData systemData = default; + string roleDefinitionId = default; + string scope = default; + Guid? principalId = default; + string provisioningState = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("id"u8)) + { + id = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("type"u8)) + { + type = new ResourceType(property.Value.GetString()); + continue; + } + if (property.NameEquals("systemData"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + systemData = JsonSerializer.Deserialize(property.Value.GetRawText()); + continue; + } + if (property.NameEquals("properties"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + foreach (var property0 in property.Value.EnumerateObject()) + { + if (property0.NameEquals("roleDefinitionId"u8)) + { + roleDefinitionId = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("scope"u8)) + { + scope = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("principalId"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + principalId = property0.Value.GetGuid(); + continue; + } + if (property0.NameEquals("provisioningState"u8)) + { + provisioningState = property0.Value.GetString(); + continue; + } + } + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new MongoMIRoleAssignmentResourceData( + id, + name, + type, + systemData, + roleDefinitionId, + scope, + principalId, + provisioningState, + serializedAdditionalRawData); + } + + private BinaryData SerializeBicep(ModelReaderWriterOptions options) + { + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Name), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" name: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Name)) + { + builder.Append(" name: "); + if (Name.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{Name}'''"); + } + else + { + builder.AppendLine($"'{Name}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Id), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" id: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Id)) + { + builder.Append(" id: "); + builder.AppendLine($"'{Id.ToString()}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(SystemData), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" systemData: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(SystemData)) + { + builder.Append(" systemData: "); + builder.AppendLine($"'{SystemData.ToString()}'"); + } + } + + builder.Append(" properties:"); + builder.AppendLine(" {"); + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(RoleDefinitionId), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" roleDefinitionId: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(RoleDefinitionId)) + { + builder.Append(" roleDefinitionId: "); + if (RoleDefinitionId.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{RoleDefinitionId}'''"); + } + else + { + builder.AppendLine($"'{RoleDefinitionId}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Scope), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" scope: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Scope)) + { + builder.Append(" scope: "); + if (Scope.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{Scope}'''"); + } + else + { + builder.AppendLine($"'{Scope}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(PrincipalId), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" principalId: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(PrincipalId)) + { + builder.Append(" principalId: "); + builder.AppendLine($"'{PrincipalId.Value.ToString()}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(ProvisioningState), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" provisioningState: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(ProvisioningState)) + { + builder.Append(" provisioningState: "); + if (ProvisioningState.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{ProvisioningState}'''"); + } + else + { + builder.AppendLine($"'{ProvisioningState}'"); + } + } + } + + builder.AppendLine(" }"); + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + case "bicep": + return SerializeBicep(options); + default: + throw new FormatException($"The model {nameof(MongoMIRoleAssignmentResourceData)} does not support writing '{options.Format}' format."); + } + } + + MongoMIRoleAssignmentResourceData 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 DeserializeMongoMIRoleAssignmentResourceData(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(MongoMIRoleAssignmentResourceData)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/MongoMIRoleAssignmentResourceData.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/MongoMIRoleAssignmentResourceData.cs new file mode 100644 index 000000000000..881e964fc4bf --- /dev/null +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/MongoMIRoleAssignmentResourceData.cs @@ -0,0 +1,90 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.CosmosDB +{ + /// + /// A class representing the MongoMIRoleAssignmentResource data model. + /// Parameters to create and update an Azure Cosmos DB MongoMI Role Assignment. + /// + public partial class MongoMIRoleAssignmentResourceData : ResourceData + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public MongoMIRoleAssignmentResourceData() + { + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The unique identifier for the associated Role Definition. + /// The data plane resource path for which access is being granted through this MongoMI Role Assignment. + /// The unique identifier for the associated AAD principal in the AAD graph to which access is being granted through this MongoMI Role Assignment. Tenant ID for the principal is inferred using the tenant associated with the subscription. + /// Provisioning state of the resource. + /// Keeps track of any properties unknown to the library. + internal MongoMIRoleAssignmentResourceData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, string roleDefinitionId, string scope, Guid? principalId, string provisioningState, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) + { + RoleDefinitionId = roleDefinitionId; + Scope = scope; + PrincipalId = principalId; + ProvisioningState = provisioningState; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The unique identifier for the associated Role Definition. + [WirePath("properties.roleDefinitionId")] + public string RoleDefinitionId { get; set; } + /// The data plane resource path for which access is being granted through this MongoMI Role Assignment. + [WirePath("properties.scope")] + public string Scope { get; set; } + /// The unique identifier for the associated AAD principal in the AAD graph to which access is being granted through this MongoMI Role Assignment. Tenant ID for the principal is inferred using the tenant associated with the subscription. + [WirePath("properties.principalId")] + public Guid? PrincipalId { get; set; } + /// Provisioning state of the resource. + [WirePath("properties.provisioningState")] + public string ProvisioningState { get; } + } +} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/MongoMIRoleDefinitionResource.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/MongoMIRoleDefinitionResource.Serialization.cs new file mode 100644 index 000000000000..1639a792a850 --- /dev/null +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/MongoMIRoleDefinitionResource.Serialization.cs @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; + +namespace Azure.ResourceManager.CosmosDB +{ + public partial class MongoMIRoleDefinitionResource : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); + + MongoMIRoleDefinitionResourceData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options); + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options); + + MongoMIRoleDefinitionResourceData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options); + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)Data).GetFormatFromOptions(options); + } +} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/MongoMIRoleDefinitionResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/MongoMIRoleDefinitionResource.cs new file mode 100644 index 000000000000..019c8c62a666 --- /dev/null +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/MongoMIRoleDefinitionResource.cs @@ -0,0 +1,347 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.CosmosDB +{ + /// + /// A Class representing a MongoMIRoleDefinitionResource along with the instance operations that can be performed on it. + /// If you have a you can construct a + /// from an instance of using the GetMongoMIRoleDefinitionResource method. + /// Otherwise you can get one from its parent resource using the GetMongoMIRoleDefinitionResource method. + /// + public partial class MongoMIRoleDefinitionResource : ArmResource + { + /// Generate the resource identifier of a instance. + /// The subscriptionId. + /// The resourceGroupName. + /// The accountName. + /// The roleDefinitionId. + public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string accountName, string roleDefinitionId) + { + var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongoMIRoleDefinitions/{roleDefinitionId}"; + return new ResourceIdentifier(resourceId); + } + + private readonly ClientDiagnostics _mongoMIRoleDefinitionResourceMongoMIResourcesClientDiagnostics; + private readonly MongoMIResourcesRestOperations _mongoMIRoleDefinitionResourceMongoMIResourcesRestClient; + private readonly MongoMIRoleDefinitionResourceData _data; + + /// Gets the resource type for the operations. + public static readonly ResourceType ResourceType = "Microsoft.DocumentDB/databaseAccounts/mongoMIRoleDefinitions"; + + /// Initializes a new instance of the class for mocking. + protected MongoMIRoleDefinitionResource() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The resource that is the target of operations. + internal MongoMIRoleDefinitionResource(ArmClient client, MongoMIRoleDefinitionResourceData data) : this(client, data.Id) + { + HasData = true; + _data = data; + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The identifier of the resource that is the target of operations. + internal MongoMIRoleDefinitionResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _mongoMIRoleDefinitionResourceMongoMIResourcesClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.CosmosDB", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string mongoMIRoleDefinitionResourceMongoMIResourcesApiVersion); + _mongoMIRoleDefinitionResourceMongoMIResourcesRestClient = new MongoMIResourcesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, mongoMIRoleDefinitionResourceMongoMIResourcesApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + /// Gets whether or not the current instance has data. + public virtual bool HasData { get; } + + /// Gets the data representing this Feature. + /// Throws if there is no data loaded in the current instance. + public virtual MongoMIRoleDefinitionResourceData Data + { + get + { + if (!HasData) + throw new InvalidOperationException("The current instance does not have data, you must call Get first."); + return _data; + } + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceType), nameof(id)); + } + + /// + /// Retrieves the properties of an existing Azure Cosmos DB MongoMI Role Definition with the given Id. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongoMIRoleDefinitions/{roleDefinitionId} + /// + /// + /// Operation Id + /// MongoMIResources_GetMongoMIRoleDefinition + /// + /// + /// Default Api Version + /// 2025-05-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + { + using var scope = _mongoMIRoleDefinitionResourceMongoMIResourcesClientDiagnostics.CreateScope("MongoMIRoleDefinitionResource.Get"); + scope.Start(); + try + { + var response = await _mongoMIRoleDefinitionResourceMongoMIResourcesRestClient.GetMongoMIRoleDefinitionAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new MongoMIRoleDefinitionResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Retrieves the properties of an existing Azure Cosmos DB MongoMI Role Definition with the given Id. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongoMIRoleDefinitions/{roleDefinitionId} + /// + /// + /// Operation Id + /// MongoMIResources_GetMongoMIRoleDefinition + /// + /// + /// Default Api Version + /// 2025-05-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual Response Get(CancellationToken cancellationToken = default) + { + using var scope = _mongoMIRoleDefinitionResourceMongoMIResourcesClientDiagnostics.CreateScope("MongoMIRoleDefinitionResource.Get"); + scope.Start(); + try + { + var response = _mongoMIRoleDefinitionResourceMongoMIResourcesRestClient.GetMongoMIRoleDefinition(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new MongoMIRoleDefinitionResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Deletes an existing Azure Cosmos DB MongoMI Role Definition. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongoMIRoleDefinitions/{roleDefinitionId} + /// + /// + /// Operation Id + /// MongoMIResources_DeleteMongoMIRoleDefinition + /// + /// + /// Default Api Version + /// 2025-05-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The cancellation token to use. + public virtual async Task DeleteAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default) + { + using var scope = _mongoMIRoleDefinitionResourceMongoMIResourcesClientDiagnostics.CreateScope("MongoMIRoleDefinitionResource.Delete"); + scope.Start(); + try + { + var response = await _mongoMIRoleDefinitionResourceMongoMIResourcesRestClient.DeleteMongoMIRoleDefinitionAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + var operation = new CosmosDBArmOperation(_mongoMIRoleDefinitionResourceMongoMIResourcesClientDiagnostics, Pipeline, _mongoMIRoleDefinitionResourceMongoMIResourcesRestClient.CreateDeleteMongoMIRoleDefinitionRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Deletes an existing Azure Cosmos DB MongoMI Role Definition. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongoMIRoleDefinitions/{roleDefinitionId} + /// + /// + /// Operation Id + /// MongoMIResources_DeleteMongoMIRoleDefinition + /// + /// + /// Default Api Version + /// 2025-05-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The cancellation token to use. + public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancellationToken = default) + { + using var scope = _mongoMIRoleDefinitionResourceMongoMIResourcesClientDiagnostics.CreateScope("MongoMIRoleDefinitionResource.Delete"); + scope.Start(); + try + { + var response = _mongoMIRoleDefinitionResourceMongoMIResourcesRestClient.DeleteMongoMIRoleDefinition(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + var operation = new CosmosDBArmOperation(_mongoMIRoleDefinitionResourceMongoMIResourcesClientDiagnostics, Pipeline, _mongoMIRoleDefinitionResourceMongoMIResourcesRestClient.CreateDeleteMongoMIRoleDefinitionRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletionResponse(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Creates or updates an Azure Cosmos DB MongoMI Role Definition. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongoMIRoleDefinitions/{roleDefinitionId} + /// + /// + /// Operation Id + /// MongoMIResources_CreateUpdateMongoMIRoleDefinition + /// + /// + /// Default Api Version + /// 2025-05-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The properties required to create or update a Role Definition. + /// The cancellation token to use. + /// is null. + public virtual async Task> UpdateAsync(WaitUntil waitUntil, MongoMIRoleDefinitionResourceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _mongoMIRoleDefinitionResourceMongoMIResourcesClientDiagnostics.CreateScope("MongoMIRoleDefinitionResource.Update"); + scope.Start(); + try + { + var response = await _mongoMIRoleDefinitionResourceMongoMIResourcesRestClient.CreateUpdateMongoMIRoleDefinitionAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, cancellationToken).ConfigureAwait(false); + var operation = new CosmosDBArmOperation(new MongoMIRoleDefinitionResourceOperationSource(Client), _mongoMIRoleDefinitionResourceMongoMIResourcesClientDiagnostics, Pipeline, _mongoMIRoleDefinitionResourceMongoMIResourcesRestClient.CreateCreateUpdateMongoMIRoleDefinitionRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Creates or updates an Azure Cosmos DB MongoMI Role Definition. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongoMIRoleDefinitions/{roleDefinitionId} + /// + /// + /// Operation Id + /// MongoMIResources_CreateUpdateMongoMIRoleDefinition + /// + /// + /// Default Api Version + /// 2025-05-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The properties required to create or update a Role Definition. + /// The cancellation token to use. + /// is null. + public virtual ArmOperation Update(WaitUntil waitUntil, MongoMIRoleDefinitionResourceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _mongoMIRoleDefinitionResourceMongoMIResourcesClientDiagnostics.CreateScope("MongoMIRoleDefinitionResource.Update"); + scope.Start(); + try + { + var response = _mongoMIRoleDefinitionResourceMongoMIResourcesRestClient.CreateUpdateMongoMIRoleDefinition(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, cancellationToken); + var operation = new CosmosDBArmOperation(new MongoMIRoleDefinitionResourceOperationSource(Client), _mongoMIRoleDefinitionResourceMongoMIResourcesClientDiagnostics, Pipeline, _mongoMIRoleDefinitionResourceMongoMIResourcesRestClient.CreateCreateUpdateMongoMIRoleDefinitionRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/MongoMIRoleDefinitionResourceCollection.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/MongoMIRoleDefinitionResourceCollection.cs new file mode 100644 index 000000000000..79e59a6e525b --- /dev/null +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/MongoMIRoleDefinitionResourceCollection.cs @@ -0,0 +1,491 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Autorest.CSharp.Core; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.CosmosDB +{ + /// + /// A class representing a collection of and their operations. + /// Each in the collection will belong to the same instance of . + /// To get a instance call the GetMongoMIRoleDefinitionResources method from an instance of . + /// + public partial class MongoMIRoleDefinitionResourceCollection : ArmCollection, IEnumerable, IAsyncEnumerable + { + private readonly ClientDiagnostics _mongoMIRoleDefinitionResourceMongoMIResourcesClientDiagnostics; + private readonly MongoMIResourcesRestOperations _mongoMIRoleDefinitionResourceMongoMIResourcesRestClient; + + /// Initializes a new instance of the class for mocking. + protected MongoMIRoleDefinitionResourceCollection() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The identifier of the parent resource that is the target of operations. + internal MongoMIRoleDefinitionResourceCollection(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _mongoMIRoleDefinitionResourceMongoMIResourcesClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.CosmosDB", MongoMIRoleDefinitionResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(MongoMIRoleDefinitionResource.ResourceType, out string mongoMIRoleDefinitionResourceMongoMIResourcesApiVersion); + _mongoMIRoleDefinitionResourceMongoMIResourcesRestClient = new MongoMIResourcesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, mongoMIRoleDefinitionResourceMongoMIResourcesApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != CosmosDBAccountResource.ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, CosmosDBAccountResource.ResourceType), nameof(id)); + } + + /// + /// Creates or updates an Azure Cosmos DB MongoMI Role Definition. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongoMIRoleDefinitions/{roleDefinitionId} + /// + /// + /// Operation Id + /// MongoMIResources_CreateUpdateMongoMIRoleDefinition + /// + /// + /// Default Api Version + /// 2025-05-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The GUID for the Role Definition. + /// The properties required to create or update a Role Definition. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// or is null. + public virtual async Task> CreateOrUpdateAsync(WaitUntil waitUntil, string roleDefinitionId, MongoMIRoleDefinitionResourceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(roleDefinitionId, nameof(roleDefinitionId)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _mongoMIRoleDefinitionResourceMongoMIResourcesClientDiagnostics.CreateScope("MongoMIRoleDefinitionResourceCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = await _mongoMIRoleDefinitionResourceMongoMIResourcesRestClient.CreateUpdateMongoMIRoleDefinitionAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, roleDefinitionId, data, cancellationToken).ConfigureAwait(false); + var operation = new CosmosDBArmOperation(new MongoMIRoleDefinitionResourceOperationSource(Client), _mongoMIRoleDefinitionResourceMongoMIResourcesClientDiagnostics, Pipeline, _mongoMIRoleDefinitionResourceMongoMIResourcesRestClient.CreateCreateUpdateMongoMIRoleDefinitionRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, roleDefinitionId, data).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Creates or updates an Azure Cosmos DB MongoMI Role Definition. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongoMIRoleDefinitions/{roleDefinitionId} + /// + /// + /// Operation Id + /// MongoMIResources_CreateUpdateMongoMIRoleDefinition + /// + /// + /// Default Api Version + /// 2025-05-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The GUID for the Role Definition. + /// The properties required to create or update a Role Definition. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// or is null. + public virtual ArmOperation CreateOrUpdate(WaitUntil waitUntil, string roleDefinitionId, MongoMIRoleDefinitionResourceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(roleDefinitionId, nameof(roleDefinitionId)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _mongoMIRoleDefinitionResourceMongoMIResourcesClientDiagnostics.CreateScope("MongoMIRoleDefinitionResourceCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = _mongoMIRoleDefinitionResourceMongoMIResourcesRestClient.CreateUpdateMongoMIRoleDefinition(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, roleDefinitionId, data, cancellationToken); + var operation = new CosmosDBArmOperation(new MongoMIRoleDefinitionResourceOperationSource(Client), _mongoMIRoleDefinitionResourceMongoMIResourcesClientDiagnostics, Pipeline, _mongoMIRoleDefinitionResourceMongoMIResourcesRestClient.CreateCreateUpdateMongoMIRoleDefinitionRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, roleDefinitionId, data).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Retrieves the properties of an existing Azure Cosmos DB MongoMI Role Definition with the given Id. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongoMIRoleDefinitions/{roleDefinitionId} + /// + /// + /// Operation Id + /// MongoMIResources_GetMongoMIRoleDefinition + /// + /// + /// Default Api Version + /// 2025-05-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The GUID for the Role Definition. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetAsync(string roleDefinitionId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(roleDefinitionId, nameof(roleDefinitionId)); + + using var scope = _mongoMIRoleDefinitionResourceMongoMIResourcesClientDiagnostics.CreateScope("MongoMIRoleDefinitionResourceCollection.Get"); + scope.Start(); + try + { + var response = await _mongoMIRoleDefinitionResourceMongoMIResourcesRestClient.GetMongoMIRoleDefinitionAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, roleDefinitionId, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new MongoMIRoleDefinitionResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Retrieves the properties of an existing Azure Cosmos DB MongoMI Role Definition with the given Id. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongoMIRoleDefinitions/{roleDefinitionId} + /// + /// + /// Operation Id + /// MongoMIResources_GetMongoMIRoleDefinition + /// + /// + /// Default Api Version + /// 2025-05-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The GUID for the Role Definition. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Get(string roleDefinitionId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(roleDefinitionId, nameof(roleDefinitionId)); + + using var scope = _mongoMIRoleDefinitionResourceMongoMIResourcesClientDiagnostics.CreateScope("MongoMIRoleDefinitionResourceCollection.Get"); + scope.Start(); + try + { + var response = _mongoMIRoleDefinitionResourceMongoMIResourcesRestClient.GetMongoMIRoleDefinition(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, roleDefinitionId, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new MongoMIRoleDefinitionResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Retrieves the list of all Azure Cosmos DB MongoMI Role Definitions. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongoMIRoleDefinitions + /// + /// + /// Operation Id + /// MongoMIResources_ListMongoMIRoleDefinitions + /// + /// + /// Default Api Version + /// 2025-05-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetAllAsync(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _mongoMIRoleDefinitionResourceMongoMIResourcesRestClient.CreateListMongoMIRoleDefinitionsRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, null, e => new MongoMIRoleDefinitionResource(Client, MongoMIRoleDefinitionResourceData.DeserializeMongoMIRoleDefinitionResourceData(e)), _mongoMIRoleDefinitionResourceMongoMIResourcesClientDiagnostics, Pipeline, "MongoMIRoleDefinitionResourceCollection.GetAll", "value", null, cancellationToken); + } + + /// + /// Retrieves the list of all Azure Cosmos DB MongoMI Role Definitions. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongoMIRoleDefinitions + /// + /// + /// Operation Id + /// MongoMIResources_ListMongoMIRoleDefinitions + /// + /// + /// Default Api Version + /// 2025-05-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetAll(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _mongoMIRoleDefinitionResourceMongoMIResourcesRestClient.CreateListMongoMIRoleDefinitionsRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, null, e => new MongoMIRoleDefinitionResource(Client, MongoMIRoleDefinitionResourceData.DeserializeMongoMIRoleDefinitionResourceData(e)), _mongoMIRoleDefinitionResourceMongoMIResourcesClientDiagnostics, Pipeline, "MongoMIRoleDefinitionResourceCollection.GetAll", "value", null, cancellationToken); + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongoMIRoleDefinitions/{roleDefinitionId} + /// + /// + /// Operation Id + /// MongoMIResources_GetMongoMIRoleDefinition + /// + /// + /// Default Api Version + /// 2025-05-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The GUID for the Role Definition. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> ExistsAsync(string roleDefinitionId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(roleDefinitionId, nameof(roleDefinitionId)); + + using var scope = _mongoMIRoleDefinitionResourceMongoMIResourcesClientDiagnostics.CreateScope("MongoMIRoleDefinitionResourceCollection.Exists"); + scope.Start(); + try + { + var response = await _mongoMIRoleDefinitionResourceMongoMIResourcesRestClient.GetMongoMIRoleDefinitionAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, roleDefinitionId, cancellationToken: cancellationToken).ConfigureAwait(false); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongoMIRoleDefinitions/{roleDefinitionId} + /// + /// + /// Operation Id + /// MongoMIResources_GetMongoMIRoleDefinition + /// + /// + /// Default Api Version + /// 2025-05-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The GUID for the Role Definition. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Exists(string roleDefinitionId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(roleDefinitionId, nameof(roleDefinitionId)); + + using var scope = _mongoMIRoleDefinitionResourceMongoMIResourcesClientDiagnostics.CreateScope("MongoMIRoleDefinitionResourceCollection.Exists"); + scope.Start(); + try + { + var response = _mongoMIRoleDefinitionResourceMongoMIResourcesRestClient.GetMongoMIRoleDefinition(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, roleDefinitionId, cancellationToken: cancellationToken); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongoMIRoleDefinitions/{roleDefinitionId} + /// + /// + /// Operation Id + /// MongoMIResources_GetMongoMIRoleDefinition + /// + /// + /// Default Api Version + /// 2025-05-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The GUID for the Role Definition. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetIfExistsAsync(string roleDefinitionId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(roleDefinitionId, nameof(roleDefinitionId)); + + using var scope = _mongoMIRoleDefinitionResourceMongoMIResourcesClientDiagnostics.CreateScope("MongoMIRoleDefinitionResourceCollection.GetIfExists"); + scope.Start(); + try + { + var response = await _mongoMIRoleDefinitionResourceMongoMIResourcesRestClient.GetMongoMIRoleDefinitionAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, roleDefinitionId, cancellationToken: cancellationToken).ConfigureAwait(false); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new MongoMIRoleDefinitionResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongoMIRoleDefinitions/{roleDefinitionId} + /// + /// + /// Operation Id + /// MongoMIResources_GetMongoMIRoleDefinition + /// + /// + /// Default Api Version + /// 2025-05-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The GUID for the Role Definition. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual NullableResponse GetIfExists(string roleDefinitionId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(roleDefinitionId, nameof(roleDefinitionId)); + + using var scope = _mongoMIRoleDefinitionResourceMongoMIResourcesClientDiagnostics.CreateScope("MongoMIRoleDefinitionResourceCollection.GetIfExists"); + scope.Start(); + try + { + var response = _mongoMIRoleDefinitionResourceMongoMIResourcesRestClient.GetMongoMIRoleDefinition(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, roleDefinitionId, cancellationToken: cancellationToken); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new MongoMIRoleDefinitionResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetAll().GetEnumerator(); + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetAll().GetEnumerator(); + } + + IAsyncEnumerator IAsyncEnumerable.GetAsyncEnumerator(CancellationToken cancellationToken) + { + return GetAllAsync(cancellationToken: cancellationToken).GetAsyncEnumerator(cancellationToken); + } + } +} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/MongoMIRoleDefinitionResourceData.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/MongoMIRoleDefinitionResourceData.Serialization.cs new file mode 100644 index 000000000000..38f68bbf0159 --- /dev/null +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/MongoMIRoleDefinitionResourceData.Serialization.cs @@ -0,0 +1,441 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Text.Json; +using Azure.Core; +using Azure.ResourceManager.CosmosDB.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.CosmosDB +{ + public partial class MongoMIRoleDefinitionResourceData : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(MongoMIRoleDefinitionResourceData)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + writer.WritePropertyName("properties"u8); + writer.WriteStartObject(); + if (Optional.IsDefined(IdPropertiesId)) + { + writer.WritePropertyName("id"u8); + writer.WriteStringValue(IdPropertiesId); + } + if (Optional.IsDefined(RoleName)) + { + writer.WritePropertyName("roleName"u8); + writer.WriteStringValue(RoleName); + } + if (Optional.IsDefined(TypePropertiesType)) + { + writer.WritePropertyName("type"u8); + writer.WriteStringValue(TypePropertiesType.Value.ToSerialString()); + } + if (Optional.IsCollectionDefined(AssignableScopes)) + { + writer.WritePropertyName("assignableScopes"u8); + writer.WriteStartArray(); + foreach (var item in AssignableScopes) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(Permissions)) + { + writer.WritePropertyName("permissions"u8); + writer.WriteStartArray(); + foreach (var item in Permissions) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + writer.WriteEndObject(); + } + + MongoMIRoleDefinitionResourceData 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(MongoMIRoleDefinitionResourceData)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeMongoMIRoleDefinitionResourceData(document.RootElement, options); + } + + internal static MongoMIRoleDefinitionResourceData DeserializeMongoMIRoleDefinitionResourceData(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ResourceIdentifier id = default; + string name = default; + ResourceType type = default; + SystemData systemData = default; + string id0 = default; + string roleName = default; + CosmosDBSqlRoleDefinitionType? type0 = default; + IList assignableScopes = default; + IList permissions = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("id"u8)) + { + id = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("type"u8)) + { + type = new ResourceType(property.Value.GetString()); + continue; + } + if (property.NameEquals("systemData"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + systemData = JsonSerializer.Deserialize(property.Value.GetRawText()); + continue; + } + if (property.NameEquals("properties"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + foreach (var property0 in property.Value.EnumerateObject()) + { + if (property0.NameEquals("id"u8)) + { + id0 = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("roleName"u8)) + { + roleName = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("type"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + type0 = property0.Value.GetString().ToCosmosDBSqlRoleDefinitionType(); + continue; + } + if (property0.NameEquals("assignableScopes"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property0.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + assignableScopes = array; + continue; + } + if (property0.NameEquals("permissions"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property0.Value.EnumerateArray()) + { + array.Add(Permission.DeserializePermission(item, options)); + } + permissions = array; + continue; + } + } + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new MongoMIRoleDefinitionResourceData( + id, + name, + type, + systemData, + id0, + roleName, + type0, + assignableScopes ?? new ChangeTrackingList(), + permissions ?? new ChangeTrackingList(), + serializedAdditionalRawData); + } + + private BinaryData SerializeBicep(ModelReaderWriterOptions options) + { + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Name), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" name: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Name)) + { + builder.Append(" name: "); + if (Name.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{Name}'''"); + } + else + { + builder.AppendLine($"'{Name}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Id), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" id: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Id)) + { + builder.Append(" id: "); + builder.AppendLine($"'{Id.ToString()}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(SystemData), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" systemData: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(SystemData)) + { + builder.Append(" systemData: "); + builder.AppendLine($"'{SystemData.ToString()}'"); + } + } + + builder.Append(" properties:"); + builder.AppendLine(" {"); + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(IdPropertiesId), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" id: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(IdPropertiesId)) + { + builder.Append(" id: "); + if (IdPropertiesId.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{IdPropertiesId}'''"); + } + else + { + builder.AppendLine($"'{IdPropertiesId}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(RoleName), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" roleName: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(RoleName)) + { + builder.Append(" roleName: "); + if (RoleName.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{RoleName}'''"); + } + else + { + builder.AppendLine($"'{RoleName}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(TypePropertiesType), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" type: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(TypePropertiesType)) + { + builder.Append(" type: "); + builder.AppendLine($"'{TypePropertiesType.Value.ToSerialString()}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(AssignableScopes), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" assignableScopes: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsCollectionDefined(AssignableScopes)) + { + if (AssignableScopes.Any()) + { + builder.Append(" assignableScopes: "); + builder.AppendLine("["); + foreach (var item in AssignableScopes) + { + if (item == null) + { + builder.Append("null"); + continue; + } + if (item.Contains(Environment.NewLine)) + { + builder.AppendLine(" '''"); + builder.AppendLine($"{item}'''"); + } + else + { + builder.AppendLine($" '{item}'"); + } + } + builder.AppendLine(" ]"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Permissions), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" permissions: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsCollectionDefined(Permissions)) + { + if (Permissions.Any()) + { + builder.Append(" permissions: "); + builder.AppendLine("["); + foreach (var item in Permissions) + { + BicepSerializationHelpers.AppendChildObject(builder, item, options, 6, true, " permissions: "); + } + builder.AppendLine(" ]"); + } + } + } + + builder.AppendLine(" }"); + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + case "bicep": + return SerializeBicep(options); + default: + throw new FormatException($"The model {nameof(MongoMIRoleDefinitionResourceData)} does not support writing '{options.Format}' format."); + } + } + + MongoMIRoleDefinitionResourceData 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 DeserializeMongoMIRoleDefinitionResourceData(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(MongoMIRoleDefinitionResourceData)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/MongoMIRoleDefinitionResourceData.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/MongoMIRoleDefinitionResourceData.cs new file mode 100644 index 000000000000..164ba515025b --- /dev/null +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/MongoMIRoleDefinitionResourceData.cs @@ -0,0 +1,98 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; +using Azure.ResourceManager.CosmosDB.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.CosmosDB +{ + /// + /// A class representing the MongoMIRoleDefinitionResource data model. + /// Parameters to create and update an Azure Cosmos DB MongoMI Role Definition. + /// + public partial class MongoMIRoleDefinitionResourceData : ResourceData + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public MongoMIRoleDefinitionResourceData() + { + AssignableScopes = new ChangeTrackingList(); + Permissions = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The path id for the Role Definition. + /// A user-friendly name for the Role Definition. Must be unique for the database account. + /// Indicates whether the Role Definition was built-in or user created. + /// A set of fully qualified Scopes at or below which MongoMI Role Assignments may be created using this Role Definition. This will allow application of this Role Definition on the entire database account or any underlying Database / Collection. Must have at least one element. Scopes higher than Database account are not enforceable as assignable Scopes. Note that resources referenced in assignable Scopes need not exist. + /// The set of operations allowed through this Role Definition. + /// Keeps track of any properties unknown to the library. + internal MongoMIRoleDefinitionResourceData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, string idPropertiesId, string roleName, CosmosDBSqlRoleDefinitionType? typePropertiesType, IList assignableScopes, IList permissions, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) + { + IdPropertiesId = idPropertiesId; + RoleName = roleName; + TypePropertiesType = typePropertiesType; + AssignableScopes = assignableScopes; + Permissions = permissions; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The path id for the Role Definition. + [WirePath("properties.id")] + public string IdPropertiesId { get; set; } + /// A user-friendly name for the Role Definition. Must be unique for the database account. + [WirePath("properties.roleName")] + public string RoleName { get; set; } + /// Indicates whether the Role Definition was built-in or user created. + [WirePath("properties.type")] + public CosmosDBSqlRoleDefinitionType? TypePropertiesType { get; set; } + /// A set of fully qualified Scopes at or below which MongoMI Role Assignments may be created using this Role Definition. This will allow application of this Role Definition on the entire database account or any underlying Database / Collection. Must have at least one element. Scopes higher than Database account are not enforceable as assignable Scopes. Note that resources referenced in assignable Scopes need not exist. + [WirePath("properties.assignableScopes")] + public IList AssignableScopes { get; } + /// The set of operations allowed through this Role Definition. + [WirePath("properties.permissions")] + public IList Permissions { get; } + } +} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/NetworkSecurityPerimeterConfigurationCollection.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/NetworkSecurityPerimeterConfigurationCollection.cs index 6331452c40a1..c79be0fb926c 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/NetworkSecurityPerimeterConfigurationCollection.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/NetworkSecurityPerimeterConfigurationCollection.cs @@ -64,7 +64,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -109,7 +109,7 @@ public virtual async Task /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -154,7 +154,7 @@ public virtual Response Get(strin /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -184,7 +184,7 @@ public virtual AsyncPageable GetA /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -214,7 +214,7 @@ public virtual Pageable GetAll(Ca /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -257,7 +257,7 @@ public virtual async Task> ExistsAsync(string networkSecurityPeri /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -300,7 +300,7 @@ public virtual Response Exists(string networkSecurityPerimeterConfiguratio /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -345,7 +345,7 @@ public virtual async Task /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/NetworkSecurityPerimeterConfigurationResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/NetworkSecurityPerimeterConfigurationResource.cs index 02efbcedde73..6af29c0ee577 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/NetworkSecurityPerimeterConfigurationResource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/NetworkSecurityPerimeterConfigurationResource.cs @@ -101,7 +101,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -141,7 +141,7 @@ public virtual async Task /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -181,7 +181,7 @@ public virtual Response Get(Cance /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -223,7 +223,7 @@ public virtual async Task ReconcileAsync(WaitUntil waitUntil, Canc /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/CassandraClustersRestOperations.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/CassandraClustersRestOperations.cs index 0fa8232d6cae..12e5cb457e7b 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/CassandraClustersRestOperations.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/CassandraClustersRestOperations.cs @@ -32,7 +32,7 @@ public CassandraClustersRestOperations(HttpPipeline pipeline, string application { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2024-12-01-preview"; + _apiVersion = apiVersion ?? "2025-05-01-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/CassandraDataCentersRestOperations.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/CassandraDataCentersRestOperations.cs index 28c299f942c8..303eee7afad2 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/CassandraDataCentersRestOperations.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/CassandraDataCentersRestOperations.cs @@ -32,7 +32,7 @@ public CassandraDataCentersRestOperations(HttpPipeline pipeline, string applicat { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2024-12-01-preview"; + _apiVersion = apiVersion ?? "2025-05-01-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/CassandraResourcesRestOperations.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/CassandraResourcesRestOperations.cs index 1b73499c7471..0ba787c6dfed 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/CassandraResourcesRestOperations.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/CassandraResourcesRestOperations.cs @@ -32,7 +32,7 @@ public CassandraResourcesRestOperations(HttpPipeline pipeline, string applicatio { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2024-12-01-preview"; + _apiVersion = apiVersion ?? "2025-05-01-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } @@ -2520,5 +2520,789 @@ public Response MigrateCassandraViewToManualThroughput(string subscriptionId, st throw new RequestFailedException(message.Response); } } + + internal RequestUriBuilder CreateGetCassandraRoleDefinitionRequestUri(string subscriptionId, string resourceGroupName, string accountName, string roleDefinitionId) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DocumentDB/databaseAccounts/", false); + uri.AppendPath(accountName, true); + uri.AppendPath("/cassandraRoleDefinitions/", false); + uri.AppendPath(roleDefinitionId, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateGetCassandraRoleDefinitionRequest(string subscriptionId, string resourceGroupName, string accountName, string roleDefinitionId) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DocumentDB/databaseAccounts/", false); + uri.AppendPath(accountName, true); + uri.AppendPath("/cassandraRoleDefinitions/", false); + uri.AppendPath(roleDefinitionId, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Retrieves the properties of an existing Azure Cosmos DB Cassandra Role Definition with the given Id. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Cosmos DB database account name. + /// The GUID for the Role Definition. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task> GetCassandraRoleDefinitionAsync(string subscriptionId, string resourceGroupName, string accountName, string roleDefinitionId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); + Argument.AssertNotNullOrEmpty(roleDefinitionId, nameof(roleDefinitionId)); + + using var message = CreateGetCassandraRoleDefinitionRequest(subscriptionId, resourceGroupName, accountName, roleDefinitionId); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + CassandraRoleDefinitionResourceData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = CassandraRoleDefinitionResourceData.DeserializeCassandraRoleDefinitionResourceData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((CassandraRoleDefinitionResourceData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + /// Retrieves the properties of an existing Azure Cosmos DB Cassandra Role Definition with the given Id. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Cosmos DB database account name. + /// The GUID for the Role Definition. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response GetCassandraRoleDefinition(string subscriptionId, string resourceGroupName, string accountName, string roleDefinitionId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); + Argument.AssertNotNullOrEmpty(roleDefinitionId, nameof(roleDefinitionId)); + + using var message = CreateGetCassandraRoleDefinitionRequest(subscriptionId, resourceGroupName, accountName, roleDefinitionId); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + CassandraRoleDefinitionResourceData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = CassandraRoleDefinitionResourceData.DeserializeCassandraRoleDefinitionResourceData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((CassandraRoleDefinitionResourceData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateCreateUpdateCassandraRoleDefinitionRequestUri(string subscriptionId, string resourceGroupName, string accountName, string roleDefinitionId, CassandraRoleDefinitionResourceData data) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DocumentDB/databaseAccounts/", false); + uri.AppendPath(accountName, true); + uri.AppendPath("/cassandraRoleDefinitions/", false); + uri.AppendPath(roleDefinitionId, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateCreateUpdateCassandraRoleDefinitionRequest(string subscriptionId, string resourceGroupName, string accountName, string roleDefinitionId, CassandraRoleDefinitionResourceData data) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Put; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DocumentDB/databaseAccounts/", false); + uri.AppendPath(accountName, true); + uri.AppendPath("/cassandraRoleDefinitions/", false); + uri.AppendPath(roleDefinitionId, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(data, ModelSerializationExtensions.WireOptions); + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// Creates or updates an Azure Cosmos DB Cassandra Role Definition. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Cosmos DB database account name. + /// The GUID for the Role Definition. + /// The properties required to create or update a Role Definition. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task CreateUpdateCassandraRoleDefinitionAsync(string subscriptionId, string resourceGroupName, string accountName, string roleDefinitionId, CassandraRoleDefinitionResourceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); + Argument.AssertNotNullOrEmpty(roleDefinitionId, nameof(roleDefinitionId)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateUpdateCassandraRoleDefinitionRequest(subscriptionId, resourceGroupName, accountName, roleDefinitionId, data); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Creates or updates an Azure Cosmos DB Cassandra Role Definition. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Cosmos DB database account name. + /// The GUID for the Role Definition. + /// The properties required to create or update a Role Definition. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response CreateUpdateCassandraRoleDefinition(string subscriptionId, string resourceGroupName, string accountName, string roleDefinitionId, CassandraRoleDefinitionResourceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); + Argument.AssertNotNullOrEmpty(roleDefinitionId, nameof(roleDefinitionId)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateUpdateCassandraRoleDefinitionRequest(subscriptionId, resourceGroupName, accountName, roleDefinitionId, data); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateDeleteCassandraRoleDefinitionRequestUri(string subscriptionId, string resourceGroupName, string accountName, string roleDefinitionId) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DocumentDB/databaseAccounts/", false); + uri.AppendPath(accountName, true); + uri.AppendPath("/cassandraRoleDefinitions/", false); + uri.AppendPath(roleDefinitionId, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateDeleteCassandraRoleDefinitionRequest(string subscriptionId, string resourceGroupName, string accountName, string roleDefinitionId) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Delete; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DocumentDB/databaseAccounts/", false); + uri.AppendPath(accountName, true); + uri.AppendPath("/cassandraRoleDefinitions/", false); + uri.AppendPath(roleDefinitionId, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Deletes an existing Azure Cosmos DB Cassandra Role Definition. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Cosmos DB database account name. + /// The GUID for the Role Definition. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task DeleteCassandraRoleDefinitionAsync(string subscriptionId, string resourceGroupName, string accountName, string roleDefinitionId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); + Argument.AssertNotNullOrEmpty(roleDefinitionId, nameof(roleDefinitionId)); + + using var message = CreateDeleteCassandraRoleDefinitionRequest(subscriptionId, resourceGroupName, accountName, roleDefinitionId); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Deletes an existing Azure Cosmos DB Cassandra Role Definition. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Cosmos DB database account name. + /// The GUID for the Role Definition. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response DeleteCassandraRoleDefinition(string subscriptionId, string resourceGroupName, string accountName, string roleDefinitionId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); + Argument.AssertNotNullOrEmpty(roleDefinitionId, nameof(roleDefinitionId)); + + using var message = CreateDeleteCassandraRoleDefinitionRequest(subscriptionId, resourceGroupName, accountName, roleDefinitionId); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListCassandraRoleDefinitionsRequestUri(string subscriptionId, string resourceGroupName, string accountName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DocumentDB/databaseAccounts/", false); + uri.AppendPath(accountName, true); + uri.AppendPath("/cassandraRoleDefinitions", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateListCassandraRoleDefinitionsRequest(string subscriptionId, string resourceGroupName, string accountName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DocumentDB/databaseAccounts/", false); + uri.AppendPath(accountName, true); + uri.AppendPath("/cassandraRoleDefinitions", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Retrieves the list of all Azure Cosmos DB Cassandra Role Definitions. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Cosmos DB database account name. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> ListCassandraRoleDefinitionsAsync(string subscriptionId, string resourceGroupName, string accountName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); + + using var message = CreateListCassandraRoleDefinitionsRequest(subscriptionId, resourceGroupName, accountName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + CassandraRoleDefinitionListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = CassandraRoleDefinitionListResult.DeserializeCassandraRoleDefinitionListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Retrieves the list of all Azure Cosmos DB Cassandra Role Definitions. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Cosmos DB database account name. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response ListCassandraRoleDefinitions(string subscriptionId, string resourceGroupName, string accountName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); + + using var message = CreateListCassandraRoleDefinitionsRequest(subscriptionId, resourceGroupName, accountName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + CassandraRoleDefinitionListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = CassandraRoleDefinitionListResult.DeserializeCassandraRoleDefinitionListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateGetCassandraRoleAssignmentRequestUri(string subscriptionId, string resourceGroupName, string accountName, string roleAssignmentId) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DocumentDB/databaseAccounts/", false); + uri.AppendPath(accountName, true); + uri.AppendPath("/cassandraRoleAssignments/", false); + uri.AppendPath(roleAssignmentId, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateGetCassandraRoleAssignmentRequest(string subscriptionId, string resourceGroupName, string accountName, string roleAssignmentId) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DocumentDB/databaseAccounts/", false); + uri.AppendPath(accountName, true); + uri.AppendPath("/cassandraRoleAssignments/", false); + uri.AppendPath(roleAssignmentId, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Retrieves the properties of an existing Azure Cosmos DB Cassandra Role Assignment with the given Id. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Cosmos DB database account name. + /// The GUID for the Role Assignment. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task> GetCassandraRoleAssignmentAsync(string subscriptionId, string resourceGroupName, string accountName, string roleAssignmentId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); + Argument.AssertNotNullOrEmpty(roleAssignmentId, nameof(roleAssignmentId)); + + using var message = CreateGetCassandraRoleAssignmentRequest(subscriptionId, resourceGroupName, accountName, roleAssignmentId); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + CassandraRoleAssignmentResourceData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = CassandraRoleAssignmentResourceData.DeserializeCassandraRoleAssignmentResourceData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((CassandraRoleAssignmentResourceData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + /// Retrieves the properties of an existing Azure Cosmos DB Cassandra Role Assignment with the given Id. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Cosmos DB database account name. + /// The GUID for the Role Assignment. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response GetCassandraRoleAssignment(string subscriptionId, string resourceGroupName, string accountName, string roleAssignmentId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); + Argument.AssertNotNullOrEmpty(roleAssignmentId, nameof(roleAssignmentId)); + + using var message = CreateGetCassandraRoleAssignmentRequest(subscriptionId, resourceGroupName, accountName, roleAssignmentId); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + CassandraRoleAssignmentResourceData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = CassandraRoleAssignmentResourceData.DeserializeCassandraRoleAssignmentResourceData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((CassandraRoleAssignmentResourceData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateCreateUpdateCassandraRoleAssignmentRequestUri(string subscriptionId, string resourceGroupName, string accountName, string roleAssignmentId, CassandraRoleAssignmentResourceData data) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DocumentDB/databaseAccounts/", false); + uri.AppendPath(accountName, true); + uri.AppendPath("/cassandraRoleAssignments/", false); + uri.AppendPath(roleAssignmentId, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateCreateUpdateCassandraRoleAssignmentRequest(string subscriptionId, string resourceGroupName, string accountName, string roleAssignmentId, CassandraRoleAssignmentResourceData data) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Put; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DocumentDB/databaseAccounts/", false); + uri.AppendPath(accountName, true); + uri.AppendPath("/cassandraRoleAssignments/", false); + uri.AppendPath(roleAssignmentId, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(data, ModelSerializationExtensions.WireOptions); + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// Creates or updates an Azure Cosmos DB Cassandra Role Assignment. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Cosmos DB database account name. + /// The GUID for the Role Assignment. + /// The properties required to create or update a Role Assignment. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task CreateUpdateCassandraRoleAssignmentAsync(string subscriptionId, string resourceGroupName, string accountName, string roleAssignmentId, CassandraRoleAssignmentResourceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); + Argument.AssertNotNullOrEmpty(roleAssignmentId, nameof(roleAssignmentId)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateUpdateCassandraRoleAssignmentRequest(subscriptionId, resourceGroupName, accountName, roleAssignmentId, data); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Creates or updates an Azure Cosmos DB Cassandra Role Assignment. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Cosmos DB database account name. + /// The GUID for the Role Assignment. + /// The properties required to create or update a Role Assignment. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response CreateUpdateCassandraRoleAssignment(string subscriptionId, string resourceGroupName, string accountName, string roleAssignmentId, CassandraRoleAssignmentResourceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); + Argument.AssertNotNullOrEmpty(roleAssignmentId, nameof(roleAssignmentId)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateUpdateCassandraRoleAssignmentRequest(subscriptionId, resourceGroupName, accountName, roleAssignmentId, data); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateDeleteCassandraRoleAssignmentRequestUri(string subscriptionId, string resourceGroupName, string accountName, string roleAssignmentId) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DocumentDB/databaseAccounts/", false); + uri.AppendPath(accountName, true); + uri.AppendPath("/cassandraRoleAssignments/", false); + uri.AppendPath(roleAssignmentId, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateDeleteCassandraRoleAssignmentRequest(string subscriptionId, string resourceGroupName, string accountName, string roleAssignmentId) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Delete; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DocumentDB/databaseAccounts/", false); + uri.AppendPath(accountName, true); + uri.AppendPath("/cassandraRoleAssignments/", false); + uri.AppendPath(roleAssignmentId, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Deletes an existing Azure Cosmos DB Cassandra Role Assignment. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Cosmos DB database account name. + /// The GUID for the Role Assignment. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task DeleteCassandraRoleAssignmentAsync(string subscriptionId, string resourceGroupName, string accountName, string roleAssignmentId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); + Argument.AssertNotNullOrEmpty(roleAssignmentId, nameof(roleAssignmentId)); + + using var message = CreateDeleteCassandraRoleAssignmentRequest(subscriptionId, resourceGroupName, accountName, roleAssignmentId); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Deletes an existing Azure Cosmos DB Cassandra Role Assignment. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Cosmos DB database account name. + /// The GUID for the Role Assignment. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response DeleteCassandraRoleAssignment(string subscriptionId, string resourceGroupName, string accountName, string roleAssignmentId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); + Argument.AssertNotNullOrEmpty(roleAssignmentId, nameof(roleAssignmentId)); + + using var message = CreateDeleteCassandraRoleAssignmentRequest(subscriptionId, resourceGroupName, accountName, roleAssignmentId); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListCassandraRoleAssignmentsRequestUri(string subscriptionId, string resourceGroupName, string accountName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DocumentDB/databaseAccounts/", false); + uri.AppendPath(accountName, true); + uri.AppendPath("/cassandraRoleAssignments", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateListCassandraRoleAssignmentsRequest(string subscriptionId, string resourceGroupName, string accountName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DocumentDB/databaseAccounts/", false); + uri.AppendPath(accountName, true); + uri.AppendPath("/cassandraRoleAssignments", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Retrieves the list of all Azure Cosmos DB Cassandra Role Assignments. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Cosmos DB database account name. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> ListCassandraRoleAssignmentsAsync(string subscriptionId, string resourceGroupName, string accountName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); + + using var message = CreateListCassandraRoleAssignmentsRequest(subscriptionId, resourceGroupName, accountName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + CassandraRoleAssignmentListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = CassandraRoleAssignmentListResult.DeserializeCassandraRoleAssignmentListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Retrieves the list of all Azure Cosmos DB Cassandra Role Assignments. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Cosmos DB database account name. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response ListCassandraRoleAssignments(string subscriptionId, string resourceGroupName, string accountName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); + + using var message = CreateListCassandraRoleAssignmentsRequest(subscriptionId, resourceGroupName, accountName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + CassandraRoleAssignmentListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = CassandraRoleAssignmentListResult.DeserializeCassandraRoleAssignmentListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } } } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/ChaosFaultRestOperations.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/ChaosFaultRestOperations.cs index d1514156a838..3c9c6fdf389e 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/ChaosFaultRestOperations.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/ChaosFaultRestOperations.cs @@ -32,7 +32,7 @@ public ChaosFaultRestOperations(HttpPipeline pipeline, string applicationId, Uri { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2024-12-01-preview"; + _apiVersion = apiVersion ?? "2025-05-01-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/CollectionPartitionRegionRestOperations.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/CollectionPartitionRegionRestOperations.cs index 18fb4f635a7e..048ed5fdeff2 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/CollectionPartitionRegionRestOperations.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/CollectionPartitionRegionRestOperations.cs @@ -32,7 +32,7 @@ public CollectionPartitionRegionRestOperations(HttpPipeline pipeline, string app { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2024-12-01-preview"; + _apiVersion = apiVersion ?? "2025-05-01-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/CollectionPartitionRestOperations.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/CollectionPartitionRestOperations.cs index 23991a6972a3..2314d5219f1a 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/CollectionPartitionRestOperations.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/CollectionPartitionRestOperations.cs @@ -32,7 +32,7 @@ public CollectionPartitionRestOperations(HttpPipeline pipeline, string applicati { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2024-12-01-preview"; + _apiVersion = apiVersion ?? "2025-05-01-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/CollectionRegionRestOperations.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/CollectionRegionRestOperations.cs index 3be6408b09ea..8f972e124414 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/CollectionRegionRestOperations.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/CollectionRegionRestOperations.cs @@ -32,7 +32,7 @@ public CollectionRegionRestOperations(HttpPipeline pipeline, string applicationI { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2024-12-01-preview"; + _apiVersion = apiVersion ?? "2025-05-01-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/CollectionRestOperations.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/CollectionRestOperations.cs index e2ebc243955d..ef6c82986f1e 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/CollectionRestOperations.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/CollectionRestOperations.cs @@ -32,7 +32,7 @@ public CollectionRestOperations(HttpPipeline pipeline, string applicationId, Uri { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2024-12-01-preview"; + _apiVersion = apiVersion ?? "2025-05-01-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/CopyJobsRestOperations.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/CopyJobsRestOperations.cs new file mode 100644 index 000000000000..f792449b6721 --- /dev/null +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/CopyJobsRestOperations.cs @@ -0,0 +1,839 @@ +// 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.CosmosDB.Models; + +namespace Azure.ResourceManager.CosmosDB +{ + internal partial class CopyJobsRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of CopyJobsRestOperations. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// The application id to use for user agent. + /// server parameter. + /// Api Version. + /// or is null. + public CopyJobsRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) + { + _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); + _endpoint = endpoint ?? new Uri("https://management.azure.com"); + _apiVersion = apiVersion ?? "2025-05-01-preview"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal RequestUriBuilder CreateCreateRequestUri(string subscriptionId, string resourceGroupName, string accountName, string jobName, CopyJobGetResultData data) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DocumentDB/databaseAccounts/", false); + uri.AppendPath(accountName, true); + uri.AppendPath("/copyJobs/", false); + uri.AppendPath(jobName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateCreateRequest(string subscriptionId, string resourceGroupName, string accountName, string jobName, CopyJobGetResultData data) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Put; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DocumentDB/databaseAccounts/", false); + uri.AppendPath(accountName, true); + uri.AppendPath("/copyJobs/", false); + uri.AppendPath(jobName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(data, ModelSerializationExtensions.WireOptions); + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// Creates a Copy Job. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Cosmos DB database account name. + /// Name of the Copy Job. + /// The to use. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task> CreateAsync(string subscriptionId, string resourceGroupName, string accountName, string jobName, CopyJobGetResultData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); + Argument.AssertNotNullOrEmpty(jobName, nameof(jobName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateRequest(subscriptionId, resourceGroupName, accountName, jobName, data); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 201: + { + CopyJobGetResultData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = CopyJobGetResultData.DeserializeCopyJobGetResultData(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Creates a Copy Job. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Cosmos DB database account name. + /// Name of the Copy Job. + /// The to use. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response Create(string subscriptionId, string resourceGroupName, string accountName, string jobName, CopyJobGetResultData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); + Argument.AssertNotNullOrEmpty(jobName, nameof(jobName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateRequest(subscriptionId, resourceGroupName, accountName, jobName, data); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 201: + { + CopyJobGetResultData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = CopyJobGetResultData.DeserializeCopyJobGetResultData(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string accountName, string jobName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DocumentDB/databaseAccounts/", false); + uri.AppendPath(accountName, true); + uri.AppendPath("/copyJobs/", false); + uri.AppendPath(jobName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string accountName, string jobName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DocumentDB/databaseAccounts/", false); + uri.AppendPath(accountName, true); + uri.AppendPath("/copyJobs/", false); + uri.AppendPath(jobName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Get a Copy Job. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Cosmos DB database account name. + /// Name of the Copy Job. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task> GetAsync(string subscriptionId, string resourceGroupName, string accountName, string jobName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); + Argument.AssertNotNullOrEmpty(jobName, nameof(jobName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, accountName, jobName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + CopyJobGetResultData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = CopyJobGetResultData.DeserializeCopyJobGetResultData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((CopyJobGetResultData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + /// Get a Copy Job. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Cosmos DB database account name. + /// Name of the Copy Job. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response Get(string subscriptionId, string resourceGroupName, string accountName, string jobName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); + Argument.AssertNotNullOrEmpty(jobName, nameof(jobName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, accountName, jobName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + CopyJobGetResultData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = CopyJobGetResultData.DeserializeCopyJobGetResultData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((CopyJobGetResultData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreatePauseRequestUri(string subscriptionId, string resourceGroupName, string accountName, string jobName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DocumentDB/databaseAccounts/", false); + uri.AppendPath(accountName, true); + uri.AppendPath("/copyJobs/", false); + uri.AppendPath(jobName, true); + uri.AppendPath("/pause", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreatePauseRequest(string subscriptionId, string resourceGroupName, string accountName, string jobName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DocumentDB/databaseAccounts/", false); + uri.AppendPath(accountName, true); + uri.AppendPath("/copyJobs/", false); + uri.AppendPath(jobName, true); + uri.AppendPath("/pause", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Pause a Copy Job. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Cosmos DB database account name. + /// Name of the Copy Job. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task> PauseAsync(string subscriptionId, string resourceGroupName, string accountName, string jobName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); + Argument.AssertNotNullOrEmpty(jobName, nameof(jobName)); + + using var message = CreatePauseRequest(subscriptionId, resourceGroupName, accountName, jobName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + CopyJobGetResultData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = CopyJobGetResultData.DeserializeCopyJobGetResultData(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Pause a Copy Job. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Cosmos DB database account name. + /// Name of the Copy Job. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response Pause(string subscriptionId, string resourceGroupName, string accountName, string jobName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); + Argument.AssertNotNullOrEmpty(jobName, nameof(jobName)); + + using var message = CreatePauseRequest(subscriptionId, resourceGroupName, accountName, jobName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + CopyJobGetResultData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = CopyJobGetResultData.DeserializeCopyJobGetResultData(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateResumeRequestUri(string subscriptionId, string resourceGroupName, string accountName, string jobName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DocumentDB/databaseAccounts/", false); + uri.AppendPath(accountName, true); + uri.AppendPath("/copyJobs/", false); + uri.AppendPath(jobName, true); + uri.AppendPath("/resume", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateResumeRequest(string subscriptionId, string resourceGroupName, string accountName, string jobName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DocumentDB/databaseAccounts/", false); + uri.AppendPath(accountName, true); + uri.AppendPath("/copyJobs/", false); + uri.AppendPath(jobName, true); + uri.AppendPath("/resume", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Resumes a Copy Job. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Cosmos DB database account name. + /// Name of the Copy Job. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task> ResumeAsync(string subscriptionId, string resourceGroupName, string accountName, string jobName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); + Argument.AssertNotNullOrEmpty(jobName, nameof(jobName)); + + using var message = CreateResumeRequest(subscriptionId, resourceGroupName, accountName, jobName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + CopyJobGetResultData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = CopyJobGetResultData.DeserializeCopyJobGetResultData(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Resumes a Copy Job. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Cosmos DB database account name. + /// Name of the Copy Job. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response Resume(string subscriptionId, string resourceGroupName, string accountName, string jobName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); + Argument.AssertNotNullOrEmpty(jobName, nameof(jobName)); + + using var message = CreateResumeRequest(subscriptionId, resourceGroupName, accountName, jobName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + CopyJobGetResultData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = CopyJobGetResultData.DeserializeCopyJobGetResultData(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateCancelRequestUri(string subscriptionId, string resourceGroupName, string accountName, string jobName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DocumentDB/databaseAccounts/", false); + uri.AppendPath(accountName, true); + uri.AppendPath("/copyJobs/", false); + uri.AppendPath(jobName, true); + uri.AppendPath("/cancel", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateCancelRequest(string subscriptionId, string resourceGroupName, string accountName, string jobName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DocumentDB/databaseAccounts/", false); + uri.AppendPath(accountName, true); + uri.AppendPath("/copyJobs/", false); + uri.AppendPath(jobName, true); + uri.AppendPath("/cancel", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Cancels a Copy Job. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Cosmos DB database account name. + /// Name of the Copy Job. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task> CancelAsync(string subscriptionId, string resourceGroupName, string accountName, string jobName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); + Argument.AssertNotNullOrEmpty(jobName, nameof(jobName)); + + using var message = CreateCancelRequest(subscriptionId, resourceGroupName, accountName, jobName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + CopyJobGetResultData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = CopyJobGetResultData.DeserializeCopyJobGetResultData(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Cancels a Copy Job. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Cosmos DB database account name. + /// Name of the Copy Job. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response Cancel(string subscriptionId, string resourceGroupName, string accountName, string jobName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); + Argument.AssertNotNullOrEmpty(jobName, nameof(jobName)); + + using var message = CreateCancelRequest(subscriptionId, resourceGroupName, accountName, jobName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + CopyJobGetResultData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = CopyJobGetResultData.DeserializeCopyJobGetResultData(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateCompleteRequestUri(string subscriptionId, string resourceGroupName, string accountName, string jobName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DocumentDB/databaseAccounts/", false); + uri.AppendPath(accountName, true); + uri.AppendPath("/copyJobs/", false); + uri.AppendPath(jobName, true); + uri.AppendPath("/complete", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateCompleteRequest(string subscriptionId, string resourceGroupName, string accountName, string jobName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DocumentDB/databaseAccounts/", false); + uri.AppendPath(accountName, true); + uri.AppendPath("/copyJobs/", false); + uri.AppendPath(jobName, true); + uri.AppendPath("/complete", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Completes an Online Copy Job. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Cosmos DB database account name. + /// Name of the Copy Job. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task> CompleteAsync(string subscriptionId, string resourceGroupName, string accountName, string jobName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); + Argument.AssertNotNullOrEmpty(jobName, nameof(jobName)); + + using var message = CreateCompleteRequest(subscriptionId, resourceGroupName, accountName, jobName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + CopyJobGetResultData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = CopyJobGetResultData.DeserializeCopyJobGetResultData(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Completes an Online Copy Job. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Cosmos DB database account name. + /// Name of the Copy Job. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response Complete(string subscriptionId, string resourceGroupName, string accountName, string jobName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); + Argument.AssertNotNullOrEmpty(jobName, nameof(jobName)); + + using var message = CreateCompleteRequest(subscriptionId, resourceGroupName, accountName, jobName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + CopyJobGetResultData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = CopyJobGetResultData.DeserializeCopyJobGetResultData(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListByDatabaseAccountRequestUri(string subscriptionId, string resourceGroupName, string accountName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DocumentDB/databaseAccounts/", false); + uri.AppendPath(accountName, true); + uri.AppendPath("/copyJobs", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateListByDatabaseAccountRequest(string subscriptionId, string resourceGroupName, string accountName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DocumentDB/databaseAccounts/", false); + uri.AppendPath(accountName, true); + uri.AppendPath("/copyJobs", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Get a list of Copy jobs. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Cosmos DB database account name. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> ListByDatabaseAccountAsync(string subscriptionId, string resourceGroupName, string accountName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); + + using var message = CreateListByDatabaseAccountRequest(subscriptionId, resourceGroupName, accountName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + CopyJobFeedResults value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = CopyJobFeedResults.DeserializeCopyJobFeedResults(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Get a list of Copy jobs. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Cosmos DB database account name. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response ListByDatabaseAccount(string subscriptionId, string resourceGroupName, string accountName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); + + using var message = CreateListByDatabaseAccountRequest(subscriptionId, resourceGroupName, accountName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + CopyJobFeedResults value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = CopyJobFeedResults.DeserializeCopyJobFeedResults(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListByDatabaseAccountNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName, string accountName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + return uri; + } + + internal HttpMessage CreateListByDatabaseAccountNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string accountName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Get a list of Copy jobs. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Cosmos DB database account name. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> ListByDatabaseAccountNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string accountName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); + + using var message = CreateListByDatabaseAccountNextPageRequest(nextLink, subscriptionId, resourceGroupName, accountName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + CopyJobFeedResults value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = CopyJobFeedResults.DeserializeCopyJobFeedResults(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Get a list of Copy jobs. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Cosmos DB database account name. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response ListByDatabaseAccountNextPage(string nextLink, string subscriptionId, string resourceGroupName, string accountName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); + + using var message = CreateListByDatabaseAccountNextPageRequest(nextLink, subscriptionId, resourceGroupName, accountName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + CopyJobFeedResults value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = CopyJobFeedResults.DeserializeCopyJobFeedResults(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/DataTransferJobsRestOperations.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/DataTransferJobsRestOperations.cs index e09d9c27deb7..4a6b16f1f4f4 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/DataTransferJobsRestOperations.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/DataTransferJobsRestOperations.cs @@ -32,7 +32,7 @@ public DataTransferJobsRestOperations(HttpPipeline pipeline, string applicationI { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2024-12-01-preview"; + _apiVersion = apiVersion ?? "2025-05-01-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/DatabaseAccountRegionRestOperations.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/DatabaseAccountRegionRestOperations.cs index 2e55e0fb1628..3a3ac9e2a8d2 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/DatabaseAccountRegionRestOperations.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/DatabaseAccountRegionRestOperations.cs @@ -32,7 +32,7 @@ public DatabaseAccountRegionRestOperations(HttpPipeline pipeline, string applica { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2024-12-01-preview"; + _apiVersion = apiVersion ?? "2025-05-01-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/DatabaseAccountsRestOperations.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/DatabaseAccountsRestOperations.cs index 8d69790b942f..ca155b62baac 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/DatabaseAccountsRestOperations.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/DatabaseAccountsRestOperations.cs @@ -32,7 +32,7 @@ public DatabaseAccountsRestOperations(HttpPipeline pipeline, string applicationI { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2024-12-01-preview"; + _apiVersion = apiVersion ?? "2025-05-01-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/DatabaseRestOperations.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/DatabaseRestOperations.cs index 332de1da49e4..0ac268c53afb 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/DatabaseRestOperations.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/DatabaseRestOperations.cs @@ -32,7 +32,7 @@ public DatabaseRestOperations(HttpPipeline pipeline, string applicationId, Uri e { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2024-12-01-preview"; + _apiVersion = apiVersion ?? "2025-05-01-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/FleetAnalyticsRestOperations.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/FleetAnalyticsRestOperations.cs new file mode 100644 index 000000000000..b6e2e52b8e0a --- /dev/null +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/FleetAnalyticsRestOperations.cs @@ -0,0 +1,523 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.CosmosDB.Models; + +namespace Azure.ResourceManager.CosmosDB +{ + internal partial class FleetAnalyticsRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of FleetAnalyticsRestOperations. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// The application id to use for user agent. + /// server parameter. + /// Api Version. + /// or is null. + public FleetAnalyticsRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) + { + _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); + _endpoint = endpoint ?? new Uri("https://management.azure.com"); + _apiVersion = apiVersion ?? "2025-05-01-preview"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal RequestUriBuilder CreateListRequestUri(string subscriptionId, string resourceGroupName, string fleetName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DocumentDB/fleets/", false); + uri.AppendPath(fleetName, true); + uri.AppendPath("/fleetAnalytics", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateListRequest(string subscriptionId, string resourceGroupName, string fleetName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DocumentDB/fleets/", false); + uri.AppendPath(fleetName, true); + uri.AppendPath("/fleetAnalytics", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Lists all the FleetAnalytics under a fleet. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Cosmos DB fleet name. Needs to be unique under a subscription. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> ListAsync(string subscriptionId, string resourceGroupName, string fleetName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + + using var message = CreateListRequest(subscriptionId, resourceGroupName, fleetName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + FleetAnalyticsListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = FleetAnalyticsListResult.DeserializeFleetAnalyticsListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Lists all the FleetAnalytics under a fleet. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Cosmos DB fleet name. Needs to be unique under a subscription. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response List(string subscriptionId, string resourceGroupName, string fleetName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + + using var message = CreateListRequest(subscriptionId, resourceGroupName, fleetName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + FleetAnalyticsListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = FleetAnalyticsListResult.DeserializeFleetAnalyticsListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string fleetName, string fleetAnalyticsName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DocumentDB/fleets/", false); + uri.AppendPath(fleetName, true); + uri.AppendPath("/fleetAnalytics/", false); + uri.AppendPath(fleetAnalyticsName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string fleetName, string fleetAnalyticsName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DocumentDB/fleets/", false); + uri.AppendPath(fleetName, true); + uri.AppendPath("/fleetAnalytics/", false); + uri.AppendPath(fleetAnalyticsName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Retrieves the properties of an existing Azure Cosmos DB FleetAnalytics under a fleet. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Cosmos DB fleet name. Needs to be unique under a subscription. + /// Cosmos DB fleetAnalytics name. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task> GetAsync(string subscriptionId, string resourceGroupName, string fleetName, string fleetAnalyticsName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + Argument.AssertNotNullOrEmpty(fleetAnalyticsName, nameof(fleetAnalyticsName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, fleetName, fleetAnalyticsName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + FleetAnalyticsResourceData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = FleetAnalyticsResourceData.DeserializeFleetAnalyticsResourceData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((FleetAnalyticsResourceData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + /// Retrieves the properties of an existing Azure Cosmos DB FleetAnalytics under a fleet. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Cosmos DB fleet name. Needs to be unique under a subscription. + /// Cosmos DB fleetAnalytics name. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response Get(string subscriptionId, string resourceGroupName, string fleetName, string fleetAnalyticsName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + Argument.AssertNotNullOrEmpty(fleetAnalyticsName, nameof(fleetAnalyticsName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, fleetName, fleetAnalyticsName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + FleetAnalyticsResourceData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = FleetAnalyticsResourceData.DeserializeFleetAnalyticsResourceData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((FleetAnalyticsResourceData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateCreateRequestUri(string subscriptionId, string resourceGroupName, string fleetName, string fleetAnalyticsName, FleetAnalyticsResourceData data) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DocumentDB/fleets/", false); + uri.AppendPath(fleetName, true); + uri.AppendPath("/fleetAnalytics/", false); + uri.AppendPath(fleetAnalyticsName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateCreateRequest(string subscriptionId, string resourceGroupName, string fleetName, string fleetAnalyticsName, FleetAnalyticsResourceData data) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Put; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DocumentDB/fleets/", false); + uri.AppendPath(fleetName, true); + uri.AppendPath("/fleetAnalytics/", false); + uri.AppendPath(fleetAnalyticsName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(data, ModelSerializationExtensions.WireOptions); + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// Creates an Azure Cosmos DB FleetAnalytics under a fleet. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Cosmos DB fleet name. Needs to be unique under a subscription. + /// Cosmos DB fleetAnalytics name. + /// The parameters to provide for the current FleetAnalytics. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task> CreateAsync(string subscriptionId, string resourceGroupName, string fleetName, string fleetAnalyticsName, FleetAnalyticsResourceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + Argument.AssertNotNullOrEmpty(fleetAnalyticsName, nameof(fleetAnalyticsName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateRequest(subscriptionId, resourceGroupName, fleetName, fleetAnalyticsName, data); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 201: + { + FleetAnalyticsResourceData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = FleetAnalyticsResourceData.DeserializeFleetAnalyticsResourceData(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Creates an Azure Cosmos DB FleetAnalytics under a fleet. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Cosmos DB fleet name. Needs to be unique under a subscription. + /// Cosmos DB fleetAnalytics name. + /// The parameters to provide for the current FleetAnalytics. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response Create(string subscriptionId, string resourceGroupName, string fleetName, string fleetAnalyticsName, FleetAnalyticsResourceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + Argument.AssertNotNullOrEmpty(fleetAnalyticsName, nameof(fleetAnalyticsName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateRequest(subscriptionId, resourceGroupName, fleetName, fleetAnalyticsName, data); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 201: + { + FleetAnalyticsResourceData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = FleetAnalyticsResourceData.DeserializeFleetAnalyticsResourceData(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string resourceGroupName, string fleetName, string fleetAnalyticsName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DocumentDB/fleets/", false); + uri.AppendPath(fleetName, true); + uri.AppendPath("/fleetAnalytics/", false); + uri.AppendPath(fleetAnalyticsName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string fleetName, string fleetAnalyticsName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Delete; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DocumentDB/fleets/", false); + uri.AppendPath(fleetName, true); + uri.AppendPath("/fleetAnalytics/", false); + uri.AppendPath(fleetAnalyticsName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Deletes an existing Azure Cosmos DB FleetAnalytics. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Cosmos DB fleet name. Needs to be unique under a subscription. + /// Cosmos DB fleetAnalytics name. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task DeleteAsync(string subscriptionId, string resourceGroupName, string fleetName, string fleetAnalyticsName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + Argument.AssertNotNullOrEmpty(fleetAnalyticsName, nameof(fleetAnalyticsName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, fleetName, fleetAnalyticsName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Deletes an existing Azure Cosmos DB FleetAnalytics. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Cosmos DB fleet name. Needs to be unique under a subscription. + /// Cosmos DB fleetAnalytics name. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response Delete(string subscriptionId, string resourceGroupName, string fleetName, string fleetAnalyticsName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + Argument.AssertNotNullOrEmpty(fleetAnalyticsName, nameof(fleetAnalyticsName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, fleetName, fleetAnalyticsName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName, string fleetName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + return uri; + } + + internal HttpMessage CreateListNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string fleetName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + 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; + } + + /// Lists all the FleetAnalytics under a fleet. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Cosmos DB fleet name. Needs to be unique under a subscription. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> ListNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string fleetName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + + using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, fleetName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + FleetAnalyticsListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = FleetAnalyticsListResult.DeserializeFleetAnalyticsListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Lists all the FleetAnalytics under a fleet. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Cosmos DB fleet name. Needs to be unique under a subscription. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response ListNextPage(string nextLink, string subscriptionId, string resourceGroupName, string fleetName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + + using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, fleetName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + FleetAnalyticsListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = FleetAnalyticsListResult.DeserializeFleetAnalyticsListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/FleetRestOperations.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/FleetRestOperations.cs new file mode 100644 index 000000000000..4cbaf597d9bf --- /dev/null +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/FleetRestOperations.cs @@ -0,0 +1,741 @@ +// 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.CosmosDB.Models; + +namespace Azure.ResourceManager.CosmosDB +{ + internal partial class FleetRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of FleetRestOperations. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// The application id to use for user agent. + /// server parameter. + /// Api Version. + /// or is null. + public FleetRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) + { + _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); + _endpoint = endpoint ?? new Uri("https://management.azure.com"); + _apiVersion = apiVersion ?? "2025-05-01-preview"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal RequestUriBuilder CreateListRequestUri(string subscriptionId) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/providers/Microsoft.DocumentDB/fleets", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateListRequest(string subscriptionId) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/providers/Microsoft.DocumentDB/fleets", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Lists all the fleets under the subscription. + /// The ID of the target subscription. The value must be an UUID. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + public async Task> ListAsync(string subscriptionId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + + using var message = CreateListRequest(subscriptionId); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + FleetListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = FleetListResult.DeserializeFleetListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Lists all the fleets under the subscription. + /// The ID of the target subscription. The value must be an UUID. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + public Response List(string subscriptionId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + + using var message = CreateListRequest(subscriptionId); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + FleetListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = FleetListResult.DeserializeFleetListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListByResourceGroupRequestUri(string subscriptionId, string resourceGroupName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DocumentDB/fleets", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateListByResourceGroupRequest(string subscriptionId, string resourceGroupName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DocumentDB/fleets", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Lists all the fleets under the specified subscription and resource group. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + public async Task> ListByResourceGroupAsync(string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + + using var message = CreateListByResourceGroupRequest(subscriptionId, resourceGroupName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + FleetListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = FleetListResult.DeserializeFleetListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Lists all the fleets under the specified subscription and resource group. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + public Response ListByResourceGroup(string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + + using var message = CreateListByResourceGroupRequest(subscriptionId, resourceGroupName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + FleetListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = FleetListResult.DeserializeFleetListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string fleetName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DocumentDB/fleets/", false); + uri.AppendPath(fleetName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string fleetName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DocumentDB/fleets/", false); + uri.AppendPath(fleetName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Retrieves the properties of an existing Azure Cosmos DB fleet under a subscription. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Cosmos DB fleet name. Needs to be unique under a subscription. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> GetAsync(string subscriptionId, string resourceGroupName, string fleetName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, fleetName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + FleetResourceData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = FleetResourceData.DeserializeFleetResourceData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((FleetResourceData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + /// Retrieves the properties of an existing Azure Cosmos DB fleet under a subscription. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Cosmos DB fleet name. Needs to be unique under a subscription. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response Get(string subscriptionId, string resourceGroupName, string fleetName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, fleetName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + FleetResourceData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = FleetResourceData.DeserializeFleetResourceData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((FleetResourceData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateCreateRequestUri(string subscriptionId, string resourceGroupName, string fleetName, FleetResourceData data) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DocumentDB/fleets/", false); + uri.AppendPath(fleetName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateCreateRequest(string subscriptionId, string resourceGroupName, string fleetName, FleetResourceData data) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Put; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DocumentDB/fleets/", false); + uri.AppendPath(fleetName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(data, ModelSerializationExtensions.WireOptions); + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// Creates an Azure Cosmos DB fleet under a subscription. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Cosmos DB fleet name. Needs to be unique under a subscription. + /// The parameters to provide for the current fleet. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> CreateAsync(string subscriptionId, string resourceGroupName, string fleetName, FleetResourceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateRequest(subscriptionId, resourceGroupName, fleetName, data); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 201: + { + FleetResourceData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = FleetResourceData.DeserializeFleetResourceData(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Creates an Azure Cosmos DB fleet under a subscription. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Cosmos DB fleet name. Needs to be unique under a subscription. + /// The parameters to provide for the current fleet. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response Create(string subscriptionId, string resourceGroupName, string fleetName, FleetResourceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateRequest(subscriptionId, resourceGroupName, fleetName, data); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 201: + { + FleetResourceData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = FleetResourceData.DeserializeFleetResourceData(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateUpdateRequestUri(string subscriptionId, string resourceGroupName, string fleetName, FleetResourcePatch patch) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DocumentDB/fleets/", false); + uri.AppendPath(fleetName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceGroupName, string fleetName, FleetResourcePatch patch) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Patch; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DocumentDB/fleets/", false); + uri.AppendPath(fleetName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(patch, ModelSerializationExtensions.WireOptions); + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// Updates the properties of an existing Azure Cosmos DB Fleet. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Cosmos DB fleet name. Needs to be unique under a subscription. + /// The parameters to provide for the current fleet. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> UpdateAsync(string subscriptionId, string resourceGroupName, string fleetName, FleetResourcePatch patch, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + Argument.AssertNotNull(patch, nameof(patch)); + + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, fleetName, patch); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + FleetResourceData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = FleetResourceData.DeserializeFleetResourceData(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Updates the properties of an existing Azure Cosmos DB Fleet. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Cosmos DB fleet name. Needs to be unique under a subscription. + /// The parameters to provide for the current fleet. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response Update(string subscriptionId, string resourceGroupName, string fleetName, FleetResourcePatch patch, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + Argument.AssertNotNull(patch, nameof(patch)); + + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, fleetName, patch); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + FleetResourceData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = FleetResourceData.DeserializeFleetResourceData(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string resourceGroupName, string fleetName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DocumentDB/fleets/", false); + uri.AppendPath(fleetName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string fleetName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Delete; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DocumentDB/fleets/", false); + uri.AppendPath(fleetName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Deletes an existing Azure Cosmos DB Fleet. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Cosmos DB fleet name. Needs to be unique under a subscription. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task DeleteAsync(string subscriptionId, string resourceGroupName, string fleetName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, fleetName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Deletes an existing Azure Cosmos DB Fleet. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Cosmos DB fleet name. Needs to be unique under a subscription. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response Delete(string subscriptionId, string resourceGroupName, string fleetName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, fleetName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListNextPageRequestUri(string nextLink, string subscriptionId) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + return uri; + } + + internal HttpMessage CreateListNextPageRequest(string nextLink, string subscriptionId) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Lists all the fleets under the subscription. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + public async Task> ListNextPageAsync(string nextLink, string subscriptionId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + + using var message = CreateListNextPageRequest(nextLink, subscriptionId); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + FleetListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = FleetListResult.DeserializeFleetListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Lists all the fleets under the subscription. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + public Response ListNextPage(string nextLink, string subscriptionId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + + using var message = CreateListNextPageRequest(nextLink, subscriptionId); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + FleetListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = FleetListResult.DeserializeFleetListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListByResourceGroupNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + return uri; + } + + internal HttpMessage CreateListByResourceGroupNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Lists all the fleets under the specified subscription and resource group. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The cancellation token to use. + /// , or is null. + /// or is an empty string, and was expected to be non-empty. + public async Task> ListByResourceGroupNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + + using var message = CreateListByResourceGroupNextPageRequest(nextLink, subscriptionId, resourceGroupName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + FleetListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = FleetListResult.DeserializeFleetListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Lists all the fleets under the specified subscription and resource group. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The cancellation token to use. + /// , or is null. + /// or is an empty string, and was expected to be non-empty. + public Response ListByResourceGroupNextPage(string nextLink, string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + + using var message = CreateListByResourceGroupNextPageRequest(nextLink, subscriptionId, resourceGroupName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + FleetListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = FleetListResult.DeserializeFleetListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/FleetspaceAccountRestOperations.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/FleetspaceAccountRestOperations.cs new file mode 100644 index 000000000000..746a625124df --- /dev/null +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/FleetspaceAccountRestOperations.cs @@ -0,0 +1,549 @@ +// 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.CosmosDB.Models; + +namespace Azure.ResourceManager.CosmosDB +{ + internal partial class FleetspaceAccountRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of FleetspaceAccountRestOperations. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// The application id to use for user agent. + /// server parameter. + /// Api Version. + /// or is null. + public FleetspaceAccountRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) + { + _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); + _endpoint = endpoint ?? new Uri("https://management.azure.com"); + _apiVersion = apiVersion ?? "2025-05-01-preview"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal RequestUriBuilder CreateListRequestUri(string subscriptionId, string resourceGroupName, string fleetName, string fleetspaceName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DocumentDB/fleets/", false); + uri.AppendPath(fleetName, true); + uri.AppendPath("/fleetspaces/", false); + uri.AppendPath(fleetspaceName, true); + uri.AppendPath("/fleetspaceAccounts", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateListRequest(string subscriptionId, string resourceGroupName, string fleetName, string fleetspaceName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DocumentDB/fleets/", false); + uri.AppendPath(fleetName, true); + uri.AppendPath("/fleetspaces/", false); + uri.AppendPath(fleetspaceName, true); + uri.AppendPath("/fleetspaceAccounts", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Lists all the fleetspaces accounts under a fleetspace. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Cosmos DB fleet name. Needs to be unique under a subscription. + /// Cosmos DB fleetspace name. Needs to be unique under a fleet. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task> ListAsync(string subscriptionId, string resourceGroupName, string fleetName, string fleetspaceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + Argument.AssertNotNullOrEmpty(fleetspaceName, nameof(fleetspaceName)); + + using var message = CreateListRequest(subscriptionId, resourceGroupName, fleetName, fleetspaceName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + FleetspaceAccountListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = FleetspaceAccountListResult.DeserializeFleetspaceAccountListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Lists all the fleetspaces accounts under a fleetspace. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Cosmos DB fleet name. Needs to be unique under a subscription. + /// Cosmos DB fleetspace name. Needs to be unique under a fleet. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response List(string subscriptionId, string resourceGroupName, string fleetName, string fleetspaceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + Argument.AssertNotNullOrEmpty(fleetspaceName, nameof(fleetspaceName)); + + using var message = CreateListRequest(subscriptionId, resourceGroupName, fleetName, fleetspaceName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + FleetspaceAccountListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = FleetspaceAccountListResult.DeserializeFleetspaceAccountListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string fleetName, string fleetspaceName, string fleetspaceAccountName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DocumentDB/fleets/", false); + uri.AppendPath(fleetName, true); + uri.AppendPath("/fleetspaces/", false); + uri.AppendPath(fleetspaceName, true); + uri.AppendPath("/fleetspaceAccounts/", false); + uri.AppendPath(fleetspaceAccountName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string fleetName, string fleetspaceName, string fleetspaceAccountName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DocumentDB/fleets/", false); + uri.AppendPath(fleetName, true); + uri.AppendPath("/fleetspaces/", false); + uri.AppendPath(fleetspaceName, true); + uri.AppendPath("/fleetspaceAccounts/", false); + uri.AppendPath(fleetspaceAccountName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Retrieves the properties of an existing Azure Cosmos DB fleetspace account under a fleetspace. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Cosmos DB fleet name. Needs to be unique under a subscription. + /// Cosmos DB fleetspace name. Needs to be unique under a fleet. + /// Cosmos DB fleetspace account name. + /// The cancellation token to use. + /// , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public async Task> GetAsync(string subscriptionId, string resourceGroupName, string fleetName, string fleetspaceName, string fleetspaceAccountName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + Argument.AssertNotNullOrEmpty(fleetspaceName, nameof(fleetspaceName)); + Argument.AssertNotNullOrEmpty(fleetspaceAccountName, nameof(fleetspaceAccountName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, fleetName, fleetspaceName, fleetspaceAccountName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + FleetspaceAccountResourceData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = FleetspaceAccountResourceData.DeserializeFleetspaceAccountResourceData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((FleetspaceAccountResourceData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + /// Retrieves the properties of an existing Azure Cosmos DB fleetspace account under a fleetspace. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Cosmos DB fleet name. Needs to be unique under a subscription. + /// Cosmos DB fleetspace name. Needs to be unique under a fleet. + /// Cosmos DB fleetspace account name. + /// The cancellation token to use. + /// , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public Response Get(string subscriptionId, string resourceGroupName, string fleetName, string fleetspaceName, string fleetspaceAccountName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + Argument.AssertNotNullOrEmpty(fleetspaceName, nameof(fleetspaceName)); + Argument.AssertNotNullOrEmpty(fleetspaceAccountName, nameof(fleetspaceAccountName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, fleetName, fleetspaceName, fleetspaceAccountName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + FleetspaceAccountResourceData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = FleetspaceAccountResourceData.DeserializeFleetspaceAccountResourceData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((FleetspaceAccountResourceData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateCreateRequestUri(string subscriptionId, string resourceGroupName, string fleetName, string fleetspaceName, string fleetspaceAccountName, FleetspaceAccountResourceData data) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DocumentDB/fleets/", false); + uri.AppendPath(fleetName, true); + uri.AppendPath("/fleetspaces/", false); + uri.AppendPath(fleetspaceName, true); + uri.AppendPath("/fleetspaceAccounts/", false); + uri.AppendPath(fleetspaceAccountName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateCreateRequest(string subscriptionId, string resourceGroupName, string fleetName, string fleetspaceName, string fleetspaceAccountName, FleetspaceAccountResourceData data) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Put; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DocumentDB/fleets/", false); + uri.AppendPath(fleetName, true); + uri.AppendPath("/fleetspaces/", false); + uri.AppendPath(fleetspaceName, true); + uri.AppendPath("/fleetspaceAccounts/", false); + uri.AppendPath(fleetspaceAccountName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(data, ModelSerializationExtensions.WireOptions); + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// Creates an Azure Cosmos DB fleetspace account under a fleetspace. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Cosmos DB fleet name. Needs to be unique under a subscription. + /// Cosmos DB fleetspace name. Needs to be unique under a fleet. + /// Cosmos DB fleetspace account name. + /// The parameters to provide for the current fleetspace account. + /// The cancellation token to use. + /// , , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public async Task CreateAsync(string subscriptionId, string resourceGroupName, string fleetName, string fleetspaceName, string fleetspaceAccountName, FleetspaceAccountResourceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + Argument.AssertNotNullOrEmpty(fleetspaceName, nameof(fleetspaceName)); + Argument.AssertNotNullOrEmpty(fleetspaceAccountName, nameof(fleetspaceAccountName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateRequest(subscriptionId, resourceGroupName, fleetName, fleetspaceName, fleetspaceAccountName, data); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 201: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Creates an Azure Cosmos DB fleetspace account under a fleetspace. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Cosmos DB fleet name. Needs to be unique under a subscription. + /// Cosmos DB fleetspace name. Needs to be unique under a fleet. + /// Cosmos DB fleetspace account name. + /// The parameters to provide for the current fleetspace account. + /// The cancellation token to use. + /// , , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public Response Create(string subscriptionId, string resourceGroupName, string fleetName, string fleetspaceName, string fleetspaceAccountName, FleetspaceAccountResourceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + Argument.AssertNotNullOrEmpty(fleetspaceName, nameof(fleetspaceName)); + Argument.AssertNotNullOrEmpty(fleetspaceAccountName, nameof(fleetspaceAccountName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateRequest(subscriptionId, resourceGroupName, fleetName, fleetspaceName, fleetspaceAccountName, data); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 201: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string resourceGroupName, string fleetName, string fleetspaceName, string fleetspaceAccountName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DocumentDB/fleets/", false); + uri.AppendPath(fleetName, true); + uri.AppendPath("/fleetspaces/", false); + uri.AppendPath(fleetspaceName, true); + uri.AppendPath("/fleetspaceAccounts/", false); + uri.AppendPath(fleetspaceAccountName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string fleetName, string fleetspaceName, string fleetspaceAccountName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Delete; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DocumentDB/fleets/", false); + uri.AppendPath(fleetName, true); + uri.AppendPath("/fleetspaces/", false); + uri.AppendPath(fleetspaceName, true); + uri.AppendPath("/fleetspaceAccounts/", false); + uri.AppendPath(fleetspaceAccountName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Removes an existing Azure Cosmos DB fleetspace account from a fleetspace. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Cosmos DB fleet name. Needs to be unique under a subscription. + /// Cosmos DB fleetspace name. Needs to be unique under a fleet. + /// Cosmos DB fleetspace account name. + /// The cancellation token to use. + /// , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public async Task DeleteAsync(string subscriptionId, string resourceGroupName, string fleetName, string fleetspaceName, string fleetspaceAccountName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + Argument.AssertNotNullOrEmpty(fleetspaceName, nameof(fleetspaceName)); + Argument.AssertNotNullOrEmpty(fleetspaceAccountName, nameof(fleetspaceAccountName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, fleetName, fleetspaceName, fleetspaceAccountName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Removes an existing Azure Cosmos DB fleetspace account from a fleetspace. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Cosmos DB fleet name. Needs to be unique under a subscription. + /// Cosmos DB fleetspace name. Needs to be unique under a fleet. + /// Cosmos DB fleetspace account name. + /// The cancellation token to use. + /// , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public Response Delete(string subscriptionId, string resourceGroupName, string fleetName, string fleetspaceName, string fleetspaceAccountName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + Argument.AssertNotNullOrEmpty(fleetspaceName, nameof(fleetspaceName)); + Argument.AssertNotNullOrEmpty(fleetspaceAccountName, nameof(fleetspaceAccountName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, fleetName, fleetspaceName, fleetspaceAccountName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName, string fleetName, string fleetspaceName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + return uri; + } + + internal HttpMessage CreateListNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string fleetName, string fleetspaceName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + 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; + } + + /// Lists all the fleetspaces accounts under a fleetspace. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Cosmos DB fleet name. Needs to be unique under a subscription. + /// Cosmos DB fleetspace name. Needs to be unique under a fleet. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task> ListNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string fleetName, string fleetspaceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + Argument.AssertNotNullOrEmpty(fleetspaceName, nameof(fleetspaceName)); + + using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, fleetName, fleetspaceName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + FleetspaceAccountListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = FleetspaceAccountListResult.DeserializeFleetspaceAccountListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Lists all the fleetspaces accounts under a fleetspace. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Cosmos DB fleet name. Needs to be unique under a subscription. + /// Cosmos DB fleetspace name. Needs to be unique under a fleet. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response ListNextPage(string nextLink, string subscriptionId, string resourceGroupName, string fleetName, string fleetspaceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + Argument.AssertNotNullOrEmpty(fleetspaceName, nameof(fleetspaceName)); + + using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, fleetName, fleetspaceName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + FleetspaceAccountListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = FleetspaceAccountListResult.DeserializeFleetspaceAccountListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/FleetspaceRestOperations.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/FleetspaceRestOperations.cs new file mode 100644 index 000000000000..10e6e1641002 --- /dev/null +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/FleetspaceRestOperations.cs @@ -0,0 +1,613 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.CosmosDB.Models; + +namespace Azure.ResourceManager.CosmosDB +{ + internal partial class FleetspaceRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of FleetspaceRestOperations. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// The application id to use for user agent. + /// server parameter. + /// Api Version. + /// or is null. + public FleetspaceRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) + { + _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); + _endpoint = endpoint ?? new Uri("https://management.azure.com"); + _apiVersion = apiVersion ?? "2025-05-01-preview"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal RequestUriBuilder CreateListRequestUri(string subscriptionId, string resourceGroupName, string fleetName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DocumentDB/fleets/", false); + uri.AppendPath(fleetName, true); + uri.AppendPath("/fleetspaces", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateListRequest(string subscriptionId, string resourceGroupName, string fleetName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DocumentDB/fleets/", false); + uri.AppendPath(fleetName, true); + uri.AppendPath("/fleetspaces", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Lists all the fleetspaces under a fleet. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Cosmos DB fleet name. Needs to be unique under a subscription. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> ListAsync(string subscriptionId, string resourceGroupName, string fleetName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + + using var message = CreateListRequest(subscriptionId, resourceGroupName, fleetName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + FleetspaceListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = FleetspaceListResult.DeserializeFleetspaceListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Lists all the fleetspaces under a fleet. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Cosmos DB fleet name. Needs to be unique under a subscription. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response List(string subscriptionId, string resourceGroupName, string fleetName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + + using var message = CreateListRequest(subscriptionId, resourceGroupName, fleetName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + FleetspaceListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = FleetspaceListResult.DeserializeFleetspaceListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string fleetName, string fleetspaceName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DocumentDB/fleets/", false); + uri.AppendPath(fleetName, true); + uri.AppendPath("/fleetspaces/", false); + uri.AppendPath(fleetspaceName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string fleetName, string fleetspaceName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DocumentDB/fleets/", false); + uri.AppendPath(fleetName, true); + uri.AppendPath("/fleetspaces/", false); + uri.AppendPath(fleetspaceName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Retrieves the properties of an existing Azure Cosmos DB fleetspace under a fleet. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Cosmos DB fleet name. Needs to be unique under a subscription. + /// Cosmos DB fleetspace name. Needs to be unique under a fleet. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task> GetAsync(string subscriptionId, string resourceGroupName, string fleetName, string fleetspaceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + Argument.AssertNotNullOrEmpty(fleetspaceName, nameof(fleetspaceName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, fleetName, fleetspaceName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + FleetspaceResourceData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = FleetspaceResourceData.DeserializeFleetspaceResourceData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((FleetspaceResourceData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + /// Retrieves the properties of an existing Azure Cosmos DB fleetspace under a fleet. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Cosmos DB fleet name. Needs to be unique under a subscription. + /// Cosmos DB fleetspace name. Needs to be unique under a fleet. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response Get(string subscriptionId, string resourceGroupName, string fleetName, string fleetspaceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + Argument.AssertNotNullOrEmpty(fleetspaceName, nameof(fleetspaceName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, fleetName, fleetspaceName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + FleetspaceResourceData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = FleetspaceResourceData.DeserializeFleetspaceResourceData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((FleetspaceResourceData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateCreateRequestUri(string subscriptionId, string resourceGroupName, string fleetName, string fleetspaceName, FleetspaceResourceData data) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DocumentDB/fleets/", false); + uri.AppendPath(fleetName, true); + uri.AppendPath("/fleetspaces/", false); + uri.AppendPath(fleetspaceName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateCreateRequest(string subscriptionId, string resourceGroupName, string fleetName, string fleetspaceName, FleetspaceResourceData data) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Put; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DocumentDB/fleets/", false); + uri.AppendPath(fleetName, true); + uri.AppendPath("/fleetspaces/", false); + uri.AppendPath(fleetspaceName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(data, ModelSerializationExtensions.WireOptions); + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// Creates an Azure Cosmos DB fleetspace under a fleet. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Cosmos DB fleet name. Needs to be unique under a subscription. + /// Cosmos DB fleetspace name. Needs to be unique under a fleet. + /// The parameters to provide for the current fleetspace. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task CreateAsync(string subscriptionId, string resourceGroupName, string fleetName, string fleetspaceName, FleetspaceResourceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + Argument.AssertNotNullOrEmpty(fleetspaceName, nameof(fleetspaceName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateRequest(subscriptionId, resourceGroupName, fleetName, fleetspaceName, data); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 201: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Creates an Azure Cosmos DB fleetspace under a fleet. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Cosmos DB fleet name. Needs to be unique under a subscription. + /// Cosmos DB fleetspace name. Needs to be unique under a fleet. + /// The parameters to provide for the current fleetspace. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response Create(string subscriptionId, string resourceGroupName, string fleetName, string fleetspaceName, FleetspaceResourceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + Argument.AssertNotNullOrEmpty(fleetspaceName, nameof(fleetspaceName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateRequest(subscriptionId, resourceGroupName, fleetName, fleetspaceName, data); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 201: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateUpdateRequestUri(string subscriptionId, string resourceGroupName, string fleetName, string fleetspaceName, FleetspaceResourcePatch patch) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DocumentDB/fleets/", false); + uri.AppendPath(fleetName, true); + uri.AppendPath("/fleetspaces/", false); + uri.AppendPath(fleetspaceName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceGroupName, string fleetName, string fleetspaceName, FleetspaceResourcePatch patch) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Patch; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DocumentDB/fleets/", false); + uri.AppendPath(fleetName, true); + uri.AppendPath("/fleetspaces/", false); + uri.AppendPath(fleetspaceName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(patch, ModelSerializationExtensions.WireOptions); + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// Update the properties of an existing Azure Cosmos DB fleetspace under a fleet. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Cosmos DB fleet name. Needs to be unique under a subscription. + /// Cosmos DB fleetspace name. Needs to be unique under a fleet. + /// The parameters to provide for the current fleetspace. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task UpdateAsync(string subscriptionId, string resourceGroupName, string fleetName, string fleetspaceName, FleetspaceResourcePatch patch, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + Argument.AssertNotNullOrEmpty(fleetspaceName, nameof(fleetspaceName)); + Argument.AssertNotNull(patch, nameof(patch)); + + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, fleetName, fleetspaceName, patch); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Update the properties of an existing Azure Cosmos DB fleetspace under a fleet. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Cosmos DB fleet name. Needs to be unique under a subscription. + /// Cosmos DB fleetspace name. Needs to be unique under a fleet. + /// The parameters to provide for the current fleetspace. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response Update(string subscriptionId, string resourceGroupName, string fleetName, string fleetspaceName, FleetspaceResourcePatch patch, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + Argument.AssertNotNullOrEmpty(fleetspaceName, nameof(fleetspaceName)); + Argument.AssertNotNull(patch, nameof(patch)); + + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, fleetName, fleetspaceName, patch); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string resourceGroupName, string fleetName, string fleetspaceName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DocumentDB/fleets/", false); + uri.AppendPath(fleetName, true); + uri.AppendPath("/fleetspaces/", false); + uri.AppendPath(fleetspaceName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string fleetName, string fleetspaceName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Delete; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DocumentDB/fleets/", false); + uri.AppendPath(fleetName, true); + uri.AppendPath("/fleetspaces/", false); + uri.AppendPath(fleetspaceName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Deletes an existing Azure Cosmos DB Fleetspace. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Cosmos DB fleet name. Needs to be unique under a subscription. + /// Cosmos DB fleetspace name. Needs to be unique under a fleet. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task DeleteAsync(string subscriptionId, string resourceGroupName, string fleetName, string fleetspaceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + Argument.AssertNotNullOrEmpty(fleetspaceName, nameof(fleetspaceName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, fleetName, fleetspaceName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Deletes an existing Azure Cosmos DB Fleetspace. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Cosmos DB fleet name. Needs to be unique under a subscription. + /// Cosmos DB fleetspace name. Needs to be unique under a fleet. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response Delete(string subscriptionId, string resourceGroupName, string fleetName, string fleetspaceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + Argument.AssertNotNullOrEmpty(fleetspaceName, nameof(fleetspaceName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, fleetName, fleetspaceName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName, string fleetName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + return uri; + } + + internal HttpMessage CreateListNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string fleetName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + 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; + } + + /// Lists all the fleetspaces under a fleet. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Cosmos DB fleet name. Needs to be unique under a subscription. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> ListNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string fleetName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + + using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, fleetName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + FleetspaceListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = FleetspaceListResult.DeserializeFleetspaceListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Lists all the fleetspaces under a fleet. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Cosmos DB fleet name. Needs to be unique under a subscription. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response ListNextPage(string nextLink, string subscriptionId, string resourceGroupName, string fleetName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + + using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, fleetName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + FleetspaceListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = FleetspaceListResult.DeserializeFleetspaceListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/GraphResourcesRestOperations.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/GraphResourcesRestOperations.cs index 08b9a4a4744b..cad0ed428f9e 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/GraphResourcesRestOperations.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/GraphResourcesRestOperations.cs @@ -32,7 +32,7 @@ public GraphResourcesRestOperations(HttpPipeline pipeline, string applicationId, { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2024-12-01-preview"; + _apiVersion = apiVersion ?? "2025-05-01-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/GremlinResourcesRestOperations.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/GremlinResourcesRestOperations.cs index abb3d79d51b0..217a717b4e3f 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/GremlinResourcesRestOperations.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/GremlinResourcesRestOperations.cs @@ -32,7 +32,7 @@ public GremlinResourcesRestOperations(HttpPipeline pipeline, string applicationI { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2024-12-01-preview"; + _apiVersion = apiVersion ?? "2025-05-01-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } @@ -1779,5 +1779,789 @@ public Response RetrieveContinuousBackupInformation(string subscriptionId, strin throw new RequestFailedException(message.Response); } } + + internal RequestUriBuilder CreateGetGremlinRoleDefinitionRequestUri(string subscriptionId, string resourceGroupName, string accountName, string roleDefinitionId) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DocumentDB/databaseAccounts/", false); + uri.AppendPath(accountName, true); + uri.AppendPath("/gremlinRoleDefinitions/", false); + uri.AppendPath(roleDefinitionId, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateGetGremlinRoleDefinitionRequest(string subscriptionId, string resourceGroupName, string accountName, string roleDefinitionId) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DocumentDB/databaseAccounts/", false); + uri.AppendPath(accountName, true); + uri.AppendPath("/gremlinRoleDefinitions/", false); + uri.AppendPath(roleDefinitionId, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Retrieves the properties of an existing Azure Cosmos DB Gremlin Role Definition with the given Id. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Cosmos DB database account name. + /// The GUID for the Role Definition. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task> GetGremlinRoleDefinitionAsync(string subscriptionId, string resourceGroupName, string accountName, string roleDefinitionId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); + Argument.AssertNotNullOrEmpty(roleDefinitionId, nameof(roleDefinitionId)); + + using var message = CreateGetGremlinRoleDefinitionRequest(subscriptionId, resourceGroupName, accountName, roleDefinitionId); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + GremlinRoleDefinitionResourceData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = GremlinRoleDefinitionResourceData.DeserializeGremlinRoleDefinitionResourceData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((GremlinRoleDefinitionResourceData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + /// Retrieves the properties of an existing Azure Cosmos DB Gremlin Role Definition with the given Id. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Cosmos DB database account name. + /// The GUID for the Role Definition. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response GetGremlinRoleDefinition(string subscriptionId, string resourceGroupName, string accountName, string roleDefinitionId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); + Argument.AssertNotNullOrEmpty(roleDefinitionId, nameof(roleDefinitionId)); + + using var message = CreateGetGremlinRoleDefinitionRequest(subscriptionId, resourceGroupName, accountName, roleDefinitionId); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + GremlinRoleDefinitionResourceData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = GremlinRoleDefinitionResourceData.DeserializeGremlinRoleDefinitionResourceData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((GremlinRoleDefinitionResourceData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateCreateUpdateGremlinRoleDefinitionRequestUri(string subscriptionId, string resourceGroupName, string accountName, string roleDefinitionId, GremlinRoleDefinitionResourceData data) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DocumentDB/databaseAccounts/", false); + uri.AppendPath(accountName, true); + uri.AppendPath("/gremlinRoleDefinitions/", false); + uri.AppendPath(roleDefinitionId, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateCreateUpdateGremlinRoleDefinitionRequest(string subscriptionId, string resourceGroupName, string accountName, string roleDefinitionId, GremlinRoleDefinitionResourceData data) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Put; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DocumentDB/databaseAccounts/", false); + uri.AppendPath(accountName, true); + uri.AppendPath("/gremlinRoleDefinitions/", false); + uri.AppendPath(roleDefinitionId, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(data, ModelSerializationExtensions.WireOptions); + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// Creates or updates an Azure Cosmos DB Gremlin Role Definition. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Cosmos DB database account name. + /// The GUID for the Role Definition. + /// The properties required to create or update a Role Definition. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task CreateUpdateGremlinRoleDefinitionAsync(string subscriptionId, string resourceGroupName, string accountName, string roleDefinitionId, GremlinRoleDefinitionResourceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); + Argument.AssertNotNullOrEmpty(roleDefinitionId, nameof(roleDefinitionId)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateUpdateGremlinRoleDefinitionRequest(subscriptionId, resourceGroupName, accountName, roleDefinitionId, data); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Creates or updates an Azure Cosmos DB Gremlin Role Definition. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Cosmos DB database account name. + /// The GUID for the Role Definition. + /// The properties required to create or update a Role Definition. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response CreateUpdateGremlinRoleDefinition(string subscriptionId, string resourceGroupName, string accountName, string roleDefinitionId, GremlinRoleDefinitionResourceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); + Argument.AssertNotNullOrEmpty(roleDefinitionId, nameof(roleDefinitionId)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateUpdateGremlinRoleDefinitionRequest(subscriptionId, resourceGroupName, accountName, roleDefinitionId, data); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateDeleteGremlinRoleDefinitionRequestUri(string subscriptionId, string resourceGroupName, string accountName, string roleDefinitionId) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DocumentDB/databaseAccounts/", false); + uri.AppendPath(accountName, true); + uri.AppendPath("/gremlinRoleDefinitions/", false); + uri.AppendPath(roleDefinitionId, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateDeleteGremlinRoleDefinitionRequest(string subscriptionId, string resourceGroupName, string accountName, string roleDefinitionId) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Delete; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DocumentDB/databaseAccounts/", false); + uri.AppendPath(accountName, true); + uri.AppendPath("/gremlinRoleDefinitions/", false); + uri.AppendPath(roleDefinitionId, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Deletes an existing Azure Cosmos DB Gremlin Role Definition. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Cosmos DB database account name. + /// The GUID for the Role Definition. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task DeleteGremlinRoleDefinitionAsync(string subscriptionId, string resourceGroupName, string accountName, string roleDefinitionId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); + Argument.AssertNotNullOrEmpty(roleDefinitionId, nameof(roleDefinitionId)); + + using var message = CreateDeleteGremlinRoleDefinitionRequest(subscriptionId, resourceGroupName, accountName, roleDefinitionId); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Deletes an existing Azure Cosmos DB Gremlin Role Definition. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Cosmos DB database account name. + /// The GUID for the Role Definition. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response DeleteGremlinRoleDefinition(string subscriptionId, string resourceGroupName, string accountName, string roleDefinitionId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); + Argument.AssertNotNullOrEmpty(roleDefinitionId, nameof(roleDefinitionId)); + + using var message = CreateDeleteGremlinRoleDefinitionRequest(subscriptionId, resourceGroupName, accountName, roleDefinitionId); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListGremlinRoleDefinitionsRequestUri(string subscriptionId, string resourceGroupName, string accountName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DocumentDB/databaseAccounts/", false); + uri.AppendPath(accountName, true); + uri.AppendPath("/gremlinRoleDefinitions", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateListGremlinRoleDefinitionsRequest(string subscriptionId, string resourceGroupName, string accountName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DocumentDB/databaseAccounts/", false); + uri.AppendPath(accountName, true); + uri.AppendPath("/gremlinRoleDefinitions", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Retrieves the list of all Azure Cosmos DB Gremlin Role Definitions. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Cosmos DB database account name. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> ListGremlinRoleDefinitionsAsync(string subscriptionId, string resourceGroupName, string accountName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); + + using var message = CreateListGremlinRoleDefinitionsRequest(subscriptionId, resourceGroupName, accountName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + GremlinRoleDefinitionListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = GremlinRoleDefinitionListResult.DeserializeGremlinRoleDefinitionListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Retrieves the list of all Azure Cosmos DB Gremlin Role Definitions. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Cosmos DB database account name. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response ListGremlinRoleDefinitions(string subscriptionId, string resourceGroupName, string accountName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); + + using var message = CreateListGremlinRoleDefinitionsRequest(subscriptionId, resourceGroupName, accountName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + GremlinRoleDefinitionListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = GremlinRoleDefinitionListResult.DeserializeGremlinRoleDefinitionListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateGetGremlinRoleAssignmentRequestUri(string subscriptionId, string resourceGroupName, string accountName, string roleAssignmentId) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DocumentDB/databaseAccounts/", false); + uri.AppendPath(accountName, true); + uri.AppendPath("/gremlinRoleAssignments/", false); + uri.AppendPath(roleAssignmentId, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateGetGremlinRoleAssignmentRequest(string subscriptionId, string resourceGroupName, string accountName, string roleAssignmentId) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DocumentDB/databaseAccounts/", false); + uri.AppendPath(accountName, true); + uri.AppendPath("/gremlinRoleAssignments/", false); + uri.AppendPath(roleAssignmentId, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Retrieves the properties of an existing Azure Cosmos DB Gremlin Role Assignment with the given Id. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Cosmos DB database account name. + /// The GUID for the Role Assignment. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task> GetGremlinRoleAssignmentAsync(string subscriptionId, string resourceGroupName, string accountName, string roleAssignmentId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); + Argument.AssertNotNullOrEmpty(roleAssignmentId, nameof(roleAssignmentId)); + + using var message = CreateGetGremlinRoleAssignmentRequest(subscriptionId, resourceGroupName, accountName, roleAssignmentId); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + GremlinRoleAssignmentResourceData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = GremlinRoleAssignmentResourceData.DeserializeGremlinRoleAssignmentResourceData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((GremlinRoleAssignmentResourceData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + /// Retrieves the properties of an existing Azure Cosmos DB Gremlin Role Assignment with the given Id. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Cosmos DB database account name. + /// The GUID for the Role Assignment. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response GetGremlinRoleAssignment(string subscriptionId, string resourceGroupName, string accountName, string roleAssignmentId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); + Argument.AssertNotNullOrEmpty(roleAssignmentId, nameof(roleAssignmentId)); + + using var message = CreateGetGremlinRoleAssignmentRequest(subscriptionId, resourceGroupName, accountName, roleAssignmentId); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + GremlinRoleAssignmentResourceData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = GremlinRoleAssignmentResourceData.DeserializeGremlinRoleAssignmentResourceData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((GremlinRoleAssignmentResourceData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateCreateUpdateGremlinRoleAssignmentRequestUri(string subscriptionId, string resourceGroupName, string accountName, string roleAssignmentId, GremlinRoleAssignmentResourceData data) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DocumentDB/databaseAccounts/", false); + uri.AppendPath(accountName, true); + uri.AppendPath("/gremlinRoleAssignments/", false); + uri.AppendPath(roleAssignmentId, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateCreateUpdateGremlinRoleAssignmentRequest(string subscriptionId, string resourceGroupName, string accountName, string roleAssignmentId, GremlinRoleAssignmentResourceData data) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Put; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DocumentDB/databaseAccounts/", false); + uri.AppendPath(accountName, true); + uri.AppendPath("/gremlinRoleAssignments/", false); + uri.AppendPath(roleAssignmentId, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(data, ModelSerializationExtensions.WireOptions); + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// Creates or updates an Azure Cosmos DB Gremlin Role Assignment. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Cosmos DB database account name. + /// The GUID for the Role Assignment. + /// The properties required to create or update a Role Assignment. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task CreateUpdateGremlinRoleAssignmentAsync(string subscriptionId, string resourceGroupName, string accountName, string roleAssignmentId, GremlinRoleAssignmentResourceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); + Argument.AssertNotNullOrEmpty(roleAssignmentId, nameof(roleAssignmentId)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateUpdateGremlinRoleAssignmentRequest(subscriptionId, resourceGroupName, accountName, roleAssignmentId, data); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Creates or updates an Azure Cosmos DB Gremlin Role Assignment. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Cosmos DB database account name. + /// The GUID for the Role Assignment. + /// The properties required to create or update a Role Assignment. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response CreateUpdateGremlinRoleAssignment(string subscriptionId, string resourceGroupName, string accountName, string roleAssignmentId, GremlinRoleAssignmentResourceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); + Argument.AssertNotNullOrEmpty(roleAssignmentId, nameof(roleAssignmentId)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateUpdateGremlinRoleAssignmentRequest(subscriptionId, resourceGroupName, accountName, roleAssignmentId, data); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateDeleteGremlinRoleAssignmentRequestUri(string subscriptionId, string resourceGroupName, string accountName, string roleAssignmentId) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DocumentDB/databaseAccounts/", false); + uri.AppendPath(accountName, true); + uri.AppendPath("/gremlinRoleAssignments/", false); + uri.AppendPath(roleAssignmentId, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateDeleteGremlinRoleAssignmentRequest(string subscriptionId, string resourceGroupName, string accountName, string roleAssignmentId) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Delete; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DocumentDB/databaseAccounts/", false); + uri.AppendPath(accountName, true); + uri.AppendPath("/gremlinRoleAssignments/", false); + uri.AppendPath(roleAssignmentId, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Deletes an existing Azure Cosmos DB Gremlin Role Assignment. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Cosmos DB database account name. + /// The GUID for the Role Assignment. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task DeleteGremlinRoleAssignmentAsync(string subscriptionId, string resourceGroupName, string accountName, string roleAssignmentId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); + Argument.AssertNotNullOrEmpty(roleAssignmentId, nameof(roleAssignmentId)); + + using var message = CreateDeleteGremlinRoleAssignmentRequest(subscriptionId, resourceGroupName, accountName, roleAssignmentId); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Deletes an existing Azure Cosmos DB Gremlin Role Assignment. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Cosmos DB database account name. + /// The GUID for the Role Assignment. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response DeleteGremlinRoleAssignment(string subscriptionId, string resourceGroupName, string accountName, string roleAssignmentId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); + Argument.AssertNotNullOrEmpty(roleAssignmentId, nameof(roleAssignmentId)); + + using var message = CreateDeleteGremlinRoleAssignmentRequest(subscriptionId, resourceGroupName, accountName, roleAssignmentId); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListGremlinRoleAssignmentsRequestUri(string subscriptionId, string resourceGroupName, string accountName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DocumentDB/databaseAccounts/", false); + uri.AppendPath(accountName, true); + uri.AppendPath("/gremlinRoleAssignments", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateListGremlinRoleAssignmentsRequest(string subscriptionId, string resourceGroupName, string accountName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DocumentDB/databaseAccounts/", false); + uri.AppendPath(accountName, true); + uri.AppendPath("/gremlinRoleAssignments", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Retrieves the list of all Azure Cosmos DB Gremlin Role Assignments. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Cosmos DB database account name. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> ListGremlinRoleAssignmentsAsync(string subscriptionId, string resourceGroupName, string accountName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); + + using var message = CreateListGremlinRoleAssignmentsRequest(subscriptionId, resourceGroupName, accountName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + GremlinRoleAssignmentListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = GremlinRoleAssignmentListResult.DeserializeGremlinRoleAssignmentListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Retrieves the list of all Azure Cosmos DB Gremlin Role Assignments. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Cosmos DB database account name. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response ListGremlinRoleAssignments(string subscriptionId, string resourceGroupName, string accountName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); + + using var message = CreateListGremlinRoleAssignmentsRequest(subscriptionId, resourceGroupName, accountName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + GremlinRoleAssignmentListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = GremlinRoleAssignmentListResult.DeserializeGremlinRoleAssignmentListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } } } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/LocationsRestOperations.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/LocationsRestOperations.cs index d1b742c42c56..6c17895de47b 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/LocationsRestOperations.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/LocationsRestOperations.cs @@ -32,7 +32,7 @@ public LocationsRestOperations(HttpPipeline pipeline, string applicationId, Uri { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2024-12-01-preview"; + _apiVersion = apiVersion ?? "2025-05-01-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/MongoDBResourcesRestOperations.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/MongoDBResourcesRestOperations.cs index bf36184e7106..25e4efcafb36 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/MongoDBResourcesRestOperations.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/MongoDBResourcesRestOperations.cs @@ -32,7 +32,7 @@ public MongoDBResourcesRestOperations(HttpPipeline pipeline, string applicationI { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2024-12-01-preview"; + _apiVersion = apiVersion ?? "2025-05-01-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/MongoMIResourcesRestOperations.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/MongoMIResourcesRestOperations.cs new file mode 100644 index 000000000000..74a331dbff56 --- /dev/null +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/MongoMIResourcesRestOperations.cs @@ -0,0 +1,823 @@ +// 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.CosmosDB.Models; + +namespace Azure.ResourceManager.CosmosDB +{ + internal partial class MongoMIResourcesRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of MongoMIResourcesRestOperations. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// The application id to use for user agent. + /// server parameter. + /// Api Version. + /// or is null. + public MongoMIResourcesRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) + { + _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); + _endpoint = endpoint ?? new Uri("https://management.azure.com"); + _apiVersion = apiVersion ?? "2025-05-01-preview"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal RequestUriBuilder CreateGetMongoMIRoleDefinitionRequestUri(string subscriptionId, string resourceGroupName, string accountName, string roleDefinitionId) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DocumentDB/databaseAccounts/", false); + uri.AppendPath(accountName, true); + uri.AppendPath("/mongoMIRoleDefinitions/", false); + uri.AppendPath(roleDefinitionId, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateGetMongoMIRoleDefinitionRequest(string subscriptionId, string resourceGroupName, string accountName, string roleDefinitionId) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DocumentDB/databaseAccounts/", false); + uri.AppendPath(accountName, true); + uri.AppendPath("/mongoMIRoleDefinitions/", false); + uri.AppendPath(roleDefinitionId, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Retrieves the properties of an existing Azure Cosmos DB MongoMI Role Definition with the given Id. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Cosmos DB database account name. + /// The GUID for the Role Definition. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task> GetMongoMIRoleDefinitionAsync(string subscriptionId, string resourceGroupName, string accountName, string roleDefinitionId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); + Argument.AssertNotNullOrEmpty(roleDefinitionId, nameof(roleDefinitionId)); + + using var message = CreateGetMongoMIRoleDefinitionRequest(subscriptionId, resourceGroupName, accountName, roleDefinitionId); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + MongoMIRoleDefinitionResourceData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = MongoMIRoleDefinitionResourceData.DeserializeMongoMIRoleDefinitionResourceData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((MongoMIRoleDefinitionResourceData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + /// Retrieves the properties of an existing Azure Cosmos DB MongoMI Role Definition with the given Id. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Cosmos DB database account name. + /// The GUID for the Role Definition. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response GetMongoMIRoleDefinition(string subscriptionId, string resourceGroupName, string accountName, string roleDefinitionId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); + Argument.AssertNotNullOrEmpty(roleDefinitionId, nameof(roleDefinitionId)); + + using var message = CreateGetMongoMIRoleDefinitionRequest(subscriptionId, resourceGroupName, accountName, roleDefinitionId); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + MongoMIRoleDefinitionResourceData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = MongoMIRoleDefinitionResourceData.DeserializeMongoMIRoleDefinitionResourceData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((MongoMIRoleDefinitionResourceData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateCreateUpdateMongoMIRoleDefinitionRequestUri(string subscriptionId, string resourceGroupName, string accountName, string roleDefinitionId, MongoMIRoleDefinitionResourceData data) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DocumentDB/databaseAccounts/", false); + uri.AppendPath(accountName, true); + uri.AppendPath("/mongoMIRoleDefinitions/", false); + uri.AppendPath(roleDefinitionId, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateCreateUpdateMongoMIRoleDefinitionRequest(string subscriptionId, string resourceGroupName, string accountName, string roleDefinitionId, MongoMIRoleDefinitionResourceData data) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Put; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DocumentDB/databaseAccounts/", false); + uri.AppendPath(accountName, true); + uri.AppendPath("/mongoMIRoleDefinitions/", false); + uri.AppendPath(roleDefinitionId, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(data, ModelSerializationExtensions.WireOptions); + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// Creates or updates an Azure Cosmos DB MongoMI Role Definition. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Cosmos DB database account name. + /// The GUID for the Role Definition. + /// The properties required to create or update a Role Definition. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task CreateUpdateMongoMIRoleDefinitionAsync(string subscriptionId, string resourceGroupName, string accountName, string roleDefinitionId, MongoMIRoleDefinitionResourceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); + Argument.AssertNotNullOrEmpty(roleDefinitionId, nameof(roleDefinitionId)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateUpdateMongoMIRoleDefinitionRequest(subscriptionId, resourceGroupName, accountName, roleDefinitionId, data); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Creates or updates an Azure Cosmos DB MongoMI Role Definition. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Cosmos DB database account name. + /// The GUID for the Role Definition. + /// The properties required to create or update a Role Definition. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response CreateUpdateMongoMIRoleDefinition(string subscriptionId, string resourceGroupName, string accountName, string roleDefinitionId, MongoMIRoleDefinitionResourceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); + Argument.AssertNotNullOrEmpty(roleDefinitionId, nameof(roleDefinitionId)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateUpdateMongoMIRoleDefinitionRequest(subscriptionId, resourceGroupName, accountName, roleDefinitionId, data); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateDeleteMongoMIRoleDefinitionRequestUri(string subscriptionId, string resourceGroupName, string accountName, string roleDefinitionId) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DocumentDB/databaseAccounts/", false); + uri.AppendPath(accountName, true); + uri.AppendPath("/mongoMIRoleDefinitions/", false); + uri.AppendPath(roleDefinitionId, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateDeleteMongoMIRoleDefinitionRequest(string subscriptionId, string resourceGroupName, string accountName, string roleDefinitionId) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Delete; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DocumentDB/databaseAccounts/", false); + uri.AppendPath(accountName, true); + uri.AppendPath("/mongoMIRoleDefinitions/", false); + uri.AppendPath(roleDefinitionId, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Deletes an existing Azure Cosmos DB MongoMI Role Definition. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Cosmos DB database account name. + /// The GUID for the Role Definition. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task DeleteMongoMIRoleDefinitionAsync(string subscriptionId, string resourceGroupName, string accountName, string roleDefinitionId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); + Argument.AssertNotNullOrEmpty(roleDefinitionId, nameof(roleDefinitionId)); + + using var message = CreateDeleteMongoMIRoleDefinitionRequest(subscriptionId, resourceGroupName, accountName, roleDefinitionId); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Deletes an existing Azure Cosmos DB MongoMI Role Definition. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Cosmos DB database account name. + /// The GUID for the Role Definition. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response DeleteMongoMIRoleDefinition(string subscriptionId, string resourceGroupName, string accountName, string roleDefinitionId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); + Argument.AssertNotNullOrEmpty(roleDefinitionId, nameof(roleDefinitionId)); + + using var message = CreateDeleteMongoMIRoleDefinitionRequest(subscriptionId, resourceGroupName, accountName, roleDefinitionId); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListMongoMIRoleDefinitionsRequestUri(string subscriptionId, string resourceGroupName, string accountName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DocumentDB/databaseAccounts/", false); + uri.AppendPath(accountName, true); + uri.AppendPath("/mongoMIRoleDefinitions", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateListMongoMIRoleDefinitionsRequest(string subscriptionId, string resourceGroupName, string accountName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DocumentDB/databaseAccounts/", false); + uri.AppendPath(accountName, true); + uri.AppendPath("/mongoMIRoleDefinitions", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Retrieves the list of all Azure Cosmos DB MongoMI Role Definitions. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Cosmos DB database account name. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> ListMongoMIRoleDefinitionsAsync(string subscriptionId, string resourceGroupName, string accountName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); + + using var message = CreateListMongoMIRoleDefinitionsRequest(subscriptionId, resourceGroupName, accountName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + MongoMIRoleDefinitionListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = MongoMIRoleDefinitionListResult.DeserializeMongoMIRoleDefinitionListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Retrieves the list of all Azure Cosmos DB MongoMI Role Definitions. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Cosmos DB database account name. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response ListMongoMIRoleDefinitions(string subscriptionId, string resourceGroupName, string accountName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); + + using var message = CreateListMongoMIRoleDefinitionsRequest(subscriptionId, resourceGroupName, accountName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + MongoMIRoleDefinitionListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = MongoMIRoleDefinitionListResult.DeserializeMongoMIRoleDefinitionListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateGetMongoMIRoleAssignmentRequestUri(string subscriptionId, string resourceGroupName, string accountName, string roleAssignmentId) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DocumentDB/databaseAccounts/", false); + uri.AppendPath(accountName, true); + uri.AppendPath("/mongoMIRoleAssignments/", false); + uri.AppendPath(roleAssignmentId, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateGetMongoMIRoleAssignmentRequest(string subscriptionId, string resourceGroupName, string accountName, string roleAssignmentId) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DocumentDB/databaseAccounts/", false); + uri.AppendPath(accountName, true); + uri.AppendPath("/mongoMIRoleAssignments/", false); + uri.AppendPath(roleAssignmentId, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Retrieves the properties of an existing Azure Cosmos DB MongoMI Role Assignment with the given Id. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Cosmos DB database account name. + /// The GUID for the Role Assignment. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task> GetMongoMIRoleAssignmentAsync(string subscriptionId, string resourceGroupName, string accountName, string roleAssignmentId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); + Argument.AssertNotNullOrEmpty(roleAssignmentId, nameof(roleAssignmentId)); + + using var message = CreateGetMongoMIRoleAssignmentRequest(subscriptionId, resourceGroupName, accountName, roleAssignmentId); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + MongoMIRoleAssignmentResourceData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = MongoMIRoleAssignmentResourceData.DeserializeMongoMIRoleAssignmentResourceData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((MongoMIRoleAssignmentResourceData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + /// Retrieves the properties of an existing Azure Cosmos DB MongoMI Role Assignment with the given Id. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Cosmos DB database account name. + /// The GUID for the Role Assignment. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response GetMongoMIRoleAssignment(string subscriptionId, string resourceGroupName, string accountName, string roleAssignmentId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); + Argument.AssertNotNullOrEmpty(roleAssignmentId, nameof(roleAssignmentId)); + + using var message = CreateGetMongoMIRoleAssignmentRequest(subscriptionId, resourceGroupName, accountName, roleAssignmentId); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + MongoMIRoleAssignmentResourceData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = MongoMIRoleAssignmentResourceData.DeserializeMongoMIRoleAssignmentResourceData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((MongoMIRoleAssignmentResourceData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateCreateUpdateMongoMIRoleAssignmentRequestUri(string subscriptionId, string resourceGroupName, string accountName, string roleAssignmentId, MongoMIRoleAssignmentResourceData data) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DocumentDB/databaseAccounts/", false); + uri.AppendPath(accountName, true); + uri.AppendPath("/mongoMIRoleAssignments/", false); + uri.AppendPath(roleAssignmentId, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateCreateUpdateMongoMIRoleAssignmentRequest(string subscriptionId, string resourceGroupName, string accountName, string roleAssignmentId, MongoMIRoleAssignmentResourceData data) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Put; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DocumentDB/databaseAccounts/", false); + uri.AppendPath(accountName, true); + uri.AppendPath("/mongoMIRoleAssignments/", false); + uri.AppendPath(roleAssignmentId, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(data, ModelSerializationExtensions.WireOptions); + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// Creates or updates an Azure Cosmos DB MongoMI Role Assignment. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Cosmos DB database account name. + /// The GUID for the Role Assignment. + /// The properties required to create or update a Role Assignment. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task CreateUpdateMongoMIRoleAssignmentAsync(string subscriptionId, string resourceGroupName, string accountName, string roleAssignmentId, MongoMIRoleAssignmentResourceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); + Argument.AssertNotNullOrEmpty(roleAssignmentId, nameof(roleAssignmentId)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateUpdateMongoMIRoleAssignmentRequest(subscriptionId, resourceGroupName, accountName, roleAssignmentId, data); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Creates or updates an Azure Cosmos DB MongoMI Role Assignment. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Cosmos DB database account name. + /// The GUID for the Role Assignment. + /// The properties required to create or update a Role Assignment. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response CreateUpdateMongoMIRoleAssignment(string subscriptionId, string resourceGroupName, string accountName, string roleAssignmentId, MongoMIRoleAssignmentResourceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); + Argument.AssertNotNullOrEmpty(roleAssignmentId, nameof(roleAssignmentId)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateUpdateMongoMIRoleAssignmentRequest(subscriptionId, resourceGroupName, accountName, roleAssignmentId, data); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateDeleteMongoMIRoleAssignmentRequestUri(string subscriptionId, string resourceGroupName, string accountName, string roleAssignmentId) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DocumentDB/databaseAccounts/", false); + uri.AppendPath(accountName, true); + uri.AppendPath("/mongoMIRoleAssignments/", false); + uri.AppendPath(roleAssignmentId, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateDeleteMongoMIRoleAssignmentRequest(string subscriptionId, string resourceGroupName, string accountName, string roleAssignmentId) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Delete; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DocumentDB/databaseAccounts/", false); + uri.AppendPath(accountName, true); + uri.AppendPath("/mongoMIRoleAssignments/", false); + uri.AppendPath(roleAssignmentId, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Deletes an existing Azure Cosmos DB MongoMI Role Assignment. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Cosmos DB database account name. + /// The GUID for the Role Assignment. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task DeleteMongoMIRoleAssignmentAsync(string subscriptionId, string resourceGroupName, string accountName, string roleAssignmentId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); + Argument.AssertNotNullOrEmpty(roleAssignmentId, nameof(roleAssignmentId)); + + using var message = CreateDeleteMongoMIRoleAssignmentRequest(subscriptionId, resourceGroupName, accountName, roleAssignmentId); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Deletes an existing Azure Cosmos DB MongoMI Role Assignment. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Cosmos DB database account name. + /// The GUID for the Role Assignment. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response DeleteMongoMIRoleAssignment(string subscriptionId, string resourceGroupName, string accountName, string roleAssignmentId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); + Argument.AssertNotNullOrEmpty(roleAssignmentId, nameof(roleAssignmentId)); + + using var message = CreateDeleteMongoMIRoleAssignmentRequest(subscriptionId, resourceGroupName, accountName, roleAssignmentId); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListMongoMIRoleAssignmentsRequestUri(string subscriptionId, string resourceGroupName, string accountName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DocumentDB/databaseAccounts/", false); + uri.AppendPath(accountName, true); + uri.AppendPath("/mongoMIRoleAssignments", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateListMongoMIRoleAssignmentsRequest(string subscriptionId, string resourceGroupName, string accountName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DocumentDB/databaseAccounts/", false); + uri.AppendPath(accountName, true); + uri.AppendPath("/mongoMIRoleAssignments", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Retrieves the list of all Azure Cosmos DB MongoMI Role Assignments. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Cosmos DB database account name. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> ListMongoMIRoleAssignmentsAsync(string subscriptionId, string resourceGroupName, string accountName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); + + using var message = CreateListMongoMIRoleAssignmentsRequest(subscriptionId, resourceGroupName, accountName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + MongoMIRoleAssignmentListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = MongoMIRoleAssignmentListResult.DeserializeMongoMIRoleAssignmentListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Retrieves the list of all Azure Cosmos DB MongoMI Role Assignments. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Cosmos DB database account name. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response ListMongoMIRoleAssignments(string subscriptionId, string resourceGroupName, string accountName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); + + using var message = CreateListMongoMIRoleAssignmentsRequest(subscriptionId, resourceGroupName, accountName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + MongoMIRoleAssignmentListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = MongoMIRoleAssignmentListResult.DeserializeMongoMIRoleAssignmentListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/NetworkSecurityPerimeterConfigurationsRestOperations.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/NetworkSecurityPerimeterConfigurationsRestOperations.cs index e6c0e1ae2121..632631b10afe 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/NetworkSecurityPerimeterConfigurationsRestOperations.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/NetworkSecurityPerimeterConfigurationsRestOperations.cs @@ -32,7 +32,7 @@ public NetworkSecurityPerimeterConfigurationsRestOperations(HttpPipeline pipelin { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2024-12-01-preview"; + _apiVersion = apiVersion ?? "2025-05-01-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/PartitionKeyRangeIdRegionRestOperations.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/PartitionKeyRangeIdRegionRestOperations.cs index 3ca7174ecf26..d2911615095c 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/PartitionKeyRangeIdRegionRestOperations.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/PartitionKeyRangeIdRegionRestOperations.cs @@ -32,7 +32,7 @@ public PartitionKeyRangeIdRegionRestOperations(HttpPipeline pipeline, string app { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2024-12-01-preview"; + _apiVersion = apiVersion ?? "2025-05-01-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/PartitionKeyRangeIdRestOperations.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/PartitionKeyRangeIdRestOperations.cs index 2d9e1a0d7fce..702b706e19f4 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/PartitionKeyRangeIdRestOperations.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/PartitionKeyRangeIdRestOperations.cs @@ -32,7 +32,7 @@ public PartitionKeyRangeIdRestOperations(HttpPipeline pipeline, string applicati { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2024-12-01-preview"; + _apiVersion = apiVersion ?? "2025-05-01-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/PercentileRestOperations.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/PercentileRestOperations.cs index 636f8fa7c522..e39b6199714f 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/PercentileRestOperations.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/PercentileRestOperations.cs @@ -32,7 +32,7 @@ public PercentileRestOperations(HttpPipeline pipeline, string applicationId, Uri { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2024-12-01-preview"; + _apiVersion = apiVersion ?? "2025-05-01-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/PercentileSourceTargetRestOperations.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/PercentileSourceTargetRestOperations.cs index 2928508f2e77..88538c1d43ec 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/PercentileSourceTargetRestOperations.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/PercentileSourceTargetRestOperations.cs @@ -32,7 +32,7 @@ public PercentileSourceTargetRestOperations(HttpPipeline pipeline, string applic { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2024-12-01-preview"; + _apiVersion = apiVersion ?? "2025-05-01-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/PercentileTargetRestOperations.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/PercentileTargetRestOperations.cs index d079cbe33eb9..75a83438abb5 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/PercentileTargetRestOperations.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/PercentileTargetRestOperations.cs @@ -32,7 +32,7 @@ public PercentileTargetRestOperations(HttpPipeline pipeline, string applicationI { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2024-12-01-preview"; + _apiVersion = apiVersion ?? "2025-05-01-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/PrivateEndpointConnectionsRestOperations.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/PrivateEndpointConnectionsRestOperations.cs index c53cbe3f23c9..961306d68d27 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/PrivateEndpointConnectionsRestOperations.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/PrivateEndpointConnectionsRestOperations.cs @@ -32,7 +32,7 @@ public PrivateEndpointConnectionsRestOperations(HttpPipeline pipeline, string ap { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2024-12-01-preview"; + _apiVersion = apiVersion ?? "2025-05-01-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/PrivateLinkResourcesRestOperations.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/PrivateLinkResourcesRestOperations.cs index 682c3039433e..ba244ef84a7a 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/PrivateLinkResourcesRestOperations.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/PrivateLinkResourcesRestOperations.cs @@ -32,7 +32,7 @@ public PrivateLinkResourcesRestOperations(HttpPipeline pipeline, string applicat { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2024-12-01-preview"; + _apiVersion = apiVersion ?? "2025-05-01-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/RestorableDatabaseAccountsRestOperations.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/RestorableDatabaseAccountsRestOperations.cs index 0860fe0c3e7e..6037bfe70416 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/RestorableDatabaseAccountsRestOperations.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/RestorableDatabaseAccountsRestOperations.cs @@ -32,7 +32,7 @@ public RestorableDatabaseAccountsRestOperations(HttpPipeline pipeline, string ap { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2024-12-01-preview"; + _apiVersion = apiVersion ?? "2025-05-01-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/RestorableGremlinDatabasesRestOperations.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/RestorableGremlinDatabasesRestOperations.cs index 52967b713292..ff74d8f36d8b 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/RestorableGremlinDatabasesRestOperations.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/RestorableGremlinDatabasesRestOperations.cs @@ -32,7 +32,7 @@ public RestorableGremlinDatabasesRestOperations(HttpPipeline pipeline, string ap { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2024-12-01-preview"; + _apiVersion = apiVersion ?? "2025-05-01-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/RestorableGremlinGraphsRestOperations.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/RestorableGremlinGraphsRestOperations.cs index 43c84a6bc852..664dddd702f5 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/RestorableGremlinGraphsRestOperations.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/RestorableGremlinGraphsRestOperations.cs @@ -32,7 +32,7 @@ public RestorableGremlinGraphsRestOperations(HttpPipeline pipeline, string appli { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2024-12-01-preview"; + _apiVersion = apiVersion ?? "2025-05-01-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/RestorableGremlinResourcesRestOperations.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/RestorableGremlinResourcesRestOperations.cs index bc85fae89e46..5be1f5fb6fe7 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/RestorableGremlinResourcesRestOperations.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/RestorableGremlinResourcesRestOperations.cs @@ -32,7 +32,7 @@ public RestorableGremlinResourcesRestOperations(HttpPipeline pipeline, string ap { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2024-12-01-preview"; + _apiVersion = apiVersion ?? "2025-05-01-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/RestorableMongodbCollectionsRestOperations.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/RestorableMongodbCollectionsRestOperations.cs index 9a0ca979b002..e074859d734d 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/RestorableMongodbCollectionsRestOperations.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/RestorableMongodbCollectionsRestOperations.cs @@ -32,7 +32,7 @@ public RestorableMongodbCollectionsRestOperations(HttpPipeline pipeline, string { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2024-12-01-preview"; + _apiVersion = apiVersion ?? "2025-05-01-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/RestorableMongodbDatabasesRestOperations.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/RestorableMongodbDatabasesRestOperations.cs index 9153f94b0844..c2d2e256d8a0 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/RestorableMongodbDatabasesRestOperations.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/RestorableMongodbDatabasesRestOperations.cs @@ -32,7 +32,7 @@ public RestorableMongodbDatabasesRestOperations(HttpPipeline pipeline, string ap { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2024-12-01-preview"; + _apiVersion = apiVersion ?? "2025-05-01-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/RestorableMongodbResourcesRestOperations.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/RestorableMongodbResourcesRestOperations.cs index ac2f7ca3302f..fd1efa7fae78 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/RestorableMongodbResourcesRestOperations.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/RestorableMongodbResourcesRestOperations.cs @@ -32,7 +32,7 @@ public RestorableMongodbResourcesRestOperations(HttpPipeline pipeline, string ap { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2024-12-01-preview"; + _apiVersion = apiVersion ?? "2025-05-01-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/RestorableSqlContainersRestOperations.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/RestorableSqlContainersRestOperations.cs index 76655bac0dbf..83c5e8c78f20 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/RestorableSqlContainersRestOperations.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/RestorableSqlContainersRestOperations.cs @@ -32,7 +32,7 @@ public RestorableSqlContainersRestOperations(HttpPipeline pipeline, string appli { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2024-12-01-preview"; + _apiVersion = apiVersion ?? "2025-05-01-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/RestorableSqlDatabasesRestOperations.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/RestorableSqlDatabasesRestOperations.cs index ef6bfd00ef1d..e9ae6f862a0f 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/RestorableSqlDatabasesRestOperations.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/RestorableSqlDatabasesRestOperations.cs @@ -32,7 +32,7 @@ public RestorableSqlDatabasesRestOperations(HttpPipeline pipeline, string applic { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2024-12-01-preview"; + _apiVersion = apiVersion ?? "2025-05-01-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/RestorableSqlResourcesRestOperations.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/RestorableSqlResourcesRestOperations.cs index 09c48c29f763..4609a59c7432 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/RestorableSqlResourcesRestOperations.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/RestorableSqlResourcesRestOperations.cs @@ -32,7 +32,7 @@ public RestorableSqlResourcesRestOperations(HttpPipeline pipeline, string applic { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2024-12-01-preview"; + _apiVersion = apiVersion ?? "2025-05-01-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/RestorableTableResourcesRestOperations.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/RestorableTableResourcesRestOperations.cs index 4242b73b8959..6d5684272399 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/RestorableTableResourcesRestOperations.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/RestorableTableResourcesRestOperations.cs @@ -32,7 +32,7 @@ public RestorableTableResourcesRestOperations(HttpPipeline pipeline, string appl { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2024-12-01-preview"; + _apiVersion = apiVersion ?? "2025-05-01-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/RestorableTablesRestOperations.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/RestorableTablesRestOperations.cs index 5d11e7d33221..b72060ee490b 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/RestorableTablesRestOperations.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/RestorableTablesRestOperations.cs @@ -32,7 +32,7 @@ public RestorableTablesRestOperations(HttpPipeline pipeline, string applicationI { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2024-12-01-preview"; + _apiVersion = apiVersion ?? "2025-05-01-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/ServiceRestOperations.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/ServiceRestOperations.cs index 66c90107b34d..89aa494f9f74 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/ServiceRestOperations.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/ServiceRestOperations.cs @@ -32,7 +32,7 @@ public ServiceRestOperations(HttpPipeline pipeline, string applicationId, Uri en { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2024-12-01-preview"; + _apiVersion = apiVersion ?? "2025-05-01-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/SqlResourcesRestOperations.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/SqlResourcesRestOperations.cs index c5bf3b036816..01346fc29453 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/SqlResourcesRestOperations.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/SqlResourcesRestOperations.cs @@ -32,7 +32,7 @@ public SqlResourcesRestOperations(HttpPipeline pipeline, string applicationId, U { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2024-12-01-preview"; + _apiVersion = apiVersion ?? "2025-05-01-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/TableResourcesRestOperations.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/TableResourcesRestOperations.cs index e24377b30eaf..87db22e48963 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/TableResourcesRestOperations.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/TableResourcesRestOperations.cs @@ -32,7 +32,7 @@ public TableResourcesRestOperations(HttpPipeline pipeline, string applicationId, { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2024-12-01-preview"; + _apiVersion = apiVersion ?? "2025-05-01-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/ThroughputPoolAccountRestOperations.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/ThroughputPoolAccountRestOperations.cs index 17099ca199e9..ee9a07c954d1 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/ThroughputPoolAccountRestOperations.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/ThroughputPoolAccountRestOperations.cs @@ -31,7 +31,7 @@ public ThroughputPoolAccountRestOperations(HttpPipeline pipeline, string applica { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2024-12-01-preview"; + _apiVersion = apiVersion ?? "2025-05-01-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/ThroughputPoolAccountsRestOperations.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/ThroughputPoolAccountsRestOperations.cs index 35df7b033059..49cf7be7d1d0 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/ThroughputPoolAccountsRestOperations.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/ThroughputPoolAccountsRestOperations.cs @@ -32,7 +32,7 @@ public ThroughputPoolAccountsRestOperations(HttpPipeline pipeline, string applic { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2024-12-01-preview"; + _apiVersion = apiVersion ?? "2025-05-01-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/ThroughputPoolRestOperations.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/ThroughputPoolRestOperations.cs index 7e8d70c8c466..a27a95bd31c3 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/ThroughputPoolRestOperations.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/ThroughputPoolRestOperations.cs @@ -32,7 +32,7 @@ public ThroughputPoolRestOperations(HttpPipeline pipeline, string applicationId, { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2024-12-01-preview"; + _apiVersion = apiVersion ?? "2025-05-01-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/ThroughputPoolsRestOperations.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/ThroughputPoolsRestOperations.cs index c798a66ba0bf..c24546822147 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/ThroughputPoolsRestOperations.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/ThroughputPoolsRestOperations.cs @@ -32,7 +32,7 @@ public ThroughputPoolsRestOperations(HttpPipeline pipeline, string applicationId { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2024-12-01-preview"; + _apiVersion = apiVersion ?? "2025-05-01-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestorableCosmosDBAccountCollection.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestorableCosmosDBAccountCollection.cs index bafed9410c62..7643f8b64303 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestorableCosmosDBAccountCollection.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestorableCosmosDBAccountCollection.cs @@ -64,7 +64,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -105,7 +105,7 @@ public virtual async Task> GetAsync( /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -146,7 +146,7 @@ public virtual Response Get(Guid instanceId, /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -175,7 +175,7 @@ public virtual AsyncPageable GetAllAsync(Canc /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -204,7 +204,7 @@ public virtual Pageable GetAll(CancellationTo /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -243,7 +243,7 @@ public virtual async Task> ExistsAsync(Guid instanceId, Cancellat /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -282,7 +282,7 @@ public virtual Response Exists(Guid instanceId, CancellationToken cancella /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -323,7 +323,7 @@ public virtual async Task> G /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestorableCosmosDBAccountResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestorableCosmosDBAccountResource.cs index 0f8ee3410b0e..a24e1fd4b59b 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestorableCosmosDBAccountResource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestorableCosmosDBAccountResource.cs @@ -146,7 +146,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -186,7 +186,7 @@ public virtual async Task> GetAsync( /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// Resource @@ -226,7 +226,7 @@ public virtual Response Get(CancellationToken /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// @@ -251,7 +251,7 @@ public virtual AsyncPageable GetRestorableSqlDatabasesAsy /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// @@ -276,7 +276,7 @@ public virtual Pageable GetRestorableSqlDatabases(Cancell /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// @@ -304,7 +304,7 @@ public virtual AsyncPageable GetRestorableSqlContainersA /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// @@ -332,7 +332,7 @@ public virtual Pageable GetRestorableSqlContainers(strin /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// @@ -359,7 +359,7 @@ public virtual AsyncPageable GetAllRestorableSqlResou /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// @@ -386,7 +386,7 @@ public virtual Pageable GetAllRestorableSqlResourceDa /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// @@ -411,7 +411,7 @@ public virtual AsyncPageable GetRestorableMongoDBData /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// @@ -436,7 +436,7 @@ public virtual Pageable GetRestorableMongoDBDatabases /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// @@ -464,7 +464,7 @@ public virtual AsyncPageable GetRestorableMongoDBCo /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// @@ -492,7 +492,7 @@ public virtual Pageable GetRestorableMongoDBCollect /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// @@ -519,7 +519,7 @@ public virtual AsyncPageable GetAllRestorableMong /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// @@ -546,7 +546,7 @@ public virtual Pageable GetAllRestorableMongoDBRe /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// @@ -571,7 +571,7 @@ public virtual AsyncPageable GetRestorableGremlinData /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// @@ -596,7 +596,7 @@ public virtual Pageable GetRestorableGremlinDatabases /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// @@ -624,7 +624,7 @@ public virtual AsyncPageable GetRestorableGremlinGraphsA /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// @@ -652,7 +652,7 @@ public virtual Pageable GetRestorableGremlinGraphs(strin /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// @@ -679,7 +679,7 @@ public virtual AsyncPageable GetRestorableGremlin /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// @@ -706,7 +706,7 @@ public virtual Pageable GetRestorableGremlinResou /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// @@ -733,7 +733,7 @@ public virtual AsyncPageable GetRestorableTablesAsync(string st /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// @@ -760,7 +760,7 @@ public virtual Pageable GetRestorableTables(string startTime = /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// @@ -787,7 +787,7 @@ public virtual AsyncPageable GetRestorableTableReso /// /// /// Default Api Version - /// 2024-12-01-preview + /// 2025-05-01-preview /// /// /// diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/autorest.md b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/autorest.md index e254f2744d2b..0ca19298a950 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/autorest.md +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/autorest.md @@ -10,7 +10,7 @@ csharp: true library-name: CosmosDB namespace: Azure.ResourceManager.CosmosDB #tag: package-preview-2024-12-01 -require: https://github.com/Azure/azure-rest-api-specs/blob/2afa5b356adf6cf51209d2cf28d38644c69d9832/specification/cosmos-db/resource-manager/readme.md +require: /mnt/vss/_work/1/s/azure-rest-api-specs/specification/cosmos-db/resource-manager/readme.md output-folder: $(this-folder)/Generated clear-output-folder: true sample-gen: diff --git a/sdk/durabletask/ci.mgmt.yml b/sdk/durabletask/ci.mgmt.yml index 5f63204cd804..32b11e75b082 100644 --- a/sdk/durabletask/ci.mgmt.yml +++ b/sdk/durabletask/ci.mgmt.yml @@ -1,7 +1,6 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none - pr: branches: include: diff --git a/sdk/pineconevectordb/ci.yml b/sdk/pineconevectordb/ci.yml deleted file mode 100644 index 0b8325c8c903..000000000000 --- a/sdk/pineconevectordb/ci.yml +++ /dev/null @@ -1,35 +0,0 @@ -# NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. - -trigger: - branches: - include: - - main - - hotfix/* - - release/* - paths: - include: - - sdk/pineconevectordb - - sdk/pineconevectordb/ci.yml - - sdk/pineconevectordb/Azure.ResourceManager.PineconeVectorDb - -pr: - branches: - include: - - main - - feature/* - - hotfix/* - - release/* - paths: - include: - - sdk/pineconevectordb - - sdk/pineconevectordb/ci.yml - - sdk/pineconevectordb/Azure.ResourceManager.PineconeVectorDb - -extends: - template: /eng/pipelines/templates/stages/archetype-sdk-client.yml - parameters: - ServiceDirectory: pineconevectordb - ArtifactName: packages - Artifacts: - - name: Azure.ResourceManager.PineconeVectorDb - safeName: AzureResourceManagerPineconeVectorDb 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/